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 load the custom request file into the…

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 which we make two functions, the first…

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 make a form and we’ve not used…

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 we use below code in our controller:-…

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 which we defined the table name and…

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 the below code for updating data in…

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 (use DB;) in the controller. See the…

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 table. Syntax Suppose, I want to update…

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 in the given table of database. See…

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 SQL commands through the command line. When…

Read More

Multi Auth with Roles and Permissions.

Step:-1 first of all you have to install xampp server use this url for download xampp: https://www.apachefriends.org/index.html Step:-2 Download gitbash and install the gitbash use this url:…

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 commands to rollback tables from the database,…

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 laravel because it interacts with the database…

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 make subviews we use below function. @include(address_of_subviews_file)…

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, we make a function named condition in…

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 Error. See the below image. Suppose, we…

Read More

[SOLVED] 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 Laravel development server and Local Server. See…

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 it a default value through the second…

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 : compact()3. Using with : with([]) 4. Using…

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 link and install:- xampp:- https://www.apachefriends.org/download.htmlGit-bash:- https://gitforwindows.org/ After…

Read More

Sending Email with attachments in Laravel 5.5 using and PHP & JQuery

Introduction: Hello Dear Reader,In this post, I am going to demonstrate detailed steps of how to send email to user’s email id with the files that were…

Read More

How to Use Middleware In Laravel.

step:1– first, you have go this path: C:\xampp\htdocs. then you have right-click on the git base here. same as this pic. Step:2- write any project name like…

Read More

Protection of CSRF in Laravel

What is CSRF? CSRF stands for Cross Site Request Forgery and it’s a web attack that forces a user to make unintended requests to a web application where they are previously…

Read More

Laravel 5.5 php artisan migrate error in Ubuntu: SQLSTATE[HY000] [2002] Connection refused

How I got this error?Ans: I was running php artisan migrate command in /opt/lampp/htdocs/project_dir What was the error? ubuntu@ip-ip_addr:/opt/lampp/htdocs/project_dir$ php artisan migrateIn Connection.php line 664: SQLSTATE[HY000] [2002]…

Read More

How to store and retrieve image from the database in Laravel.

# Creating Migration For Uploading Image We need to add three lines in our migration file which makes column in our Database .After adding, run Migration ….

Read More

Top 10 Laravel Interview Questions And Answers 2020.

1- What is Laravel Framework? Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller…

Read More

How to use multiple authentication in Laravel.

Step:1 Step:2- click on Git base Here. It will look like this Step:3- you have to crate own project and put here Step:4- Press Enter than project…

Read More

Generate URLs to Named Routes in Laravel

Laravel Provides several helpers to assist you in generating URLs for your application. These are mainly helpful when building links in your templates and API responses, or…

Read More

Laravel – Remove Public from URL using htaccess

Step 1: Rename File In first step it is very easy and you need to just rename file name. you have to rename server.php to index.php at…

Read More

Introduction of Some keyword using laravel

Laravel framework provides three primary tools for interaction through command-line namely: Artisan, explains about Artisan in detail. Introduction to Artisan  Artisan is the command-line interface frequently used in…

Read More