Join our FREE personalized newsletter for news, trends, and insights that matter to everyone in America

Newsletter
New

Stop Writing The Same Laravel Boilerplate: Generate A Complete Module With One Artisan Command

Card image cap

Stop Writing the Same Laravel Boilerplate: Generate a Complete Module with One Artisan Command

Every Laravel developer has experienced this.

You start implementing a new feature and immediately create the same files you've created dozens of times before:

  • Model
  • Migration
  • Repository
  • Service
  • Form Request
  • API Resource
  • Policy
  • Filter
  • Status Enum
  • Feature Tests
  • Unit Tests
  • Swagger/OpenAPI annotations

The process is repetitive, time-consuming, and easy to get wrong.

The Problem

While Laravel provides excellent generators, building a production-ready API module still requires running many Artisan commands and wiring everything together manually.

For large projects following Repository and Service Layer architectures, this becomes even more repetitive.

The Solution

I built Laravel Base, an open-source package that generates an entire production-ready module from a single command.

php artisan make:module Product  

The generated module includes:

  • ✅ Model
  • ✅ Migration
  • ✅ Repository Pattern
  • ✅ Service Layer
  • ✅ Form Requests
  • ✅ API Resources
  • ✅ Filters & Pagination
  • ✅ Policies
  • ✅ Status Enums
  • ✅ Swagger/OpenAPI annotations
  • ✅ Feature Tests
  • ✅ Unit Tests

Modern Development Experience

The package is actively maintained and includes:

  • Laravel 10–13 support
  • PHP 8.1–8.4 compatibility
  • GitHub Actions CI
  • PHPStan static analysis
  • Laravel Pint code style
  • Automated releases
  • Repository automation

Why I Built It

After working on multiple Laravel projects, I noticed I was spending too much time generating the same project structure instead of focusing on business logic.

I wanted a tool that lets developers start implementing features immediately rather than setting up folders and classes.

Feedback Welcome

Laravel Base is open source, and I'd love to hear your thoughts.

GitHub Repository:
https://github.com/MuhammedMSalama/LaravelBase

Packagist:
https://packagist.org/packages/muhammedsalama/laravel-base

The package was recently featured by Laravel News, and I'm continuing to improve it based on community feedback.

If you have ideas, suggestions, or feature requests, I'd be happy to hear them.

Happy coding! ????