Laravel Community Tools by Tighten

Category "Routing" tricks

91 tricks
As I will cover this Post with live Working example to develop laravel 5.8 get validation errors ajax, so the this.validate is not a function react native is used for this example is following below. https://www.pakainfo.com/validate-is-not-a-function-in-laravel/
pakainfo-c... 5 years ago 5551
There are the Following The simple About laravel edit route not working Full Information With Example and source code.
pakainfo-c... 5 years ago 6118
Standard API Response in PHP / Laravel
saeedvir 6 years ago 6988
A few days ago I released a new package called obiefyapi-response, It is simple api response wrapper for laravel, you can give it try from GitHub URL: https://github.com/obiefy/api-response
obiefy 6 years ago 10773
api
One file for all routes is bad idea. For simplify this, look this snippets.
sr2ds 7 years ago 7551
4.2
This a simple way to use wilcard routing, for specific options.
neftaliyag... 7 years ago 3585
Sometimes you want to refer your custom middleware not by the full qualified namespace class, but only by an alias (E.g. like the ones that Laravel have created in the Middleware Kernel).
laraning 8 years ago 7264
First you create a file called Cors.php in app/Http/Middleware, then you register the middleware in the app/Http/Kernel.php file. If you want, you can change the default values adding the keys CORS_ALLOW_METHODS, CORS_ALLOW_ORIGINS, CORS_ALLOW_HEADERS and CORS_MAX_AGE to your .env file. Simple as that! This class is based on spatie/laravel-cors package.
lcdss 8 years ago 5337
How to disable any ip from accessing your laravel app? Here is the solution. 1) Create Middleware "IPRestrictMiddleware". 2) Paste the code inside handle function. 3) Register the middleware in kernel function. 4) add the registered middleware in routes in order to restrict the access.
decipher 8 years ago 5383