think.studio/laravel-thinkit
最新稳定版本:1.4.0
Composer 安装命令:
composer require think.studio/laravel-thinkit
包简介
Laravel small kit for quicker development.
README 文档
README
Laravel small kit for quicker development.
Installation
Install the package via composer:
composer require think.studio/laravel-thinkit
Optionally you can publish the config file with:
php artisan vendor:publish --provider="ThinKit\ServiceProvider" --tag="config"
Usage
Helpers
SQL
\ThinKit\Helpers\Sql::readableSqlFromQuery(MyModel::whereKey(123));
URL
\ThinKit\Helpers\Url::addOrUpdateArgs('https://my.path.co.uk?example=foo&test=bar', 'new', 'baz');
DateTime
$formats = [ 'Y-m-d', 'Y-m-d\TH:i:s', ]; $carbonDate = \ThinKit\Helpers\DateTime::createFromMultipleFormats($formats, '2022-09-28T08:19:00'); $carbonDate->format('Y-m-d H:i:s');
Enums
use ThinKit\Enums\HasNames; use ThinKit\Enums\NamedEnum; enum SalesCallType: string implements NamedEnum { use HasNames; case GENERAL = 'general'; case EVENT = 'event'; case AWARD = 'award'; } SalesCallType::GENERAL->name() // translation label SalesCallType::options() // ["<value>" => "<translation label>"] SalesCallType::formattedOptions() // [["value" => "<value>", "label" => "<translation label>"]]
Credits
统计信息
- 总下载量: 130
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-04