Laravel Community Tools by Tighten

Category "Routing" tricks

92 tricks
1. create two route files routes.web.php and routes.api.php. 2. edit the RouteServiceProvider.php file to look like the code below: (Note: you can add as many routes as you want, just follow the same logic.)
Mahmoudz 10 years ago 43036
5.0
with this code you can test all get page without params (index,create,etc...)
d3v2a 10 years ago 15057
You can see SQL Query of your DB table on Laravel App, by Event listener.
ahaneef29 10 years ago 8482
I'm having a porblem trying to solve this error.. anyone encountered this beforre?
dnates2014 10 years ago 7423
symply dont register unessecary route you dont have to use facade, $router instance is set by the function in route provider with config cached and files compiled i get app booted in ~30ms vs ~50 on my dev server
d3v2a 10 years ago 9084
5.0
Session time out for logged in user (middleware way) for prevent dashboard or ... access after specify time. if we use this middleware in route groups, it will be run on every request under route group. with this code we do not need to change php.ini file or laravel session config file and default settings are appropriate. Do not forget to register middleware in app\Http\Kernel : 'timeout' => 'App\Http\Middleware\SessionTimeout', Other notices: 1- we can use middleware paramaters in laravel 5.1 for custom conditions. 2- we must redirect user back (after session timeout and log out ), to prevent user navigate to come back. 3- we must show a message to user (after session timeout and log out), that you logged out after [20] minutes that you were not active. Our Persian web app for time management is: https://timenix.com If you have a better idea please comment it. ♥
ivahidmont... 11 years ago 88358
Helper function to mass-map routes to methods. I use this setup in development to quickly map all "test/*" routes to a Test controller, to test out arbitrary PHP code. Updated version also supports DI in controller methods. Updated to correctly fill optional arguments.
davestewar... 11 years ago 12844
5.0
example of how to test API with Codeception and Laravel
Mahmoudz 11 years ago 10843
5.0
Playing with Laravel Lumen: simple RESTful trait.
beanmoss 11 years ago 8359