Skip to content

Commit

Permalink
Update stub files (#24)
Browse files Browse the repository at this point in the history
* Update controller.stub

* Update table.stub
  • Loading branch information
cvetty authored Jul 1, 2024
1 parent 76b7755 commit 3780a99
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion krait/stubs/controller.stub
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ class {{ class }} extends Controller
{
public function __invoke(): TableCollection
{
$items = collect([]);
$items = collect([
[
'some_field' => 'Some field value'
]
]);

return {{ tableClass }}::from($items);
}
Expand Down
7 changes: 6 additions & 1 deletion krait/stubs/table.stub
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ class {{table_classname}} extends BaseTable
$this->column(
name: 'my_first_column',
label: 'My First Column',
process: fn(mixed $resource) => 'This is the processed content!'
process: fn(mixed $resource) => 'This content is processed.'
);

$this->column(
name: 'some_field',
label: 'Resource Field',
);
}

Expand Down

0 comments on commit 3780a99

Please sign in to comment.