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

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