From the course: Building Laravel and Vue.js 2 Web Apps

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Working with related models

Working with related models

From the course: Building Laravel and Vue.js 2 Web Apps

Start my 1-month free trial

Working with related models

- Before we work on the list component, for listing menu items by category, we'll see the database with menu items. Using a seeder file, that you can find in the exercise files for this video. In windows, drag and drop into VS code may not work when you're running as administrator. So, I'm just going to add this exercise files folder to the workspace. So, three eight, begin. And now I'm just going to copy and paste menu items table seeder, into the database seeds folder. Let's take a look at this file. If you're going to try running this yourself, you want to make sure you have all four categories in the database and that the names match exactly. So it could look up the IDs and then insert items with those IDs. Now, because we haven't created this seeder with artisan we need to run composer dump autoload. So that, this menu items table seeder class can be autoloaded. When that's done, we can run artisan db seed with the class option. Don't run artisan db seed without that because…

Contents