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
If you have row URLs enabled, but you have a specific column you do not want clickable, i.e. in the event there is something else clickable in that row, you may yse the following:
233
+
If you have row URLs enabled, but you have a specific column you do not want clickable, i.e. in the event there is something else clickable in that row, you may use the following:
234
234
235
235
```php
236
236
Column::make('Name')
237
237
->unclickable(),
238
238
```
239
239
240
-
See more in the [clickable rows documentation](../rows/clickable-rows).
240
+
See more in the [clickable rows documentation](../rows/clickable-rows).
Copy file name to clipboardExpand all lines: docs/columns/creating-columns.md
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,10 @@ The `columns` method on your component must return an array of Column objects in
8
8
```php
9
9
public function columns(): array
10
10
{
11
-
Column::make('Name'),
12
-
Column::make('Email'),
11
+
return [
12
+
Column::make('Name'),
13
+
Column::make('Email'),
14
+
];
13
15
}
14
16
```
15
17
@@ -20,13 +22,23 @@ By default, you only need one parameter which acts as the header of the column,
20
22
So if you have:
21
23
22
24
```php
23
-
Column::make('Name') // Looks for column `name`
24
-
Column::make('Email') // Looks for column `email`
25
+
public function columns(): array
26
+
{
27
+
return [
28
+
Column::make('Name'), // Looks for column `name`
29
+
Column::make('Email'), // Looks for column `email`
30
+
];
31
+
}
25
32
```
26
33
27
34
Of course, this won't work in every situation, for example if you have an ID column, Str::snake will convert it to `i_d` which is incorrect. For this situation and any other situation where you want to specify the field name, you can pass it as the second parameter:
0 commit comments