<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/boost-your-workflow-generate-laravel-12-crud-in-seconds-lpylslbei" -->

---
title: Boost Your Workflow: Generate Laravel 12 CRUD in Seconds
description: Learn how to create a custom Laravel Artisan command that generates complete CRUD boilerplate in seconds. The tutorial shows how to build a command that...
canonical: https://daily.dev/posts/boost-your-workflow-generate-laravel-12-crud-in-seconds-lpylslbei
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Boost Your Workflow: Generate Laravel 12 CRUD in Seconds | daily.dev
og:description: Learn how to create a custom Laravel Artisan command that generates complete CRUD boilerplate in seconds. The tutorial shows how to build a command that...
og:url: https://daily.dev/posts/boost-your-workflow-generate-laravel-12-crud-in-seconds-lpylslbei
og:image: https://api.daily.dev/og/posts/LPyLSlbEI.png
og:image:alt: Boost Your Workflow: Generate Laravel 12 CRUD in Seconds
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Boost Your Workflow: Generate Laravel 12 CRUD in Seconds

**[Tailwind Templates](https://daily.dev/sources/tailwind_templates)** · [@sunnysiddiqui](https://daily.dev/sunnysiddiqui) · 3 min read · 8 upvotes · 4 comments

## Summary

Learn how to create a custom Laravel Artisan command that generates complete CRUD boilerplate in seconds. The tutorial shows how to build a command that automatically creates models, migrations, controllers, form requests, and routes with a single command, eliminating repetitive manual setup tasks and improving development workflow efficiency.

## Content

Okay, let's be honest.

If you've built even one Laravel project, you've definitely done this:
Create model → migration → controller → form request → add routes
…every. single. time.

It's boring, right? And kinda repetitive.

Well, good news - here's a quick Laravel 12 tip to save your time (and sanity):
Let's make an Artisan command that generates all the basic CRUD stuff for you in one go.

What This Command Does
You give it a name like:

```
 php artisan make:crud Product
```

And it'll auto-generate:

- A Model
- A Migration
- A Controller (resource-style)
- A Form Request
- And even add the route for you

No more copy-paste or switching between 5 terminal commands. One and done.

# Step 1: Make the Command

### Run this:
```
 php artisan make:command GenerateCrud
```

# Step 2: Add the Logic

### Open up app/Console/Commands/GenerateCrud.php and drop this in:

```
 <?PHP

 namespace App\Console\Commands;

 use Illuminate\Console\Command;
 use Illuminate\Support\Facades\File;
 use Illuminate\Support\Str;

 class GenerateCrud extends Command
 { 
     protected $signature = 'make:crud {name}';
     protected $description = 'Quickly generate CRUD files';

     public function handle(): void
     {
         $name = Str::studly($this->argument('name'));
         $table = Str::snake(Str::plural($name));
         $controller = "{$name}Controller";
         $request = "{$name}Request";

         // Create model + migration
         $this->call('make:model', ['name' => $name, '--migration' => true]);

         // Controller (resource style)
         $this->call('make:controller', [
             'name' => $controller,
             '--resource' => true,
             '--model' => $name,
         ]);

         // Form request
         $this->call('make:request', ['name' => $request]);

         // Route
         $route = "Route::resource('" . Str::kebab(Str::plural($name)) . "',  \\App\\Http\\Controllers\\$controller::class);";
         File::append(base_path('routes/web.php'), "\n" . $route);

         $this->info("All done! CRUD for {$name} created.");
     }
 }
```

# Step 3: Register It

### In app/Console/Kernel.php, register the command:

```
 protected $commands = [
     \App\Console\Commands\GenerateCrud::class,
 ];
```

# Step 4: Use It!

```
 php artisan make:crud Blog
```

### Done. You've got:

- app/Models/Blog.php
- BlogController.php
- BlogRequest.php
- create_blogs_table migration
- Route in routes/web.php

### Extra Sauce (Optional)

**Want to take it further?**
- Auto-generate Blade views too (index, create, etc.)
- Add API version ( - api)
- Include soft deletes or timestamps

# Final Thoughts

Laravel 12 gives you the tools. But building a dev-friendly workflow? That's on us.

This CRUD generator command is a small thing - but it makes a big impact. It saves time, keeps your structure consistent, and lets you focus on what matters: building features, not boilerplate.
Whether you're a solo dev or part of a team, this trick adds serious value to your Laravel toolbox.

**If you found this helpful, consider:**

- Bookmarking this page for future projects
- Sharing it with your Laravel developer group or team
- Commenting if you want an advanced version (like generating Blade views or API-only resources)

**Thanks for reading, and happy coding!**

**Need Help with Your Laravel Project?**

If you're looking to update your existing Laravel project or develop a new one, our expert team at BrainsOfTech is here to help. Contact us today to bring your Laravel project to life with cutting-edge technology and best practices!

If you're looking to update your existing Laravel project or develop a new one, our expert team at BrainsOfTech is here to help. Contact us today to bring your Laravel project to life with cutting-edge technology and best practices!

## Community discussion

Top comments from developers on daily.dev.

**@faridsilva** · 2 upvotes

> Really nice but I still prefer to use filament for my backends

**@ghost** · 1 upvotes

> i'm gonna integrate it with Workbench

---

Tags: [#automation](https://daily.dev/tags/automation), [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel)

[View this post on daily.dev](https://daily.dev/posts/boost-your-workflow-generate-laravel-12-crud-in-seconds-lpylslbei)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/boost-your-workflow-generate-laravel-12-crud-in-seconds-lpylslbei","headline":"Boost Your Workflow: Generate Laravel 12 CRUD in Seconds","text":"Learn how to create a custom Laravel Artisan command that generates complete CRUD boilerplate in seconds. The tutorial shows how to build a command that automatically creates models, migrations, controllers, form requests, and routes with a single command, eliminating repetitive manual setup tasks and improving development workflow efficiency.","url":"https://daily.dev/posts/boost-your-workflow-generate-laravel-12-crud-in-seconds-lpylslbei","datePublished":"2025-06-30T15:56:44.740Z","dateModified":"2025-06-30T15:57:08.894Z","author":{"@type":"Person","name":"Sunny Siddiqui","url":"https://daily.dev/sunnysiddiqui","image":"https://lh3.googleusercontent.com/a/ACg8ocJYYW54ht0T6kHJvNvsoJcSR3OH41ozhJeW_gYivU7hrl9cUi-B5g=s96-c","description":"I write tech articles that explore software engineering, system design, and emerging technologies","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":100}},"image":"https://media.daily.dev/image/upload/s--uUsLvbb6--/f_auto/v1751299005/posts/LPyLSlbEI?_a=BAMClqZW0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":8},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":4}],"comment":[{"@type":"Comment","text":"Really nice but I still prefer to use filament for my backends","datePublished":"2025-06-30T16:51:37.857Z","url":"https://daily.dev/posts/LPyLSlbEI#c-DPNhp0lt3","author":{"@type":"Person","name":"farid","url":"https://daily.dev/faridsilva","image":"https://avatars.githubusercontent.com/u/23212965?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"i’m gonna integrate it with Workbench","datePublished":"2025-07-03T18:16:40.576Z","url":"https://daily.dev/posts/LPyLSlbEI#c-4H7FRLH3e","author":{"@type":"Person","name":"Deleted user","url":"https://daily.dev/ghost","image":"https://media.daily.dev/image/upload/s--hNIUzLiO--/f_auto/v1705327420/public/ghost_vlftth"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/tailwind_templates","name":"Tailwind Templates"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Tailwind Templates","item":"https://daily.dev/squads/tailwind_templates"},{"@type":"ListItem","position":3,"name":"Boost Your Workflow: Generate Laravel 12 CRUD in Seconds"}]}
```

