Home Laravel 8 Laravel 10 – CRUD Application Tutorial

Laravel 10 – CRUD Application Tutorial

17 min read
0
0
1,957

Laravel is world famous Number one php framework.it has various features.Laravel is a MVC architecture. In this tutorial will see how to make a crud application in Laravel 10.Laravel 10 – CRUD application tutorial with Example. Here is the Best Place to Learn Laravel 10 Articles.

Before get Start Course we need these requirements inorder to install Laravel 10.

  1. php version must be atleast 8.1
  2. composer version must be latest one

Lets do the Crud Step by Step Laravel 10 From Scratch

First Step

create a folder for your laravel project after create folder double click and go inside the folder.on the address bar of
the folder type cmd to get the command prompt.

Install Laravel 10

then type by following command to create the laravel project.

i attached the screen shot window below as you can see.

After Type the Command you have to wait until the project installation  finish.

Database setup

Create the Database on xampp which name is dbschool

After created the database.

Change .env File

Change .env File for username, password and DB Name

After that run check the application the welcome screen of Laravel framework look like this.

 

 

Create Migration

Create the tables

After that you can check the inside  database folder migrations  create_students_table.php

Click and open the Student table.

then create the following fields

$table->string(‘name’);

$table->string(‘address’);

$table->string(‘mobile’);

inside the function up() function i shown in below clearly.

After add the lines type. then type the command to create the tables

then table has been migrated

Create Controller

Create the controller name which is StudentController

Controller

After that Pass All view pages through Controller. you have to add the Model namespace here

use App\Models\Student;   Data is coming from the database via Model.

View 

we using view function so we need to use the use Illuminate\View\View;

Student Controller

Create Model

Model is used to get the data from the database.

Create the Model name which is Student

After Model is Created the look like this. Code inside Model Class (app\Models\)

Change it as like this

Add the Namespace above

namespace App\Models;

Create Views

Create a Folder inside the resources-views

inside the views folder create the students folder and layout folder

In Laravel you have create the pages using pagename.blade.php

Create pages

layout.blade.php

index.blade.php

create.blade.php

edit.blade.php

show.blade.php

Routes

Pages are Manage through routes. If you are crud system simple you can add it the routes one line look like this

You have to add the ControllerNameSpace

use App\Http\Controllers\StudentController;

i have attached the video link below. which will do this tutorials step by step.

 

 

    Load More Related Articles
    Load More By admin
    Load More In Laravel 8

    Leave a Reply

    Your email address will not be published.

    Check Also

    Node js React Mongodb Search Functionality

    In this articles will teach how to search records Node js React Express Mongodb.how the se…