You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,9 @@ use LinkablePartition;
51
51
You can define metric links using the `route` method from the `Linkable` trait in one of two ways:
52
52
53
53
1. When the card is registered:
54
+
55
+
**Index Route**
56
+
54
57
```php
55
58
// NovaServiceProvider.php
56
59
@@ -62,10 +65,29 @@ You can define metric links using the `route` method from the `Linkable` trait i
62
65
protected function cards()
63
66
{
64
67
return [
65
-
(new JobsInProgress)->width('1/3')->route('index', ['resourceName' => 'jobs']),`
68
+
(new JobsInProgress)->width('1/3')->route('index', ['resourceName' => 'jobs']),
66
69
];
67
70
}
68
71
```
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
+
69
91
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):
0 commit comments