ifx merge for update

This commit is contained in:
2020-08-01 17:34:10 +02:00
62 changed files with 3278 additions and 946 deletions

View File

@@ -3,6 +3,7 @@
namespace App;
use App\Models\Bookmark;
use App\Models\Event;
use App\Models\Image;
use App\Models\Memo;
use App\Models\ToDoList;
@@ -94,4 +95,19 @@ class User extends Authenticatable
$userImage->path = 'images/default-cover.jpg';
});
}
public function thumbnailImage(): MorphOne
{
return $this->morphOne(Image::class, 'imageable')
->orderBy('id', 'desc')
->where('location', 'profile-small')
->withDefault(function ($userImage) {
$userImage->path = 'images/default-cover.jpg';
});
}
public function events(): HasMany
{
return $this->hasMany(Event::class);
}
}