Member-only story

Laravel CRUD | Laravel 12 Beginner-Friendly CRUD Application Tutorial

Raviya Technical
7 min read15 hours ago

Step 1: Install Laravel 12 & Follow this Link

Step 3: Create a Model with Migration, Factory, and Seeder

php artisan make:model Content -mfs

Creating File like below


INFO Model [...\l12\app\Models\Content.php] created successfully.
INFO Factory [...\l12\database\factories\ContentFactory.php] created successfully.
INFO Migration [...\l12\database\migrations/2025_02_27_075121_create_contents_table.php] created successfully.
INFO Seeder [...\l12\database\seeders\ContentSeeder.php] created successfully.

Modifications in Content Migrations

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('contents', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('slug')->unique();
$table->text('content');
$table->enum('status', ['draft', 'published', 'archived'])->default('draft')…

--

--

No responses yet