This article aims to teach how to display flash messages indicating success or error in Laravel 10. Flash messages come in handy when notifying users of recent activities such as form submissions or website actions. In such cases, multiple types…

How to assign or declare variable in laravel blade template ?
Laravel blade is a powerful templating engine that gives you a lot of control over your HTML. One thing you can do with blade is declare variables. This can be useful if you want to reuse a piece of data…

How to Get Current Url in Blade File Laravel ?
Sometimes in our application we want to Get Current Url in Blade file Laravel because we want to add specific conditions to show the data on behalf of current url. It can be complete url, route name and query params…

Collection Count and Check Empty Eloquent Collection in Laravel
In this article we will learn collection count and detect or check empty eloquent collection in laravel. Laravel collection is used to simplify the operations of array. Illuminate\Support\Collection library is used to handle the collection and arrays in laravel. Laravel…

How to get random rows in laravel example ?
In this blog post, we’ll take a look at how to get random rows in Laravel database. We’ll explore the use of the QueryBuilder, Eloquent, and the DB facade. laravel has inbuilt eloquent method to get the random records from…

Laravel whereHas in eloquent Model Example
In this blog post, we’ll take a look at Laravel whereHas in eloquent Model Example and advantages. whereHas method is an important part of the Eloquent ORM. It allows you to add a constraint to a relationship query. whereHas method…

How to get timezone select list in Laravel ?
Hello Developers, In this article i will show you get timezone select list in Laravel. In a timezone based application we need to store the timezone of each client or user so we can show the correct time to them…

How to set timezone dynamically and globally in Laravel ?
Laravel stores timezone configurations in config/app.php file and we can easily set timezone dynamically and globally in Laravel. Laravel usage carbon library to get the current date time and format, carbon also respects the timezone defined in config/app.php file. After…

How to Change Date Format in Blade View File in Laravel ?
Laravel default shows the date in the way its stored in database bu sometimes we want to change date format in blade view file in laravel according to our requirements. It can be multiple possibilities and requirement from client or…

How to Get Last Record With Group By in Laravel Eloquent ?
In this tutorial we will learn to get last record with group by in laravel eloquent. while working with group by in mysql its gives first record from the group by records that means if you have multiple record with…