2019-08-12 14:45:13 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-08-12 14:45:13 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2024-04-12 06:15:41 +02:00
|
|
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-08-12 14:45:13 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-08-12 14:45:13 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Requests\ClientPortal;
|
|
|
|
|
|
|
|
use App\Http\Requests\Request;
|
2019-08-13 23:16:31 +02:00
|
|
|
use App\Utils\Traits\MakesHash;
|
2019-08-12 14:45:13 +02:00
|
|
|
|
|
|
|
class UpdateContactRequest extends Request
|
|
|
|
{
|
2019-08-13 23:16:31 +02:00
|
|
|
use MakesHash;
|
2020-09-06 11:38:10 +02:00
|
|
|
|
2019-08-12 14:45:13 +02:00
|
|
|
/**
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
2024-01-14 05:05:00 +01:00
|
|
|
public function authorize(): bool
|
2019-08-12 14:45:13 +02:00
|
|
|
{
|
2019-08-13 23:16:31 +02:00
|
|
|
return $this->encodePrimaryKey(auth()->user()->id) === request()->segment(3);
|
2019-08-12 14:45:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'first_name' => 'required',
|
|
|
|
'last_name' => 'required',
|
2020-10-12 23:27:42 +02:00
|
|
|
'email' => 'required|email:rfc,dns|unique:client_contacts,email,'.auth()->user()->id,
|
2019-08-12 14:45:13 +02:00
|
|
|
'password' => 'sometimes|nullable|min:6|confirmed',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|