user()?->can('device.credential.create') ?? false; } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return self::deviceCredentialRules(); } public static function deviceCredentialRules(): array { return [ 'name' => ['required', 'string', 'max:255'], 'username' => ['required', 'string', 'max:255'], 'password' => ['required', 'string', 'max:4096'], 'enable_password' => ['nullable', 'string', 'max:4096'], 'connection_type' => ['required', 'in:routeros_api,ssh,telnet,snmp,vendor_api'], 'privilege_type' => ['required', 'in:master,noc,technician,monitoring,custom'], 'is_master' => ['sometimes', 'boolean'], 'is_active' => ['sometimes', 'boolean'], ]; } }