add cover to profile & logout on dashbord
This commit is contained in:
@@ -67,13 +67,19 @@ class User extends Authenticatable
|
||||
{
|
||||
return $this->morphOne(Image::class, 'imageable')
|
||||
->where('location', 'profile')
|
||||
->orderBy('id', 'desc');
|
||||
->orderBy('id', 'desc')
|
||||
->withDefault(function ($userImage) {
|
||||
$userImage->path = 'images/default-cover.jpg';
|
||||
});
|
||||
}
|
||||
|
||||
public function coverImage(): MorphOne
|
||||
{
|
||||
return $this->morphOne(Image::class, 'imageable')
|
||||
->where('location', 'cover')
|
||||
->orderBy('id', 'desc');
|
||||
->orderBy('id', 'desc')
|
||||
->withDefault(function ($userImage) {
|
||||
$userImage->path = 'images/default-cover.jpg';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user