در حال بارگذاری ...

Demoing the Final App0:00

In this series, I'm going to show you how to upload and store images using Vue and Laravel. And this is what it'll look like when we're done. We can drag and drop images to this element here. And they'll be uploaded to our Laravel application and displayed in the gallery down here. We can upload one image at a time. Or multiple. And they're each individually saved and displayed in our gallery. This is also gated to only upload image types. So if we try to upload a file that's not an image, like this example PDF,

Creating Laravel Project0:43

So if we try to upload a file that's not an image, like this example PDF, it errors out, the file is of an invalid type. We can also refresh the application. And the images that were previously saved in our gallery display here below. Alright, so let's get started. First, we'll need a Laravel installation to form the basis of this app. So in my code directory here, I'm going to use the command line helper tool. So just laravel new.

Opening Project and Cleanup1:09

So in my code directory here, I'm going to use the command line helper tool. So just laravel new. And I'm going to call it imageUploader. And once this has finished installing, let's head to our browser. And we can see our new Laravel installation at this domain that I've set up locally for this project, imageUploader.test. So now let's cd into this. And open up the source code. By default Laravel comes with a User model, but we're not going to be using that in this application. So we can go ahead and delete the migration for it.

Removing Default User Scaffolding1:43

By default Laravel comes with a User model, but we're not going to be using that in this application. So we can go ahead and delete the migration for it. As well as the password_resets table. And the User model. And then opening up the routes/web.php file. Let's get rid of all the comments here as well. Alright, in our next video, we'll start setting up our database and routes to store and display some images.

Our image uploader demoSetting up a new Laravel project

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟