Recent Posts

How To Log All SQL Queries In Laravel

Hi guys, in this tutorial tips we will learn how to log all SQL Queries. There are multiple ways to create SQL Query Log and we will see three of them :   1- Default Log file Log in the default log file “laravel.log” located at “storage/logs”. To log SQL ...

Create Custom Maintenance Page in Laravel

Hi guys, , in this tutorial, we are going to create our custom maintenance page in Laravel. I’m testing on Laravel 7.x. Let’s get started: To put website into maintenance mode, we have to run this command: To make application up and running again, run this command: Laravel displays 503 page ...

Laravel Export & Import Excel and CSV File

Hello guys, in this tutorial we will take look how we can easily  import & export and download the excel & CSV file from the database using the maatwebsite/excel package with laravel. Let’s dive in! 1- Install laravel In the first step, we need to get fresh laravel ...

Laravel Model Events Tutorial

Hi Guys, in this tutorial, we’ll learn about model events in Laravel for using them in our application. Laravel Model events allow you to tap into various points in a model’s lifecycle, and can even prevent a save or delete from happening. The Laravel model events documentation outlines how ...

30 Laravel Eloquent Tips & Tricks

Hi, today I’m going to share with you some tips and tricks in Laravel Eloquent ORM. There are a lot of semi-hidden functions and less-known ways to achieve more with it. Let’s dive in:   1- The Exists Property The exists property is used to show whether the ...

Laravel Timestamps tricks

Hi guys, today I’m going to share with you some timestamp tricks in Laravel. Let’s dive in: 1- Disable Timestamps If your DB table doesn’t contain timestamp fields created_at and updated_at, you can specify that Eloquent model wouldn’t use them, with $timestamps = false property.   2- Change Timestamp Column ...

Laravel Localized Routes 🌍

Hi, in this post, we will learn how to set up and use localized routes in a Laravel app. For this tutorial we will use this package codezero-be/laravel-localized-routes. 📦 Install let’s install the package Next, we have to publish configuration file now in the config folder you will find ...

Laravel Multiple Timezones 🕔 🕚 🕒

In this tutorial, i'll show you how to add multiple timezones functionality into your laravel application. Dates must be presented to a guest or user in his local timezone so it's better to store those in UTC timezone (default in laravel).