Home Laravel 9 Laravel 9 Image Upload and Display

Laravel 9 Image Upload and Display

10 min read
0
0
4,426

Laravel is world famous php framework.it has various features.Laravel is a MVC architecture. In this tutorial will see how to make a Image Uploading and Display the image in Laravel 9. Here is the Best Place to Learn Laravel 9.

Install Laravel 9

Create  a new Project type  the command on the command prompt  . I create the project name payroll
Laravel 9 Tutorial  Setup the Project

After Type the Command you have to wait till the project has been created.

Database setup

Create the Database on xampp which name is dboffice

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

Click and open it.

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

After add the lines type

Create Controller

Create the controller name which is EmployeeController 

Create Model

Model is used to get the data from the database.

Create the Model name which is Employee

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

Create Views

Create a Folder inside the resources-views

inside the views folder create the Employee folder

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

Create page layout.blade.php

Create page create.blade.php

Create page index.blade.php

Controller

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

use App\Models\Employee; 

Data is coming from the database via Model.

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

Link Storage folder to public dir

 

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

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…