Passed
Push — dev6 ( 3fa4bc...200ba5 )
by Ron
18:44
created

EditCustomerRequest::authorize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Http\Requests\Customers;
4
5
use App\Models\Customer;
6
use Illuminate\Foundation\Http\FormRequest;
7
8
class EditCustomerRequest extends FormRequest
9
{
10
    /**
11
     * Determine if the user is authorized to make this request
12
     */
13
    public function authorize()
14
    {
15
        return $this->user()->can('update', Customer::find($this->route('customer')));
16
    }
17
18
    /**
19
     * Get the validation rules that apply to the request
20
     */
21
    public function rules()
22
    {
23
        return [
24
            'name'        => 'required|string',
25
            'dba_name'    => 'nullable|string',
26
            'address'     => 'required',
27
            'city'        => 'required|string',
28
            'state'       => 'required|string',
29
            'zip'         => 'required|numeric',
30
        ];
31
    }
32
}
33