How to get data from the database in descending order in laravel.

Through Model To get data from the database in descending order(by default it returns in ascending order) or the latest…

Read more »

Laravel Error: Integrity constraint violation: 1062 Duplicate entry

This Error is found when we insert duplicate data which already exist in the database. To overcome from it just…

Read more »

Laravel Error: ‘The page has expired due to inactivity. Please refresh and try again.’

If you’re getting( ‘The page has expired due to inactivity. Please refresh and try again.’) error in your laravel project…

Read more »

Request Validation using Custom Validator in Laravel.

To use the custom validator, first, we have to load it in our controller by writing use Validator. After that,…

Read more »

Request Validation using Form Request in Laravel.

First of all, we have to make a request class by below command php artisan make:request Now, we have to…

Read more »

Insert Data in Database using Html Form in laravel.

First, we create a simple HTML form to Fill data. See the below code:- Now, we make a controller in…

Read more »

Request Validation using ValidatesRequest Trait in Laravel.

Q1. What is Validation? Validation is used to protect or validate the request we’re getting from the user. Suppose we…

Read more »

Read, Update, and Delete data through Model.

Read Data from Database through Model First, we have to connect our model and database in our controller. For that…

Read more »

Inserting data in Database through Model.

There are many methods for inserting data in database through Model. See below:- Migration is common in all methods in…

Read more »

How to Update and Delete data from database using Controller.

Update data from the database To Update the data in database table we use update(). See the syntax below:- See…

Read more »

How to Insert and Read data from database using Controller.

First, make a Controller and View. To use the database query in the controller, we have to use database class…

Read more »

How to Update and Delete Data From Database table using Tinker.

How to Update Data in the Database table. We use the update command to update the data in the database…

Read more »

How to Read Data from Database in Tinker.

To read data from the database, we use the below commands:- 1. DB::table(“Table_name“)->get() :- It returns all the data present…

Read more »

Tinker Command and How to Insert Data in Database using Tinker in Laravel.

Tinker Command(php artisan tinker) is used to interact directly with the database table to insert, delete, update data. It executes…

Read more »

Rolling Back migration in Laravel.

Rollback command is used to rollback the last migration means remove the last migration from the database. Laravel provides different…

Read more »

Migration in Laravel.

Migrations are like version control for our database. Means we don’t have to worry about versions of the database and…

Read more »

How to Download Full Youtube Playlist in 1 Click.

I’ve tried over 20-30 applications and many websites also to download full youtube playlist with serial no. but none of…

Read more »

How to include sub-views in Laravel.

First of all, we make a new directory in the view folder in which our subviews files are stored. To…

Read more »

Conditional (@if, @else, @elseif, @isset, @empty, and @unless) Statements in Laravel.

First of all, we make a condition.blade.php file in which we define our conditions. See the below image. After that,…

Read more »

How to check variable is declared or not in Laravel to avoid an Error.

Suppose we have not declared a variable in the controller and calling it in views, then it shows undefined variable…

Read more »

Error: Access CSS/js file in Local and Laravel-development Server both.

In Laravel, our all assets are in the public directory, But it gives error while we run Same code in…

Read more »

Master/fixed layout in Laravel.

@yield(“Parameter”) :- It is a section which requires to be filled in by your view which extends the layout. You could pass…

Read more »

How to pass data to views in Laravel.

There are 4 ways to send data to view:- 1. Using an array function : array()2. Using compact function :…

Read more »

How to Install and create a project in Laravel for Windows User!

Before installing Laravel Composer, ensure that you have installed Xampp Server and Git-Bash. If not installed then go to this…

Read more »

Numeric Array, Array Function, and Double Array Operator in PHP.

Numeric Array Sample Program Output:- Rahul Array Function Array() function is used to create an array. Syntax $array_name = array(“value1″,”value2″,”value3”,……..);…

Read more »

Array and Its Type in PHP.

An array is a collection of data items stored under a single name. Array provides a mechanism for declaring and…

Read more »

For Loop and Nested For Loop in PHP.

For Loop The for loop is frequently used, when a loop is to run for a fixed number of time….

Read more »

While, Nested While, Do While, and Nested Do While Loop in PHP.

While Loop The While loop keeps repeating an action until an association condition returns False. It means that when a…

Read more »

Else-If Statement, Ternary or Conditional Operator and Switch Statement in PHP

Else-If Statement Syntax Sample Program Output In the above program, if the First condition is false then it will check…

Read more »