Vue.js 3 + Laravel 11 + 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:

  • 59 courses (1057 lessons, 42 h 44 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord