Laravel 6 Image File Upload

Upload Images in Laravel 6,Laravel 6 Images File Upload, Upload Images and Files with Validation in Laravel 6

Hello friends, today I will tell you through this tutorial how do you upload image files through Laravel 6. So we will learn step by step in Laravel 6.

Step 1: Create Route in Laravel 6
Step 2: Create Controller in Laravel 6
Step 3: Create Blade Files in Laravel 6

Step 1: Create Route in Laravel 6.0

Friends, this is the first step, in this step you have to give the url route path in the blade file in the routes file, as an example you are given below.

Route::get('image', function () {
return view('image');
Route::post('fileupload', 'imageController@fileupload');

Step 2: Create Controller in Laravel 6.0

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use DB;
use Validator;
use Redirect;
use View;
class imageController extends Controller
public function fileupload(Request $request)
'file' => $name
return redirect()->back()->with('message', 'Successfully Save Your Image file.');

Step 3: Create Blade Files in Laravel 6


<!DOCTYPE html><html><head><title>Laravel 6.0 Image File Upload</title><link rel="stylesheet" href=""></head><body><form action="{{url('fileupload')}}" enctype="multipart/form-data" method="post"><input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"><div class="col-md-12"><div class="form-group"><label for="">File Select</label><input required type="file" class="form-control" name="file"></div></div><div class="col-md-6"><div class="box-footer"><button type="submit" class="btn btn-primary">Save</button></div></div></form></body></html>