Simple repository setup for Laravel 5.3
- Copy
BaseRepository.php
intoApp/Repositories
- Copy
repository.stub
intoApp/Console/Commands/stubs
- Copy
MakeRepositoryCommand.php
intoApp/Console/Commands
- Add
MakeRepositoryCommand:class
into theApp/Console/Kernel.php
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
Commands\MakeRepositoryCommand::class,
];
The make:repository
command automatically creates a new Repository into App\Repositories
php artisan make:repository NameRepo