Kritim Yantra
Dec 25, 2025
“Just build a CRUD in Laravel.”
I nodded confidently… then went home and Googled “what is CRUD?” 😄
If you’re new to Laravel, trust me — this confusion is completely normal.
So in this blog, we’ll build a Laravel 12 CRUD step by step, using plain language, real-life explanations, and a simple example you can actually understand in 2026.
No fancy jargon. No magic. Just clarity.
CRUD is just four basic actions:
Think of a notes app:
That’s CRUD. Laravel just helps you do this cleanly and safely.
We’ll build a Posts CRUD, where users can:
Perfect beginner example — and yes, companies still use this pattern in real apps.
composer create-project laravel/laravel laravel12-crud
Then open the project:
cd laravel12-crud
php artisan serve
🎉 Boom! Laravel 12 is running.
Pro Tip 💡
If your app loads in the browser, you’re already winning.
Here’s a little Laravel magic :
php artisan make:model Post -mcr
What this does:
Post → Model (talks to the database)-m → Migration (creates table)-c → Controller (handles logic)-r → Resource controller (CRUD-ready)Laravel just saved you tons of typing.
Open the migration file and keep it simple:
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('content');
$table->timestamps();
});
Then run:
php artisan migrate
📦 Your database table is ready.
Analogy
Migration = blueprint for your database house
Open routes/web.php:
use App\Http\Controllers\PostController;
Route::resource('posts', PostController::class);
This single line creates all CRUD routes:
Yes… one line 😄
Inside PostController.php:
public function store(Request $request)
{
Post::create($request->all());
return redirect()->route('posts.index');
}
public function index()
{
$posts = Post::all();
return view('posts.index', compact('posts'));
}
public function update(Request $request, Post $post)
{
$post->update($request->all());
return redirect()->route('posts.index');
}
public function destroy(Post $post)
{
$post->delete();
return redirect()->route('posts.index');
}
Warning ️
In real apps, always validate user input. We’re keeping it simple for learning.
Create resources/views/posts/create.blade.php:
<form method="POST" action="{{ route('posts.store') }}">
@csrf
<input type="text" name="title" placeholder="Post title">
<textarea name="content" placeholder="Post content"></textarea>
<button type="submit">Save</button>
</form>
That’s it.
You just created data using Laravel 12
Because CRUD teaches you:
Every dashboard, admin panel, CMS, and SaaS app is built on CRUD.
@csrfIf this happens — congrats. You’re learning.
You just learned how to:
Yes! Most real-world apps are CRUD-heavy behind the scenes.
No. Laravel works perfectly without JS for beginners.
No. Understand the flow, not the syntax.
If Laravel CRUD feels confusing at first — that’s normal.
Every confident Laravel developer you admire started exactly here.
Try building this CRUD without copy-pasting, even if it’s messy.
No comments yet. Be the first to comment!
Please log in to post a comment:
Sign in with Google
Kritim Yantra
Kritim Yantra