Member-only story
How To Upload An Image To Public Folder In Laravel
2 min readApr 24, 2021
In this tutorial, we will learn how to upload an image to public folder in Laravel. Usually, there are two ways to upload a file in Laravel.
- Upload into the public folder of Laravel is very easy.
- Upload files into Laravel Storage that is also very easy.
Also read, How to create laravel project from scratch step by step
Required Steps to upload an image in Laravel
- Create routes in the web.php file inside the routes folder of the Laravel Application as given below
Route::get('/uploadfile','UploadController@index');
Route::post('/uploadfile','UploadController@store');
- Create a controller using the artisan command in the command terminal as shown below
php artisan make:controller UploadController
UploadController.php
- Create a blade file to upload the file inside the resources/views folder of the Laravel Application to…