Laravel Community Tools by Tighten

Category "Requests and Input" tricks

68 tricks
Sometimes we need to validate that several fields that are partial percentages don't sum up over the 100%. It is possible to achieve this with a custom validation rule and then using it on each partial, indicating the other fields as arguments.
alariva 7 years ago 8625
5.6
Sometimes you need to want tables columns as array while you editing the data, this will return a columns as array.
decipher 8 years ago 4408
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 5305
Hello there! How to do Excel file validation in laravel? In Laravel you can use validate the file upload with extension using After Hooks. Read more from https://laravel.com/docs/5.5/validation#after-validation-hook
decipher 8 years ago 13279
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 5369
This helper lets you easily add classes to active navigation elements using {{ chkNav('posts', 'active') }}
alexmayo 8 years ago 3950
Remove tags in controller with excepts fields https://gist.github.com/oLDu67/10863c9f51064d1d9390016b28143f85
racibaz 8 years ago 10912
Check if string is in any url segment or at the one specified.
pabloleone 8 years ago 9592
Protect and Guard the HTTP Query String Parameters
nezarfadle 8 years ago 5220