mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 21:52:35 +01:00
0fbda85a59
- Removed unused uses - Type hinting for method parameters - Removed commented code - Introduced comments for classes and methods - Short array syntax
32 lines
659 B
PHP
32 lines
659 B
PHP
<?php namespace App\Http\Requests;
|
|
|
|
use Auth;
|
|
|
|
class UpdateUserRequest extends Request
|
|
{
|
|
// Expenses
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return $this->user()->can('edit', $this->entity());
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'email' => 'email|required|unique:users,email,' . Auth::user()->id . ',id',
|
|
'first_name' => 'required',
|
|
'last_name' => 'required',
|
|
];
|
|
}
|
|
}
|