Creating Laravel form requests
Creating and using Laravel form requests to create cleaner code, separation and reusability for your requests. This is achieved by making use of the artisan command make:request php artisan make:request…
Creating and using Laravel form requests to create cleaner code, separation and reusability for your requests. This is achieved by making use of the artisan command make:request php artisan make:request…
Improving the default Laravel login and register views in such a simple manner but making a noticeable change in appearance. The default Laravel login view Now let’s update the look…
Laravel validation for checking if a field value exists in the database. The validation rule to use is exists() where you can state the table and column for the value…
Servyrun allows you to connect your servers and run simple SSH & SFTP commands, view server usage, do pings between your servers, download, upload & edit files, view database tables…
Laravel log all database queries with their bindings and execution time in seconds This is done by using the boot method in app/Providers/AppServiceProvider.php public function boot() { DB::listen(function ($query) {…
How to build a conditional based query in Laravel that gets shaped based on conditional statements before finally being executed. In this example below checks are made on if the…
How to split Laravel routes into directories or subfolders for more organisation and to keep the route files smaller. In this example the Article API routes are placed into their…
In Laravel the isDirty method can be used to examine the state of your model and its data to determine if changes have been made and need updating. isDirty will…
To return back to the previous route in Laravel simply just use the back() method: return back(); back() will create a new redirect response. You can of course return back…
A quick method in Laravel to provide custom validation error messages. This generally isn’t needed however if you want to provide more context to the validation fails you can utilize…