Recent Posts

Validate Custom Date Format with Laravel Validator

Hi artisan, I’m going to share with you how to validate a custom date format in Laravel. In this example, you will see the use date validation rules that is provided by Laravel Let’s dive in: date date_format after:date after_or_equal:date before:date before_or_equal:date 1- Date Validation 2- Date Validation ...

How to check request is ajax or not in Laravel

hi guys, I will let you know how to detect if request is ajax or not in Laravel. Sometime you need to check if request is ajax then response data only and if request is not ajax then response complete view in your application. By using ajax() method in Laravel, ...

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 ...

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 https redirect

Force https redirect in Laravel

In this tutorial, i'll show you how to force https in your laravel application. HTTPS helps keep your browsing safe by securely connecting your browser with the websites you visit

Laravel .env variable in Blade and Controller

In this artical, i will show you how to get config variable (env variable) in view file laravel. we can get env variable value in controller and blade file too. we can simple print env file variable by using env() helper.