use App\Models\Like;
use App\Models\User;
use App\Models\Banner;
use App\Models\Comment;
use App\Models\Bookmark;
use App\Models\Notification;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
trait Relationships
{
public function banner() : BelongsTo
{
return $this->belongsTo(Banner::class);
}
public function bookmarks() : HasMany
{
return $this->hasMany(Bookmark::class);
}
public function comments() : HasMany
{
return $this->hasMany(Comment::class);
}
public function likes() : HasMany
{
return $this->hasMany(Like::class);
}
public function notifications() : HasMany
{
return $this->hasMany(Notification::class);
}
public function user() : BelongsTo
{
return $this->belongsTo(User::class);
}
}