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 8. Here is the Best Place to Learn Laravel 8.
Install Laravel 8
Create a new Project type the command on the command prompt . I create the project name payroll
Laravel 8 Tutorial Setup the Project
1 | composer create-project --prefer-dist laravel/laravel payroll |
After Type the Command you have to wait till the project has been created.
Database setup
Create the Database on xampp which name is dbpayroll
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.
1 | php artisan serve |



Create Migration
Create the tables
1 | php artisan make:migration create_employees_table |
Click and open it.
inside the function up() function i shown in below clearly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | public function up() { Schema::create('employees', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('address'); $table->string('mobile'); $table->string('photo', 300); $table->timestamps(); }); } public function down() { Schema::dropIfExists('employees'); } |
1 | php artisan migrate |
Create Controller
Create the controller name which is EmployeeController
1 | php artisan make:controller EmployeeController --resource |
Create Model
Model is used to get the data from the database.
Create the Model name which is Employee
1 | php artisan make:model Employee |
After Model is Created the look like this. Code inside Model Class (app\Models\)