progress
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\MediaList;
|
||||
use App\Models\MediaListItem;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -11,6 +13,14 @@ class ProfileController extends Controller
|
||||
{
|
||||
$user = User::where('slug', $slug)->first();
|
||||
|
||||
return view('profile.show', compact('user'));
|
||||
$watchedList = MediaList::where('slug', MediaList::WATCHED)->first();
|
||||
|
||||
$lastWatchedListItem = MediaListItem::with('item')->where('media_list_id', $watchedList->id)
|
||||
->orderBy('id', 'desc')
|
||||
->first();
|
||||
|
||||
$lastWatched = $lastWatchedListItem->item;
|
||||
|
||||
return view('profile.show', compact('user', 'lastWatched'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user