public function pin($userId) { $pin = new PinnedPlaylist(); $pin->playlist_id = $this->id; $pin->user_id = $userId; $pin->save(); }