dhandarbeit-tk / laravel-boilerplate-platform
Laravel 框架。
1.0
2018-12-10 13:47 UTC
Requires
- php: ^7.1.3
- caouecs/laravel-lang: ~3.0
- doctrine/dbal: ^2.9
- fideloper/proxy: ^4.0
- laravel/framework: 5.7.*
- laravel/tinker: ^1.0
- laravelcollective/html: ^5.7
- vinkla/hashids: ^5.1
Requires (Dev)
- barryvdh/laravel-ide-helper: ^2.5
- beyondcode/laravel-dump-server: ^1.0
- filp/whoops: ^2.0
- fzaninotto/faker: ^1.4
- mockery/mockery: ^1.0
- nunomaduro/collision: ^2.0
- phpunit/phpunit: ^7.0
This package is not auto-updated.
Last update: 2024-09-26 00:37:09 UTC
README
为 laravel/laravel 的核心功能提供有用的辅助函数和类结构。
构建为可定制。
安装
创建项目
composer create-project dhandarbeit-tk/laravel-boilerplate-platform
预安装的包
- HTML 和表单构建器 laravelcollective/html
- doctrine/dbal
- Laravel IDE Helper barryvdh/laravel-ide-helper
- 仅注册用于 开发环境(通过 AppServiceProvider)
- caouecs/laravel-lang
- Hashids 桥接 vinkla/hashids
新默认值
- LOG_CHANNEL=daily
- database.migrations=laravel_migrations
- queue.database.table=laravel_jobs
- queue.failed.table=laravel_failed_jobs
其他默认值
- app.locale=de
- app.timezone=Europe/Berlin
目录
- app/Support
- app/Eloquent/Models
- app/Eloquent/Collections
辅助函数
(app/Support/helpers.php)
- array_ensured($array, $data)
- 返回包含数据所有键的 $array,如果 $array 没有该键,则包含值
- user()
- auth()->user() 的简写
- decodeHashid($connection, $encoded, $default)
- 返回 $encoded 的解码 hashid;如果不可能,则返回 $default
- encodeHashid($connection, $decoded)
- 返回 $decoded 的编码 hashid
- isCurrentRelease()
- 确定正在运行的版本是否为最新版本(用于与部署相关的事项)
可定制的类和方法
-
App\Eloquent\Models\Model (trait: IsModel)
- is($model = null) (覆盖)
- 允许参数为 null(返回 false)
- isClass($class)
- is($model = null) (覆盖)
-
App\Eloquent\Models\Traits\HasTimestamps
- updateTimestamps() (覆盖)
- 仅设置 updated_at 当更新时,不设置创建时
- updateTimestamps() (覆盖)
-
App\Eloquent\Models\Pivots\Pivot (trait: IsPivot)
-
App\Support\Collection (trait: CollectionTrait)
- implode($value, $glue = null, $skipNull = false) (覆盖)
- 允许跳过 null
- implode($value, $glue = null, $skipNull = false) (覆盖)
-
App\Eloquent\Collections\Collection (trait: CollectionTrait)
- without($model = null)
- 返回一个新的不包含 $model 的 Collection
- eachDelete()
- 对每个模型运行 delete()
- eachAppends($attributes)
- 对每个模型运行 appends($attributes)
- without($model = null)
存根
- artisan make:model
- (app/Console/stubs/model.stub)
- 预填充表名
- 有预定义的关系区域