2019-08-13 23:16:31 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-08-13 23:16:31 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-08-13 23:16:31 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-08-13 23:16:31 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Requests\ClientPortal;
|
|
|
|
|
|
|
|
use App\Http\Requests\Request;
|
|
|
|
use App\Utils\Traits\MakesHash;
|
|
|
|
|
2019-08-14 02:15:21 +02:00
|
|
|
class UpdateClientRequest extends Request
|
2019-08-13 23:16:31 +02:00
|
|
|
{
|
|
|
|
use MakesHash;
|
2020-03-23 18:10:42 +01:00
|
|
|
|
2019-08-13 23:16:31 +02:00
|
|
|
/**
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function authorize() : bool
|
|
|
|
{
|
|
|
|
return $this->encodePrimaryKey(auth()->user()->id) === request()->segment(3);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
return [
|
2020-03-23 18:10:42 +01:00
|
|
|
'name' => 'sometimes|required',
|
2021-11-19 23:39:35 +01:00
|
|
|
'file' => 'sometimes|nullable|max:100000|mimes:png,jpeg,gif,jpg,bmp',
|
2019-08-13 23:16:31 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|