This is the second post on a Laravel Report series that I'm starting. For part 1, check out https://blog.deleu.dev/laravel-report-dynamic-page-size/.

The user may choose to sort by Staff Member responsible for tickets or maybe for creation date (oldest to newest).

public function register() { $this->registerPage(); $this->registerSort(); } public function registerPage(): void { $this->app->bind(Page::class, function () { $request = $this->app->make(Request::class); return new Page((int) $request->input('per_page', Page::DEFAULT)); }); } public function registerSort(): void { $this->app->bind(Sort::class, function () { $request = $this->app->make(Request::class); $field = $request->input('sort.field'); $direction = $request->input('sort.direction'); return new Sort($field, $direction); }); }

in_array($this->field, $this->available)) { abort(422, "Sorting on [$this->field] is not possible."); } return true; } public function fallback(string $field, string $direction): self { if (!
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners