first commit

This commit is contained in:
ct
2023-07-25 01:06:06 +08:00
commit 94e320735c
133 changed files with 15373 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Http\Requests;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Auth;
use Illuminate\Foundation\Http\FormRequest;
class ProfileUpdateRequest extends FormRequest
{
public function rules()
{
return [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'email', 'string', 'max:255', Rule::unique('users')->ignore(Auth::user())],
'password' => ['nullable', 'string', 'confirmed', 'min:8'],
];
}
public function authorize()
{
return true;
}
protected function prepareForValidation()
{
if ($this->password == null) {
$this->request->remove('password');
}
}
}