Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

How to Insert and Retrieve Data in Database – Laravel Framework

In this example, I am going to show you how to insert data in the database using laravel framework PHP.

First, creating table the SQL query:

CREATE TABLE student_details
(
id int NOT NULL AUTO_INCREMENT,
first_name varchar(50),
last_name varchar(50),
city_name varchar(50),
email varchar(50),
PRIMARY KEY (id)
);

Now, create three file for insert data in Laravel.

Step 1. Create a controller name as StudInsertController.php.
The file location is : (app/Http/Controllers/StudInsertController.php)

Step 2. Create view page name as stud_create.php
The file location is: (resources/views/stud_create.php)

Then put this code in your StudInsertController.php.

Then put this code in your stud_create.blade.php.

Step 3. Then go to routes as web.php and put this code.
The file location is : (routes/web.php)

Route::get('insert','StudInsertController@insertform');
Route::post('create','StudInsertController@insert');

Then, you can see the data is inserted.

So, the data is inserted in the database, then we need to retrieve a record or data from the MySQL database.

Step 4. Create a controller for view name as StudViewController.php.
The file location is : (app/Http/Controllers/StudViewController.php)

Step 5. Create a view page name as stud_view.blade.php.
The file location is : (resources/views/stud_view.blade.php).

Then put this code StudViewController.php.

Then, retrieve the students data then put this code stud_view.blade.php.

Step 6. Then go to routes as web.php and put this code.
The file location is (routes/web.php)

Route::get('view-records','StudViewController@index');

Then, you can see the view page.