Category : Laravel

multiple route files instead of one file

In this snippet I will teach you how to create multiple route files instead of one file

access validation flashed errors with ajax using XHR

In this snippet I will teach you how to get all validation flashed errors from form request validation using your custom request and receive it from ajax errors

Install laravel with specific version

In this snippet I will provide a code snippet to help you install specific version of laravel based on what you need

Get results with 2 relationships Laravel

In this snippet I will teach you how to get results with query with 2 relationships in laravel

Laravel Validation unique rule with condition

In this snippet I will teach you how to create unique validation related to another column

add Or Inject values to a request array or object

In some cases you might want to inject extra values to the request object that already is holding a form data for example, to do so there are numerous ways, here are some:

Auto logout after certain amount of inactivity

If you wish you application to auto logout after a certain amount of time the user is inactive on it, here is a sample code that will work in laravel.

Laravel pagination on array

In case you have an array and would like to create pagination over it here is a user sample code.

laravel validation date after or equal today

In this snippet I will teach you how to validate the date to be equal or after today with localization

Display record number in laravel blade with pagination

In this snippet I will teach you the right way of displaying record number in lavael blade with pagination