Laravel CRUD Tutorial: Build Your First App (Step-by-Step)
A complete beginner's Laravel CRUD tutorial — build a full Create, Read, Update, Delete Todo app using migrations, Eloquent, and Blade.
This tutorial brings together everything from earlier in the series — routing, controllers, migrations, Eloquent, and Blade — to build a complete CRUD (Create, Read, Update, Delete) application: a simple Task Manager. Step 1: Create the Model and Migration php artisan make:model Task -m Edit the migration file in database/migrations/ : public function up(): void { Schema::create('tasks', function (Blueprint $table) { $table->id(); $table->string('title'); $table->text('description')->nullable(); $table->boolean('is_completed')->default(false); $table->timestamps(); }); } Run it: php artisan migrate Step 2: Allow Mass Assignment app/Models/Task.php class Task extends Model { protected $fillable = ['title', 'description', 'is_completed']; } Step 3: Create the Resource Controller php artisan make:controller TaskController --resource Step 4: Register the Route routes/...
Home · Projects · Articles · Developer tools · Contact