![]() ![]() Now, we need to create one model and migration file to store the image. env file, and we are using MySQL database. Step 4: Create Laravel API for the endpoint.Īfter that, configure the database in the. Now, after uploading the image, we can see that the image upload is failed due to the wrong POST request endpoint. Now, start the development server using the following command. Import FileUpload from './components/FileUpload.vue' But let me import this file into App.vue component and see what happens. It is the point where we will hit the POST route and store our image, but it is my blog’s homepage, so it is not gonna work anyway. Now, create one more file called FileUpload.vue.Īdd the following code to FileUpload.vue file. In our primary boilerplate, we have one ready-made component called HelloWorld.vue inside src > components folder. Now, it should include in our application. Import this css file inside src > App.vue file. If in case import css is not working for you, then you need to install that CSS file manually.Ĭopy this vue2Dropzone.css file’s content.Ĭreate one file inside src > assets folder and create one css file called vuedropzone.css and paste the content there. Import 'vue2-dropzone/dist/vue2Dropzone.css' Now, vue cli uses css loader, so we can directly import in the src > main.js entry file. Okay, now we need to add one css file which comes with the above package. Open the project in your favorite editor.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |