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:-…
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…
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…
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…
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:…
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,…
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…
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)…
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…
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…
[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…
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…
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…
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…
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”,……..); For Example $name = array(“Sushant”,”Rahul”,”Sameer”,”sujeet”); Note:- By…
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 accessing several data items with only one…
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. Syntax for (initialization; test-condition; increment/decrement) { block…
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 while loop started, it checks the condition,…
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 the third condition, if it’s true then…
Logical, Increment, decrement, and String Operators in PHP.
Logical Operators 1. Logical AND(&&/and). There are two Logical AND Operators, First && and 2nd and where First Operator has higher precedence(means higher priority) than 2nd. It…
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…
Difference between Single Equal, Double Equal, Triple Equal, Not Equal, and Not Identical in PHP?
Single Equal It is Known as Assignment Operator means it assigns a constant value in a variable. For Example : A Constant Value (10) is assigned to…
What are If, Nested if, if else and, Nested if else Statement in PHP?
If Statement and Nested if Statement If statement is used to execute when a statement or a block of statement only if the condition is fulfilled or true….
How to declare Inheritance in PHP with example?
What is Inheritance?:- Inheritance means one class method or properties access to another class. The child class will inherit all public, private, protected methods or properties from…
Difference between Public, Private & Protected Access Modifier in PHP with example
Public Access Modifier:- Public Method or variable can be accessed from anywhere in the class. It means from inside or outside the class and child class also…
What are Comments, Constant Variable, String Interpolation, Arithmetic and Assignment Operators in PHP?
Comments in PHP Comments are those human-readable texts that we should add to make our code more understandable for other programmes. It is ignored by PHP and…
CSS Tutorial for beginners (Step by Step) with Examples(Part3).
i. Universal Style Class It is a type of style class which is used by any element of the HTML document. Universal Style Class Starts with a…
CSS Tutorial for beginners (Step by Step) with Examples(Part2).
What is Internal Style Sheet? An internal style sheet is a set of style that is created as a part of an HTML document. An internal style…
Insert and Retrieve data from database in PHP using MySQLI
What is Mysqli:-The Mysqli extension, or as it is used before this name the MYSQL and update extension, was developed to take advantage of new features found…
CSS Tutorial for beginners (Step by Step) with Examples(Part1).
Introduction to CSS? CSS stands for Cascading Style Sheet. It is a style sheet language which is used to describe the presentation of a document. We can…
