portedcheese / base-settings
启动项目的模板和设置
v5.0.2
2024-09-18 11:35 UTC
Requires
- guzzlehttp/guzzle: ^7.0.1
- intervention/image: ^2.0
- laravel/framework: ^9.0|^10.0
- laravel/ui: ^4.0.0
- dev-master
- v5.0.2
- v5.0.1
- v5.0.0
- v4.2.4
- v4.2.3
- v4.2.2
- v4.2.1
- v4.2.0
- v4.1.6
- v4.1.5
- v4.1.4
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.0
- v1.7.15
- v1.7.14
- v1.7.13
- v1.7.12
- v1.7.11
- v1.7.10
- v1.7.9
- v1.7.8
- v1.7.7
- v1.7.6
- v1.7.5
- v1.7.4
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.29
- v1.4.28
- v1.4.27
- v1.4.26
- v1.4.25
- v1.4.24
- v1.4.23
- v1.4.22
- v1.4.21
- v1.4.20
- v1.4.19
- v1.4.18
- v1.4.17
- v1.4.16
- v1.4.15
- v1.4.14
- v1.4.13
- v1.4.12
- v1.4.11
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.10
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4.6
- v1.3.4.5
- v1.3.4.4
- v1.3.4.3
- v1.3.4.2
- v1.3.4.1
- v1.3.4.0
- v1.3.3.12
- v1.3.3.11
- v1.3.3.10
- v1.3.3.9
- v1.3.3.8
- v1.3.3.7
- v1.3.3.6
- v1.3.3.5
- v1.3.3.4
- v1.3.3.3
- v1.3.3.2
- v1.3.3.1
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.13
- v1.2.12.5
- v1.2.12.4
- v1.2.12.3
- v1.2.12.2
- v1.2.12.1
- v1.2.12
- v1.2.11.5
- v1.2.11.4
- v1.2.11.3
- v1.2.11.2
- v1.2.11.1
- v1.2.11
- v1.2.10
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
This package is auto-updated.
Last update: 2024-09-18 11:36:09 UTC
README
提供一组用于部署基本网站的类、视图和组件。
存在基本的命令,用于填充配置和模型。
安装
php artisan ui vue --auth
npm install && npm run dev
php artisan vendor:publish --provider="PortedCheese\BaseSettings\BaseSettingsServiceProvider" --tag=public --force
php artisan vendor:publish --provider="PortedCheese\BaseSettings\BaseSettingsServiceProvider" --tag=config
php artisan make:base-settings {--all : Run all}
{--views : Scaffold views}
{--force : Overwrite existing views by default}
{--models : Export models}
{--filters : Export filters}
{--controllers : Export controllers}
{--policies : Export and create rules}
{--only-default : Create default rules}
{--config : Make config}
{--scss : Export scss files}
{--vue : Export vue files}
{--js : Export js files}
在控制器 App\Http\Controllers\Controller
中添加构造函数
public function __construct()
{
$this->routeName = Route::currentRouteName();
}
为图像处理配置应用程序
php artisan storage:link
FILESYSTEM_DISK=public
中间件
- role: 根据角色的存在提供访问权限
- management: 访问网站的管理部分。
- super: 允许管理员通过
- editor: 允许编辑器通过
门
- 具有管理员角色的用户可以访问所有内容
- site-management: 允许访问管理后台。(
App\Policies\BasePolicy@siteManagement
) - settings-management: 对管理员开放。(
App\Policies\BasePolicy@settingsManagement
)
命令和功能
处理日期的功能
datehelper()
{->forFilter(date, date to condition = false)}
{->changeTz(date)}
{->format(date, format = "d.m.Y H:i")
处理网站配置的功能
base-config()
@method static get(string $name, $value = "", $default = null)
@method static create(string $name, array $data, array $info, $force = false)
@method static update(string $name, string $var, $value)
生成入口链接
php artisan generate:login-link {email} {--send=} {--get}
清除缓存密钥
php artisan cache:forget {key}
清除图像过滤器
php artisan cache:forget "image-filters:{template}-{filename}"
php artisan cache:forget "object-filters-original:{filename}"
php artisan cache:forget "object-filters-content:{template}-{filename}"
清除所有过滤器
php artisan image-filters:clear
组件
universal-priority
<universal-priority
:elements="{{ json_encode([['name' => "name", "id" => "id"(, "url" => "url")], [..], [..]]) }}"
url="{{ route("admin.vue.priority", ['table' => "table_name", "field" => "field_name"]) }}">
</universal-priority>
confirm-form
<confirm-form :id="'{{ "delete-form-{$model->id}" }}'">
<template>
<form action="{{ route('admin.model.destroy', ['model' => $model]) }}"
id="delete-form-{{ $model->id }}"
class="btn-group"
method="post">
@csrf
@method("delete")
</form>
</template>
</confirm-form>
Параметры:
- title: Вы уверены?
- text: Это действие будет невозможно отменить!
- confirm-text: Да, удалить!
- cancel-text: Отмена
包含
@googleCaptcha2
- 用于表单的 Google ReCaptcha,google_captcha
- 验证规则
@hiddenCaptcha
- 隐藏式验证码,hidden_captcha
- 验证
编辑画廊
@eGall(["id" => Auth::user()->id, "model" => "user", "noCover" => false])
输出 picture
标签
@pic([
"image" => (object) ["file_name" => "example.jpg", "name" => "example"],
"template" => "small",
"grid" => [
"example-grid" => 768,
],
"imgClass" => "example-class",
])
使用 lightbox
输出图像
@img([
"image" => (object) ["file_name" => "example.jpg", "name" => "example", "id" => "unique"], (id требуется если lightbox не указан)
"template" => "small",
"lightbox" => "lightGroupExample",
"imgClass" => "example-class",
"grid" => [
"example-grid" => 768,
],
])
使用 lightbox
输出画廊
@images([
"gallery" => [(object) ..., (object) ...],
"lightbox" => "lightExampleGroup",
"template" => "sm-grid-6",
"grid" => [
"lg-grid-3" => 992,
"md-grid-6" => 768,
],
"imgClass" => "img-fluid",
])
输出 Lazy picture
标签
@picLazy([
"image" => (object) ["file_name" => "example.jpg", "name" => "example"],
"template" => "small",
"grid" => [
"example-grid" => 768,
],
"imgClass" => "example-class",
])
使用 lightbox
输出 Lazy 图像
@imgLazy([
"image" => (object) ["file_name" => "example.jpg", "name" => "example", "id" => "unique"], (id требуется если lightbox не указан)
"template" => "small",
"lightbox" => "lightGroupExample",
"imgClass" => "example-class",
"grid" => [
"example-grid" => 768,
],
])
使用 lightbox
输出 Lazy 画廊
@imagesLazy([
"gallery" => [(object) ..., (object) ...],
"lightbox" => "lightExampleGroup",
"template" => "sm-grid-6",
"grid" => [
"lg-grid-3" => 992,
"md-grid-6" => 768,
],
"imgClass" => "img-fluid",
])