We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c172a83 commit e19b188Copy full SHA for e19b188
src/Http/Controllers/ProfileAvatarController.php
@@ -11,14 +11,14 @@ public function __invoke(ProfileAvatarRequest $request)
11
$user = $request->user();
12
13
$request->validate([
14
- 'avatar' => 'required|image',
+ $request::$userAvatarAttribute => 'required|image',
15
]);
16
17
ProfileAvatarRequest::$path = "avatars/{$user->getKey()}";
18
19
$path = is_callable(ProfileAvatarRequest::$pathCallback) ? call_user_func(ProfileAvatarRequest::$pathCallback, $request) : $request::$path;
20
21
- $path = $request->file('avatar')->store($path);
+ $path = $request->file($request::$userAvatarAttribute)->store($path);
22
23
$user->{$request::$userAvatarAttribute} = $path;
24
$user->save();
0 commit comments