feat: add profile editing
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class EditProfilePostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
|
||||
'name' =>
|
||||
[
|
||||
'required',
|
||||
'string',
|
||||
'max:255'
|
||||
],
|
||||
'username' =>
|
||||
[
|
||||
'required',
|
||||
'string',
|
||||
'max:255',
|
||||
'unique:users,username,' . $user->id,
|
||||
],
|
||||
'email' => [
|
||||
'required',
|
||||
'email',
|
||||
'max:255',
|
||||
'unique:users,email,' . $user->id,
|
||||
],
|
||||
'password' =>
|
||||
|
||||
[
|
||||
'nullable',
|
||||
'string',
|
||||
'min:8',
|
||||
'confirmed'
|
||||
],
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user