name)->slug()->toString(); $exists = Auth::user() ->taskLists() ->where('slug', $slug) ->where('id', '!=', $model->id) ->exists(); if ($exists) { $slug = str($slug)->append('-' . uniqid()); } $model->slug = $slug; }); } public function setAsHome() { Auth::user()->taskLists()->update(['is_home' => false]); $this->update(['is_home' => true]); } public function tasks(): HasMany { return $this->hasMany(Task::class); } }