2018-11-02 21:54:46 +11:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Client;
|
|
|
|
|
|
|
|
|
|
use App\Http\Requests\Request;
|
2019-01-22 01:06:49 +11:00
|
|
|
use App\Models\Client;
|
2018-11-02 21:54:46 +11:00
|
|
|
|
2018-11-03 12:01:40 +11:00
|
|
|
class EditClientRequest extends Request
|
2018-11-02 21:54:46 +11:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
|
2019-04-16 13:28:05 +10:00
|
|
|
public function authorize() : bool
|
2018-11-02 21:54:46 +11:00
|
|
|
{
|
2019-03-28 08:32:50 +11:00
|
|
|
return auth()->user()->can('edit', $this->client);
|
2018-11-02 21:54:46 +11:00
|
|
|
}
|
|
|
|
|
|
2018-11-11 00:24:36 +11:00
|
|
|
public function sanitize()
|
|
|
|
|
{
|
|
|
|
|
$input = $this->all();
|
|
|
|
|
|
|
|
|
|
//$input['id'] = $this->encodePrimaryKey($input['id']);
|
|
|
|
|
|
|
|
|
|
//$this->replace($input);
|
|
|
|
|
|
|
|
|
|
return $this->all();
|
|
|
|
|
}
|
2018-11-02 21:54:46 +11:00
|
|
|
|
|
|
|
|
}
|