commsexpress / smart-entities
该包的最新版本(dev-relation_and_timestamp_bugfixes)没有提供许可信息。
使用智能实体模式扩展Laravel的微框架
dev-relation_and_timestamp_bugfixes
2018-03-12 10:37 UTC
Requires
- php: ^7.0
- commsexpress/smart-entities: @dev
- illuminate/config: ~5.5
- illuminate/database: ~5.5.0
- illuminate/support: ~5.5.0
Requires (Dev)
- orchestra/testbench: ~3.0
- phpunit/phpunit: ~6.2
This package is auto-updated.
Last update: 2024-09-13 02:49:58 UTC
README
创建实体
- 从命令行运行
php artisan make:smart {name}
。 - 命令接受一个可选的第二个参数,用于实体的
{domain}
。域名将确定仓库文件结构(同一域名内的仓库被分组)和默认服务。默认为{name}
参数。 - 命令接受以下选项
-c
或--controller
-r
或--resource
用于资源控制器-s
或--service
-m
或--migration
删除实体
- 从命令行运行
php artisan del:smart {name}
。 - 命令接受一个可选的第二个参数,用于实体的
{domain}
。 - 如果需要删除域名的仓库文件夹(以及其中所有内容),请接受
-f
或--force
选项
创建用户实体
- 从命令行运行
php artisan make:smartauth
。 将以下内容添加到App\Providers\AuthServiceProvider的boot函数中,在下面的`$this->registerPolicies()`之后:`Auth::provider('smartprovider', function() {
return new SmartAuthProvider($this->app['hash'], app()->make(\App\Services\UserService::class));
});`
在config/auth中:1) 将guards.web.provider更改为'smart' 2) 添加以下到providers数组中:`'smart' => [
'driver' => 'smartprovider', 'model' => App\Entities\UserEntity::class,
]`
TODO
- 是否将withTrashed作为全局范围进行检查?
- 将填充属性放在实体上
- 替换App引用为DummyRootNamespace