authorize()
authorize() : boolean
Determine if the user is authorized to make this request.
<?php
/**
* JingYao-backend
*
* @link https://gitee.com/wang-zhihui-release/jingyao-backend
* @apiDocument https://gitee.com/wang-zhihui-release/jingyao-backend/wikis/
*/
namespace App\Http\Requests;
use App\Enums\UserIdentityEnum;
use App\Enums\UserSexEnum;
use App\Rules\CheckEnum;
class ChangeUserRequest extends CommonRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'sex' => [new CheckEnum(new UserSexEnum())],
'phone' => 'size:11',
'identity' => [new CheckEnum(new UserIdentityEnum())],
];
}
}