arispati/lapice
Lapice
Laravel library to use repository and service pattern
Table of Contents
Requirement
- PHP >= 7.1
- Laravel >= 5.6
Installation
- Install with composer
composer require arispati/lapice
Available Commands
Create Repository
php artisan lapice:repository ExampleRepository
It will generate app/Repositories/ExampleRepository.php file
<?php
namespace App\Repositories;
use Arispati\Lapice\Repository\BaseRepository;
class ExampleRepository extends BaseRepository
{
/**
* Set the model class
*
* @return string
*/
protected function setModel(): string
{
// return Model::class;
}
}
Create Service
php artisan lapice:service ExampleService
It will generate app/Services/ExampleService.php file
<?php
namespace App\Services;
class ExampleService
{
/**
* Class constructor
*/
public function __construct()
{
//
}
}
Wiki
Related Packages
longman/laravel-platfourm
Package to implement right Repository/Service architecture in Laravel 5.x
642
8