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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners