Create your Trait, Repository, and Service Class using artisan command.

Anik Anwar
Feb 2, 2021

https://github.com/theanik/laravel-more-command

This is a simple package for create Repository, Repository with Interface, Service, Trait form command line using php artisan command.
[Note : This package also worked for nWidart/laravel-modules]

Require the package with composer using the following command:

composer require theanik/laravel-more-command --dev

Commands for simple laravel project

// Create Repository
php artisan make:repository UserRepository
// Create Reposiotory with interface
php artisan make:repository UserRepository -i
// Create Service
php artisan make:service UserService
// Create trait
php artisan make:trait HasAuth

Commands for nWidart/laravel-modules

// Create Repository
php artisan module-make:repository UserRepository {MODULE_NAME}
// Create Reposiotory with interface
php artisan module-make:repository UserRepository -i {MODULE_NAME}
// Create Service
php artisan module-make:service UserService {MODULE_NAME}
// Create trait
php artisan module-make:trait HasAuth {MODULE_NAME}

Thank you. :)

--

--