arispati / lapice
Laravel 库,用于使用仓库和服务模式
v0.1.0
2022-01-24 04:14 UTC
Requires
- php: >=7.1
- illuminate/console: >=5.6
- illuminate/database: >=5.6
- illuminate/filesystem: >=5.6
- illuminate/support: >=5.6
README
Laravel 库,用于使用仓库和服务模式
目录
需求
- PHP >= 7.1
- Laravel >= 5.6
安装
- 使用 composer 安装
composer require arispati/lapice
可用命令
创建仓库
php artisan lapice:repository ExampleRepository
它将生成 app/Repositories/ExampleRepository.php
文件
<?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; } }
创建服务
php artisan lapice:service ExampleService
它将生成 app/Services/ExampleService.php
文件
<?php namespace App\Services; class ExampleService { /** * Class constructor */ public function __construct() { // } }