Skip to content

Commit 3264bba

Browse files
authored
Add lens route example.
1 parent ab79db0 commit 3264bba

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ use LinkablePartition;
5151
You can define metric links using the `route` method from the `Linkable` trait in one of two ways:
5252

5353
1. When the card is registered:
54+
55+
**Index Route**
56+
5457
```php
5558
// NovaServiceProvider.php
5659

@@ -62,10 +65,29 @@ You can define metric links using the `route` method from the `Linkable` trait i
6265
protected function cards()
6366
{
6467
return [
65-
(new JobsInProgress)->width('1/3')->route('index', ['resourceName' => 'jobs']),`
68+
(new JobsInProgress)->width('1/3')->route('index', ['resourceName' => 'jobs']),
6669
];
6770
}
6871
```
72+
73+
**OR using a Lens Route**
74+
75+
```php
76+
// NovaServiceProvider.php
77+
78+
/**
79+
* Get the cards that should be displayed on the Nova dashboard.
80+
*
81+
* @return array
82+
*/
83+
protected function cards()
84+
{
85+
return [
86+
(new JobsInProgress)->width('1/3')->route('lens', ['resourceName' => 'jobs', 'lens' => 'all-jobs']),
87+
];
88+
}
89+
```
90+
6991
2. Or, within the card itself (useful for cards only available on detail screens where you might want to filter the url based on the current resource):
7092

7193
```php

0 commit comments

Comments
 (0)