✨ Permet la mise à jour du profil
La mise à jour de l'avatar fonctionne à moitié Pour #12
This commit is contained in:
35
app/Http/Requests/UpdateUser.php
Normal file
35
app/Http/Requests/UpdateUser.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class UpdateUser extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return !Auth::guest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|min:4|max:255',
|
||||
'email' => 'required|email:rfc|unique:users,email,'.Auth::user()->getAuthIdentifier(),
|
||||
'encrypt_messages' => 'boolean',
|
||||
'notification_hour' => 'in:0,1,2,3,4',
|
||||
'avatar' => 'file|dimensions:min_width=50,min_height=50,max_width=200,max_height=200,ratio=1'
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user