Vue.js 3 + Laravel 10 + Vite: SPA CRUD

In this lesson, let's show a column from the relationship in the posts table. We will add a category for every post.

finished category relation

First, we need to create a Category model and migration.

php artisan make:model Category -m


public function up(): void
Schema::create('categories', function (Blueprint $table) {


class Category extends Model
protected $fillable = [

Next, we need to create a migration...

This lesson is only for Premium Members.
Want to access all lessons of this course?

You also get:

  • 40 courses (785 lessons, 44 h 48 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord (Yearly members)