Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
Update InertiaTableServiceProvider.php
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbaljet committed Apr 2, 2021
1 parent e3f48c7 commit 3044826
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions php/InertiaTableServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@ class InertiaTableServiceProvider extends ServiceProvider
public function boot()
{
Response::macro('table', function (callable $withTableBuilder = null) {
$request = request();

$response = $this;
$tableBuilder = new InertiaTable(request());

if ($withTableBuilder) {
$tableBuilder = new InertiaTable($request);
$withTableBuilder($tableBuilder);
$tableBuilder->applyTo($response);
}

return $response;
return $tableBuilder->applyTo($this);
});
}
}

0 comments on commit 3044826

Please sign in to comment.