Snipe-IT
Open Source Asset Management
FEATURES
DEMO
DOWNLOAD
DOCUMENTATION
HOSTED SOLUTION
SUPPORT
Intro
Namespaces
Classes
Files
Misc
snipe-it
app
Http
Requests
SettingRequest.php
Go to the documentation of this file.
1
<?php
2
3
namespace
App\Http\Requests
;
4
5
use
App\Http\Requests\Request
;
6
7
class
SettingRequest
extends
Request
8
{
14
public
function
authorize
()
15
{
16
return
true
;
17
}
18
24
public
function
rules
()
25
{
26
return
[
27
"brand"
=>
'required|min:1|numeric'
,
28
"qr_text"
=>
'min:1|max:31'
,
29
"logo_img"
=>
'mimes:jpeg,bmp,png,gif'
,
30
"custom_css"
=>
'string'
,
31
"alert_email"
=>
'email_array'
,
32
"slack_endpoint"
=>
'url'
,
33
"default_currency"
=>
'required'
,
34
"locale"
=>
'required'
,
35
"slack_channel"
=>
'regex:/(?<!\w)#\w+/'
,
36
"slack_botname"
=>
'string'
,
37
'labels_per_page'
=>
'numeric'
,
38
'labels_width'
=>
'numeric'
,
39
'labels_height'
=>
'numeric'
,
40
'labels_pmargin_left'
=>
'numeric'
,
41
'labels_pmargin_right'
=>
'numeric'
,
42
'labels_pmargin_top'
=>
'numeric'
,
43
'labels_pmargin_bottom'
=>
'numeric'
,
44
'labels_display_bgutter'
=>
'numeric'
,
45
'labels_display_sgutter'
=>
'numeric'
,
46
'labels_fontsize'
=>
'numeric|min:5'
,
47
'labels_pagewidth'
=>
'numeric'
,
48
'labels_pageheight'
=>
'numeric'
,
49
"ldap_server"
=>
'sometimes|required_if:ldap_enabled,1|url'
,
50
"ldap_uname"
=>
'sometimes|required_if:ldap_enabled,1'
,
51
"ldap_basedn"
=>
'sometimes|required_if:ldap_enabled,1'
,
52
"ldap_filter"
=>
'sometimes|required_if:ldap_enabled,1'
,
53
"ldap_username_field"
=>
'sometimes|required_if:ldap_enabled,1'
,
54
"ldap_lname_field"
=>
'sometimes|required_if:ldap_enabled,1'
,
55
"ldap_auth_filter_query"
=>
'sometimes|required_if:ldap_enabled,1'
,
56
"ldap_version"
=>
'sometimes|required_if:ldap_enabled,1'
,
57
];
58
}
59
60
public
function
response
(array $errors)
61
{
62
return
$this->redirector->back()->withInput()->withErrors($errors, $this->errorBag);
63
}
64
}
App\Http\Requests\SettingRequest
Definition:
SettingRequest.php:7
App\Http\Requests\SettingRequest\response
response(array $errors)
Definition:
SettingRequest.php:60
App\Http\Requests\SettingRequest\rules
rules()
Get the validation rules that apply to the request.
Definition:
SettingRequest.php:24
Request
Request
App\Http\Requests\SettingRequest\authorize
authorize()
Determine if the user is authorized to make this request.
Definition:
SettingRequest.php:14
App\Http\Requests
Definition:
AssetCheckinRequest.php:3