mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 15:57:50 +08:00
115 lines
3.1 KiB
PHP
115 lines
3.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request\Admin;
|
|
|
|
use Hyperf\Validation\Request\FormRequest;
|
|
|
|
class AdminMenuRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'parent_id' => 'sometimes|integer',
|
|
'name' => 'required|string|max:255',
|
|
'path' => 'sometimes|string|max:255',
|
|
'component' => 'sometimes|string|max:255',
|
|
'redirect' => 'sometimes|string|max:255',
|
|
'status' => 'sometimes|integer',
|
|
'sort' => 'sometimes|integer',
|
|
'remark' => 'sometimes|string|max:255',
|
|
'meta.title' => 'required|string|max:255',
|
|
'meta.i18n' => 'sometimes|string|max:255',
|
|
'meta.badge' => 'sometimes|string|max:255',
|
|
'meta.link' => 'sometimes|string|max:255',
|
|
'meta.icon' => 'sometimes|string|max:255',
|
|
'meta.affix' => 'sometimes|boolean',
|
|
'meta.hidden' => 'sometimes|boolean',
|
|
'meta.type' => 'sometimes|string|max:255',
|
|
'meta.cache' => 'sometimes|boolean',
|
|
'meta.breadcrumbEnable' => 'sometimes|boolean',
|
|
'meta.copyright' => 'sometimes|boolean',
|
|
'meta.componentPath' => 'sometimes|string|max:64',
|
|
'meta.componentSuffix' => 'sometimes|string|max:4',
|
|
'meta.activeName' => 'sometimes|string|max:255',
|
|
'btnPermission' => 'sometimes|array',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function messages(): array
|
|
{
|
|
return parent::messages();
|
|
}
|
|
|
|
/**
|
|
* @var array|array[]
|
|
*/
|
|
protected array $scenes = [
|
|
'update' => [
|
|
'parent_id',
|
|
'name',
|
|
'path',
|
|
'component',
|
|
'redirect',
|
|
'status',
|
|
'sort',
|
|
'remark',
|
|
'meta.title',
|
|
'meta.i18n',
|
|
'meta.badge',
|
|
'meta.link',
|
|
'meta.icon',
|
|
'meta.affix',
|
|
'meta.hidden',
|
|
'meta.type',
|
|
'meta.cache',
|
|
'meta.breadcrumbEnable',
|
|
'meta.copyright',
|
|
'meta.componentPath',
|
|
'meta.componentSuffix',
|
|
'meta.activeName',
|
|
'btnPermission',
|
|
],
|
|
'create' => [
|
|
'parent_id',
|
|
'name',
|
|
'path',
|
|
'component',
|
|
'redirect',
|
|
'status',
|
|
'sort',
|
|
'remark',
|
|
'meta.title',
|
|
'meta.i18n',
|
|
'meta.badge',
|
|
'meta.link',
|
|
'meta.icon',
|
|
'meta.affix',
|
|
'meta.hidden',
|
|
'meta.type',
|
|
'meta.cache',
|
|
'meta.breadcrumbEnable',
|
|
'meta.copyright',
|
|
'meta.componentPath',
|
|
'meta.componentSuffix',
|
|
'meta.activeName',
|
|
'btnPermission',
|
|
],
|
|
];
|
|
}
|