This commit is contained in:
2025-02-10 01:58:12 +02:00
parent 25d99e7b72
commit 87bbfc33d3
242 changed files with 38662 additions and 99 deletions
@@ -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;
}
+28 -1
View File
@@ -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');
}
}
+25
View File
@@ -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'));
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests\Forum;
use Illuminate\Foundation\Http\FormRequest;
class TopicRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
];
}
}