<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sunny Siddiqui</title>
    <description>The latest articles on DEV Community by Sunny Siddiqui (@sunny_siddiqui_d31888a6eb).</description>
    <link>https://dev.to/sunny_siddiqui_d31888a6eb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3312791%2F4857e0b5-02d9-4f93-a495-8958b0e6fd72.jpg</url>
      <title>DEV Community: Sunny Siddiqui</title>
      <link>https://dev.to/sunny_siddiqui_d31888a6eb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sunny_siddiqui_d31888a6eb"/>
    <language>en</language>
    <item>
      <title>Boost Your Workflow: Generate Laravel 12 CRUD in Seconds</title>
      <dc:creator>Sunny Siddiqui</dc:creator>
      <pubDate>Tue, 01 Jul 2025 12:20:38 +0000</pubDate>
      <link>https://dev.to/sunny_siddiqui_d31888a6eb/boost-your-workflow-generate-laravel-12-crud-in-seconds-a8f</link>
      <guid>https://dev.to/sunny_siddiqui_d31888a6eb/boost-your-workflow-generate-laravel-12-crud-in-seconds-a8f</guid>
      <description>&lt;p&gt;Okay, let's be honest.&lt;/p&gt;

&lt;p&gt;If you've built even one Laravel project, you've done this:&lt;br&gt;
Create model → migration → controller → form request → add routes&lt;br&gt;
…every. single. time.&lt;/p&gt;

&lt;p&gt;It's boring, right? And kinda repetitive.&lt;br&gt;
Well, good news - here's a quick Laravel 12 tip to save your time (and sanity):&lt;/p&gt;

&lt;p&gt;Let's make an Artisan command that generates all the basic CRUD stuff for you in one go.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What This Command Does&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  You give it a name like:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:crud Product
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;And it'll auto-generate:&lt;/strong&gt;&lt;br&gt;
• A Model&lt;br&gt;
• A Migration&lt;br&gt;
• A Controller (resource-style)&lt;br&gt;
• A Form Request&lt;br&gt;
• And even add the route for you&lt;/p&gt;

&lt;p&gt;No more copy-paste or switching between 5 terminal commands. One and done.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Make the Command&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Run this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:command GenerateCrud
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 2: Add the Logic&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Open up app/Console/Commands/GenerateCrud.php and drop this in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?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-&amp;gt;argument('name'));
        $table = Str::snake(Str::plural($name));
        $controller = "{$name}Controller";
        $request = "{$name}Request";

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

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

        // Form request
        $this-&amp;gt;call('make:request', ['name' =&amp;gt; $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-&amp;gt;info("All done! CRUD for {$name} created.");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3: Register It&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;In app/Console/Kernel.php, register the command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;protected $commands = [
    \App\Console\Commands\GenerateCrud::class,
];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4: Use It!&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:crud Blog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Done. You've got:&lt;/strong&gt;&lt;br&gt;
• app/Models/Blog.php&lt;br&gt;
• BlogController.php&lt;br&gt;
• BlogRequest.php&lt;br&gt;
• create_blogs_table migration&lt;br&gt;
• Route in routes/web.php&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Extra Sauce (Optional)&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Want to take it further?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;• Auto-generate Blade views too (index, create, etc.)&lt;br&gt;
• Add API version ( - api)&lt;br&gt;
• Include soft deletes or timestamps&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Final Thoughts&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Laravel 12 gives you the tools. But building a dev-friendly workflow? That's on us.&lt;/p&gt;

&lt;p&gt;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.&lt;br&gt;
Whether you're a solo dev or part of a team, this trick adds serious value to your Laravel toolbox.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;If you found this helpful, consider:&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;Thanks for reading, and happy coding!&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Need Help with Your Laravel Project?&lt;/strong&gt;&lt;br&gt;
If you're looking to update your existing Laravel project or develop a new one, our expert team at &lt;a href="https://brainsoftech.com/" rel="noopener noreferrer"&gt;BrainsOfTech&lt;/a&gt; is here to help. Contact us today to bring your Laravel project to life with cutting-edge technology and best practices!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>laravel</category>
      <category>php</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
