Skip to content

Commit e19b188

Browse files
committed
Another key for avatar
1 parent c172a83 commit e19b188

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Http/Controllers/ProfileAvatarController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ public function __invoke(ProfileAvatarRequest $request)
1111
$user = $request->user();
1212

1313
$request->validate([
14-
'avatar' => 'required|image',
14+
$request::$userAvatarAttribute => 'required|image',
1515
]);
1616

1717
ProfileAvatarRequest::$path = "avatars/{$user->getKey()}";
1818

1919
$path = is_callable(ProfileAvatarRequest::$pathCallback) ? call_user_func(ProfileAvatarRequest::$pathCallback, $request) : $request::$path;
2020

21-
$path = $request->file('avatar')->store($path);
21+
$path = $request->file($request::$userAvatarAttribute)->store($path);
2222

2323
$user->{$request::$userAvatarAttribute} = $path;
2424
$user->save();

0 commit comments

Comments
 (0)