MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

How to Upload files or Documents in Mysql Database Using laravel.

Step: 1- First of all you have to go:-

Windows Explorer address bar showing the C:\xampp\htdocs folder path

Step:2- then right-click in this Drive and got to Git Bas Here and click.

Right-click menu in the xampp htdocs folder with Git Bash Here selected

Step:3-run the composer

Git Bash window opened in /c/xampp/htdocs over the htdocs folder

step: 4- write the project name. then press Enter. it will take time for this run this project

Git Bash running composer create-project laravel/laravel uploadFiles in htdocs

Step:5- The next step go to inside the project folder and click the Git base Here and write php artisan serve . and Enter

Git Bash in the uploadFiles project folder with php artisan serve typed

And copy the url like that: http://127.0.0.1:8000/ run this url in the web browser.

Step:6- see the pic

Php artisan serve output: Laravel development server started at http://127.0.0.1:8000

Step:7- now we need to create a File model.

Step:8- migrations using the following command.

Command php artisan migrate to run the database migrations

Step:9– Create the file table.

Step:9-  File.php, write the following code.

Step:10- Now, define the Relationship inside the User.php model.

Step:11- php artisan make:controller FileController. run this command in composer.

Step:12- Create a View and Route for uploading files.

Step:13- home.blade.php create this page

VS Code explorer with home.blade.php selected in resources/views

Step:14- you need to define the Post route inside routes >> web.php file.

you can see the page view.

Laravel File Upload form with Title, Overview and Price fields and an Upload button

Step:15- Storing the form data.

Also, we need to update our view to see the flash message.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
sam
MotoShare.in is your go-to platform for adventure and exploration. Rent premium bikes for epic journeys or simple scooters for your daily errands—all with the MotoShare.in advantage of affordability and ease.

Related Posts

How to Create REST API in Laravel.

API is also known as Web services. Web services is very important when you are creating web and Mobile app. You require API in mobile application development. If you…

Read More

How to Create a Simple Login Authentication System in LARAVEL?Part-1

How to Create a Simple Login Authentication System in LARAVEL? Firstly, we’ll create a new project for this. Step 1. Go to XAMPP/htdocs folder -> right Click->Open Git…

Read More

Top 10 Laravel Interview Questions And Answers 2020.

1- What is Laravel Framework? Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller…

Read More

How to use multiple authentication in Laravel.

Step:1 Step:2- click on Git base Here. It will look like this Step:3- you have to crate own project and put here Step:4- Press Enter than project…

Read More

Todo Application in Laravel

1.Create Project in Laravel Composer create-project laravel/laravel todolist 2.Create CRUD Controller php artisan make:controller TodosController –resource 3.Route setup of CRUD Controller routes/web.php 4.Create Database todolist localhost/phpmyadmin create…

Read More

Laravel: What is APP_KEY in Laravel?

Let’s break down both what APP_KEY is in a Laravel .env file, why it matters, and its use cases. I’ll also explain how it’s generated and what…

Read More