Skip to content

Commit 26c91ed

Browse files
Ricktabacitu
authored andcommitted
Add model_function_attribute to table list view. (#62)
Avoids creating new model methods when a method/collection already includes the required attribute. Column use only, not as a field.
1 parent 02d6e35 commit 26c91ed

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/resources/views/list.blade.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@
8989
<td><?php
9090
echo $entry->{$column['function_name']}();
9191
?></td>
92+
@elseif (isset($column['type']) && $column['type']=='model_function_attribute')
93+
{{-- custom return value via attribute --}}
94+
<td><?php
95+
echo $entry->{$column['function_name']}()->{$column['attribute']};
96+
?></td>
9297
@else
9398
{{-- regular object attribute --}}
9499
<td>{{ str_limit(strip_tags($entry->{$column['name']}), 80, "[...]") }}</td>

0 commit comments

Comments
 (0)