Access in rules to auth user #144
Unanswered
robert-abram
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Those are user profile update rules, right? Can be simplified a little public static function rules(Request $request): array
{
return [
'name' => ['required', 'string', 'min:3', 'max:255'],
'email' => [
'required',
'email',
'max:255',
Rule::unique(User::class, 'email')->ignore($request->user())
],
];
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How i should access to auth user from DTO, because i need to have this data inside my rule, for now i'm doing this, but i'm not sure if this is correct way, Any ideas ?
Beta Was this translation helpful? Give feedback.
All reactions