Category: Laravel, PHP, api

This approach allows me to easily navigate between actions and not to have fat controllers. In addition to this controllers can be tested easier than with many actions, because the tests’ structure can repeat the controllers’ structure. Every action has a unique route name and this name is a single source for URL generations for a specific route.

As you can see this test case has only one required method getRouteName, that should return the name of route for the specific testable controller.

callAuthorizedByUserRouteAction(User $user, array $data = [], array $parameters = [], array $headers = [], array $scopes = []): TestResponseMake an authorized request from given user.
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