progress
This commit is contained in:
@@ -76,6 +76,7 @@ class RegisterController extends Controller
|
||||
$this->createMediaList('Collection', $user);
|
||||
$this->createMediaList('Watched', $user);
|
||||
$this->createMediaList('Liked', $user);
|
||||
$this->createMediaList('Favourite', $user);
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Person;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CelebrityController extends Controller
|
||||
{
|
||||
@@ -18,6 +19,32 @@ class CelebrityController extends Controller
|
||||
{
|
||||
$celebrity = Person::where('slug', $slug)->first();
|
||||
|
||||
return view('celebrity.show', compact('celebrity'));
|
||||
// movies by job
|
||||
$movies = DB::table('movies')
|
||||
->leftJoin('movie_cast', 'movie_cast.movie_id', '=', 'movies.id')
|
||||
->where('movie_cast.person_id', '=', $celebrity->id)
|
||||
->get();
|
||||
|
||||
// movies crew
|
||||
|
||||
$moviesByDepartments = [];
|
||||
|
||||
foreach ($movies as $movie) {
|
||||
$moviesByDepartments[$movie->known_for_department][]= $movie;
|
||||
}
|
||||
|
||||
|
||||
$showsByDepartment = [];
|
||||
|
||||
$shows = DB::table('shows')
|
||||
->leftJoin('show_cast', 'show_cast.show_id', '=', 'shows.id')
|
||||
->where('show_cast.person_id', '=', $celebrity->id)
|
||||
->get();
|
||||
|
||||
foreach ($shows as $show) {
|
||||
$showsByDepartment[$show->known_for_department][]= $show;
|
||||
}
|
||||
|
||||
return view('celebrity.show', compact('celebrity', 'moviesByDepartments', 'showsByDepartment'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,22 @@
|
||||
namespace App\Http\Controllers\Forum;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Forum\Category;
|
||||
use App\Models\Forum\Thread;
|
||||
use App\Models\Forum\Topic;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ThreadsController extends Controller
|
||||
{
|
||||
public function show(string $threadSlug)
|
||||
public function show(string $categorySlug, string $threadSlug)
|
||||
{
|
||||
$category = Category::where('slug', $categorySlug)->first();
|
||||
$thread = Thread::where('slug', $threadSlug)->first();
|
||||
|
||||
$topics = Topic::where('category_id', $category->id)
|
||||
->where('thread_id', $thread->id)
|
||||
->paginate(15);
|
||||
|
||||
return view('forum.thread', compact('category', 'thread', 'topics'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,13 @@
|
||||
namespace App\Http\Controllers\Forum;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Forum\TopicRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TopicsController extends Controller
|
||||
{
|
||||
//
|
||||
public function create(TopicRequest $request)
|
||||
{
|
||||
return view('forum.topics.create');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Show;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ShowController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$shows = Show::paginate(48);
|
||||
|
||||
return view('show.index', compact('shows'));
|
||||
}
|
||||
|
||||
public function show(string $slug)
|
||||
{
|
||||
$show = Show::with('posters', 'backdrops', 'externalIds', 'networks', 'genres', 'productionCompanies')->where('slug', $slug)->first();
|
||||
|
||||
$comments = [];
|
||||
|
||||
return view('show.show', compact('show', 'comments'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user