diff --git a/app/Console/Commands/ItemProcessing/FetchItemDataCommand.php b/app/Console/Commands/ItemProcessing/FetchItemDataCommand.php index a087ed5..d3ac514 100644 --- a/app/Console/Commands/ItemProcessing/FetchItemDataCommand.php +++ b/app/Console/Commands/ItemProcessing/FetchItemDataCommand.php @@ -45,18 +45,9 @@ class FetchItemDataCommand extends Command private function getBatch(string $type, int $batch, string $job) { - return ItemToFetch::has('jobs') - ->with([ -// 'jobs' => fn ($jobs) => dd($jobs->first()->remaining_jobs) /*array_search($job, $jobs->first()->remaining_jobs, true)*/, - 'jobs' => function ($jobs) use ($job) { - $remainingJobs = $jobs->first()->remaining_jobs; - if (is_string($remainingJobs)) { - $remainingJobs = json_decode($jobs->first()->remaining_jobs, true); - } - return array_search($job, $remainingJobs, true); - }, - - ]) + return ItemToFetch::whereHas('jobs', function($query) use ($job){ + return $query->where('jobs', '<>', null)->whereRaw('FIND_IN_SET(?, jobs)', [$job]); + })->with(['jobs']) ->where('type', $type) ->take($batch) ->get(); diff --git a/app/Console/Commands/ItemProcessing/FetchUpcomingMoviesCommand.php b/app/Console/Commands/ItemProcessing/FetchUpcomingMoviesCommand.php index 4c3cdc9..420acc3 100644 --- a/app/Console/Commands/ItemProcessing/FetchUpcomingMoviesCommand.php +++ b/app/Console/Commands/ItemProcessing/FetchUpcomingMoviesCommand.php @@ -57,6 +57,7 @@ class FetchUpcomingMoviesCommand extends Command $oldUpcomingIds = UpcomingMovie::all()->pluck('movie_id'); foreach ($upcomingMovies['results'] as $upcomingMovie) { + echo "."; $movie = $this->process($upcomingMovie); if ($movie) { @@ -69,11 +70,13 @@ class FetchUpcomingMoviesCommand extends Command if (!empty($newUpcomingIds)) { UpcomingMovie::whereIn('id', $oldUpcomingIds)->delete(); UpcomingMovie::insert($newUpcomingIds); + echo "+"; } DB::commit(); } catch (\Throwable $e) { DB::rollBack(); + dump($e); } } @@ -86,14 +89,14 @@ class FetchUpcomingMoviesCommand extends Command return $movie; } - $itemToFetch = ItemToFetch::where('tmdb_id', $upcomingMovie['id'])->where('type', $type)->first(); + $itemToFetch = ItemToFetch::where('tmdb_id', $upcomingMovie['id'])->where('type', ItemToFetch::TYPE_MOVIE)->first(); if ($itemToFetch) { $this->movieProcessingService->process($itemToFetch, ItemToFetchJobs::JOB_DETAILS); return Movie::where('tmdb_id', $upcomingMovie['id'])->first(); } - ItemToFetch::create([ + $itemToFetch = ItemToFetch::create([ 'tmdb_id' => $upcomingMovie['id'], 'type' => ItemToFetch::TYPE_MOVIE, ]); @@ -107,6 +110,7 @@ class FetchUpcomingMoviesCommand extends Command 'remaining_jobs' => json_encode($jobs), ]); - return null; + $this->movieProcessingService->process($itemToFetch, ItemToFetchJobs::JOB_DETAILS); + return Movie::where('tmdb_id', $upcomingMovie['id'])->first(); } } diff --git a/app/Console/Commands/TmdbFetch/FetchExportItemsCommand.php b/app/Console/Commands/TmdbFetch/FetchExportItemsCommand.php index c0ebeb5..0742ad3 100644 --- a/app/Console/Commands/TmdbFetch/FetchExportItemsCommand.php +++ b/app/Console/Commands/TmdbFetch/FetchExportItemsCommand.php @@ -88,13 +88,11 @@ class FetchExportItemsCommand extends Command 'type' => $type, ]); -// $jobs = ItemToFetchJobs::JOBS; -// $jobs[] = "Details"; - ItemToFetchJobs::create([ 'tmdb_id' => $decodedLine['id'], 'type' => $type, 'remaining_jobs' => json_encode($jobs), + 'jobs' => implode(',', $jobs), ]); } } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index d5698e8..a577495 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; +use App\Models\MediaList; use App\Models\User; use Illuminate\Foundation\Auth\RegistersUsers; use Illuminate\Support\Facades\Hash; @@ -64,11 +65,27 @@ class RegisterController extends Controller */ protected function create(array $data) { - return User::create([ + $user = User::create([ 'name' => $data['name'], 'slug' => Str::slug($data['name']), 'email' => $data['email'], 'password' => Hash::make($data['password']), ]); + + $this->createMediaList('Watchlist', $user); + $this->createMediaList('Collection', $user); + $this->createMediaList('Watched', $user); + $this->createMediaList('Liked', $user); + + return $user; + } + + private function createMediaList(string $name, $user) + { + return MediaList::create([ + 'name' => $name, + 'slug' => Str::slug($name), + 'user_id' => $user->id, + ]); } } diff --git a/app/Http/Controllers/MediaListController.php b/app/Http/Controllers/MediaListController.php new file mode 100644 index 0000000..ccdec60 --- /dev/null +++ b/app/Http/Controllers/MediaListController.php @@ -0,0 +1,51 @@ +where('user_id', Auth::user()->id) + ->get(); + + return view('profile.lists.index', compact('lists')); + } + + public function show(string $userSlug, string $listSlug) + { + $user = User::where('slug', $userSlug)->first(); + $list = MediaList::where('user_id', $user->id)->where('slug', $listSlug)->first(); + $items = MediaListItem::where('media_list_id', $list->id)->paginate(15); + + return view('profile.lists.show', compact('list', 'items')); + } + + public function create() + { + return view('profile.lists.create'); + } + + public function store(MediaListRequest $request) + { + $slug = Str::slug($request->get('name')); + + $mediaList = MediaList::create([ + 'description' => $request->get('description'), + 'name' => $request->get('name'), + 'slug' => $slug, + 'user_id' => Auth::user()->id, + ]); + + return redirect()->route('profile.list.show', [Auth::user()->slug, $slug]); + } +} diff --git a/app/Http/Controllers/MovieController.php b/app/Http/Controllers/MovieController.php new file mode 100644 index 0000000..626551a --- /dev/null +++ b/app/Http/Controllers/MovieController.php @@ -0,0 +1,25 @@ +paginate(60); + + return view('movie.index', compact('movies')); + } + + public function show(string $slug) + { + $movie = Movie::with('director', 'watchProviders') + ->where('slug', $slug) + ->firstOrFail(); + + return view('movie.show', compact('movie')); + } +} diff --git a/app/Http/Requests/MediaListRequest.php b/app/Http/Requests/MediaListRequest.php new file mode 100644 index 0000000..e0621fe --- /dev/null +++ b/app/Http/Requests/MediaListRequest.php @@ -0,0 +1,29 @@ +|string> + */ + public function rules(): array + { + return [ + 'name' => 'required|min:2|max:255', + 'description' => 'sometimes|nullable', + ]; + } +} diff --git a/app/Livewire/Homepage/Movies/NewMoviesComponent.php b/app/Livewire/Homepage/Movies/NewMoviesComponent.php index ef9ed00..cbd745a 100644 --- a/app/Livewire/Homepage/Movies/NewMoviesComponent.php +++ b/app/Livewire/Homepage/Movies/NewMoviesComponent.php @@ -2,12 +2,20 @@ namespace App\Livewire\Homepage\Movies; +use App\Models\Movie; use Livewire\Component; class NewMoviesComponent extends Component { + public $newMovies; + public function render() { return view('livewire.homepage.movies.new-movies-component'); } + + public function mount() + { + $this->newMovies = Movie::orderBy('created_at', 'desc')->take(6)->get(); + } } diff --git a/app/Livewire/Homepage/Movies/UpcomingMoviesComponent.php b/app/Livewire/Homepage/Movies/UpcomingMoviesComponent.php index 8574d86..7004546 100644 --- a/app/Livewire/Homepage/Movies/UpcomingMoviesComponent.php +++ b/app/Livewire/Homepage/Movies/UpcomingMoviesComponent.php @@ -2,12 +2,23 @@ namespace App\Livewire\Homepage\Movies; +use App\Models\Movie; +use App\Models\UpcomingMovie; use Livewire\Component; class UpcomingMoviesComponent extends Component { + public $upcomingMovies; + public function render() { return view('livewire.homepage.movies.upcoming-movies-component'); } + + public function mount() + { + $this->upcomingMovies = Movie::whereIn('id', UpcomingMovie::orderBy('id', 'desc')->get()->pluck('movie_id')) + ->take(6) + ->get(); + } } diff --git a/app/Livewire/MoviePage/Tabs/Cast.php b/app/Livewire/MoviePage/Tabs/Cast.php new file mode 100644 index 0000000..a49a554 --- /dev/null +++ b/app/Livewire/MoviePage/Tabs/Cast.php @@ -0,0 +1,37 @@ +movie = Movie::with('castList')->where('id', $this->movie->id)->first(); + + $peopleByDepartment = []; + + foreach ($this->movie->castList as $castMember) { + if (!isset($peopleByDepartment[$castMember->pivot->known_for_department])) { + $peopleByDepartment[$castMember->pivot->known_for_department] = []; + } + $peopleByDepartment[$castMember->pivot->known_for_department][] = [ + Person::find($castMember->pivot->person_id), + $castMember->pivot->character, + ]; + } + $this->peopleByDepartment = $peopleByDepartment; + + } +} diff --git a/app/Livewire/MoviePage/Tabs/Crew.php b/app/Livewire/MoviePage/Tabs/Crew.php new file mode 100644 index 0000000..0a85649 --- /dev/null +++ b/app/Livewire/MoviePage/Tabs/Crew.php @@ -0,0 +1,13 @@ +alternativeTitles = MovieAlternativeTitle::where('movie_id', $this->movie->id)->get(); + $movie = Movie::with('productionCompanies', 'productionCountries')->find($this->movie->id); + + $this->productionCompanies = $movie->productionCompanies; + $this->productionCountries = $movie->productionCountries; + +// $this->productionCompanies = Movie:: + // alt titles + // prod company + // prod country + + } +} diff --git a/app/Livewire/MoviePage/Tabs/Releases.php b/app/Livewire/MoviePage/Tabs/Releases.php new file mode 100644 index 0000000..eea7eb4 --- /dev/null +++ b/app/Livewire/MoviePage/Tabs/Releases.php @@ -0,0 +1,13 @@ + 'date' + ]; + + public function director() + { + return $this->belongsToMany(Person::class, 'movie_cast', 'movie_id', 'person_id') + ->where('movie_cast.known_for_department', 'Directing') + ; + } + public function collections() { return $this->belongsToMany(MovieCollection::class, 'movies_in_collection', 'movie_id', 'collection_id'); @@ -40,7 +51,7 @@ class Movie extends Model public function castList() { - return $this->belongsToMany(Person::class, 'movie_cast', 'movie_id', 'person_id'); + return $this->belongsToMany(Person::class, 'movie_cast', 'movie_id', 'person_id')->withPivot('known_for_department', 'character', 'order'); } public function crewList() @@ -72,4 +83,14 @@ class Movie extends Model { return $this->belongsToMany(Video::class, 'movie_videos', 'movie_id', 'video_id'); } + + public function productionCompanies() + { + return $this->belongsToMany(ProductionCompany::class, 'movie_production_companies', 'movie_id', 'production_company_id'); + } + + public function productionCountries() + { + return $this->belongsToMany(ProductionCountry::class, 'movie_production_countries', 'movie_id', 'production_country_id'); + } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 452e6b6..1bb9a8b 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use Illuminate\Pagination\Paginator; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider @@ -19,6 +20,6 @@ class AppServiceProvider extends ServiceProvider */ public function boot(): void { - // + Paginator::useBootstrapFour(); } } diff --git a/app/Service/MediaProcessing/MovieProcessingService.php b/app/Service/MediaProcessing/MovieProcessingService.php index 7e96da0..be4adaf 100644 --- a/app/Service/MediaProcessing/MovieProcessingService.php +++ b/app/Service/MediaProcessing/MovieProcessingService.php @@ -17,6 +17,8 @@ use App\Models\MovieCollection; use App\Models\MovieRecommendation; use App\Models\MovieSimilar; use App\Models\Person; +use App\Models\ProductionCompany; +use App\Models\ProductionCountry; use App\Models\ReleaseDate; use App\Models\Translation; use App\Models\User; @@ -79,6 +81,14 @@ class MovieProcessingService implements ProcessingInterface $this->processMovieGenres($movieId->id, $tmdbMovie['genres']); } + if (!empty($tmdbMovie['production_companies'])) { + $this->processProductionCompanies($movieId->id, $tmdbMovie['production_companies']); + } + + if (!empty($tmdbMovie['production_countries'])) { + $this->processProductionCountries($movieId->id, $tmdbMovie['production_countries']); + } + $this->removeElementFromRemainingJobs($tmdbMovie['id'], 'Details'); } @@ -112,9 +122,11 @@ class MovieProcessingService implements ProcessingInterface private function getCredits($item) { + echo "Credits for TMDBID ".$item->tmdb_id." \n"; $tmdbCredits = $this->moviesApi->getCredits($item->tmdb_id); if (empty($tmdbCredits)) { + echo "Empty for ".$item->tmdb_id." \n"; return; } @@ -701,10 +713,16 @@ class MovieProcessingService implements ProcessingInterface { $itemToFetchJobs = ItemToFetchJobs::where('tmdb_id', $tmdbId)->first(); - $remainingJobs = $itemToFetchJobs->remaining_jobs; + if (!$itemToFetchJobs) { + return; + } + + $remainingJobs = $itemToFetchJobs->jobs; if (is_string($remainingJobs)) { - $remainingJobs = json_decode($remainingJobs, true); + $remainingJobs = explode(',', $remainingJobs); + } else { + dd($remainingJobs, $tmdbId); } $remainingJobKey = array_search($job, $remainingJobs); @@ -715,13 +733,14 @@ class MovieProcessingService implements ProcessingInterface $itemToFetchJobs->delete(); } - $itemToFetchJobs->remaining_jobs = $remainingJobs; +// $itemToFetchJobs->remaining_jobs = $remainingJobs; + $itemToFetchJobs->jobs = implode(',', $remainingJobs); $itemToFetchJobs->save(); } private function processCast($movie, array $castList) { - if (empty($castList)) { + if (empty($castList) || $movie === null) { return; } @@ -753,15 +772,12 @@ class MovieProcessingService implements ProcessingInterface 'place_of_birth' => $tmdbPerson['place_of_birth'], ]); } - $person = Person::create($personData); } - if ($movie->whereHas('castList', function ($query) use ($person) { - $query->where('tmdb_id', '=', $person->tmdb_id); + if (!$movie->whereHas('castList', function ($query) use ($person) { + $query->where('person_id', '=', $person->id); })->exists()) { - return; - } else { $movie->castList()->attach($person, [ 'known_for_department' => $castPerson['known_for_department'], 'character' => $castPerson['character'], @@ -825,6 +841,56 @@ class MovieProcessingService implements ProcessingInterface } } + private function processProductionCompanies(int $movieId, array $productionCompanies) + { + $movie = Movie::find($movieId); + + foreach ($productionCompanies as $productionCompany) { + $existingProductionCompany = ProductionCompany::where('tmdb_id', $productionCompany['id'])->first(); + + if (!$existingProductionCompany) { + $existingProductionCompany = ProductionCompany::create([ + 'tmdb_id' => $productionCompany['id'], + 'logo_path' => $productionCompany['logo_path'], + 'name' => $productionCompany['name'], + 'origin_country' => $productionCompany['origin_country'], + ]); + } + + if ($movie->whereHas('productionCompanies', function ($query) use ($existingProductionCompany) { + $query->where('production_company_id', '=', $existingProductionCompany->id); + })->exists()) { + return; + } else { + $movie->productionCompanies()->attach($existingProductionCompany); + } + } + } + + private function processProductionCountries(int $movieId, array $productionCountries) + { + $movie = Movie::find($movieId); + + foreach ($productionCountries as $productionCountry) { + $existingProductionCountry = ProductionCountry::where('iso_3166', $productionCountry['iso_3166_1'])->first(); + + if (!$existingProductionCountry) { + $existingProductionCountry = ProductionCountry::create([ + 'iso_3166' => $productionCountry['iso_3166_1'], + 'name' => $productionCountry['name'], + ]); + } + + if ($movie->whereHas('productionCountries', function ($query) use ($existingProductionCountry) { + $query->where('production_country_id', '=', $existingProductionCountry->id); + })->exists()) { + return; + } else { + $movie->productionCountries()->attach($existingProductionCountry); + } + } + } + private function createJob($tmdbId) { $itemToFetch = ItemToFetch::where('tmdb_id', $tmdbId)->where('type', ItemToFetch::TYPE_MOVIE)->first(); diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index e13f4d0..02fc8c6 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -19,6 +19,7 @@ return new class extends Migration $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->boolean('is_dummy_account')->default(0); + $table->string('profile_photo')->nullable(); $table->rememberToken(); $table->timestamps(); }); diff --git a/database/migrations/2024_12_29_153704_create_item_to_fetch_jobs_table.php b/database/migrations/2024_12_29_153704_create_item_to_fetch_jobs_table.php index 9da2c32..9602448 100644 --- a/database/migrations/2024_12_29_153704_create_item_to_fetch_jobs_table.php +++ b/database/migrations/2024_12_29_153704_create_item_to_fetch_jobs_table.php @@ -17,6 +17,7 @@ return new class extends Migration $table->bigInteger('item_id')->nullable(true); $table->string('type')->nullable(false); $table->json('remaining_jobs')->default(null); + $table->set('jobs', \App\Models\ItemToFetchJobs::JOBS)->default(null); $table->timestamps(); }); } diff --git a/database/migrations/2024_12_30_170520_create_media_lists_table.php b/database/migrations/2024_12_30_170520_create_media_lists_table.php index 079d2fd..407154d 100644 --- a/database/migrations/2024_12_30_170520_create_media_lists_table.php +++ b/database/migrations/2024_12_30_170520_create_media_lists_table.php @@ -15,13 +15,16 @@ return new class extends Migration $table->id(); $table->text('description')->nullable(); $table->integer('favorites_count')->default(0); - $table->unsignedBigInteger('tmdb_id'); + $table->unsignedBigInteger('tmdb_id')->nullable(); $table->integer('item_count')->default(0); - $table->string('iso_639_1', 2); - $table->string('iso_3166_1', 2); - $table->string('list_type', 15); + $table->string('iso_639_1', 2)->nullable(); + $table->string('iso_3166_1', 2)->nullable(); + $table->string('list_type', 15)->nullable(); $table->string('name', 550); + $table->string('slug', 550); $table->string('poster_path', 550)->nullable(); + $table->unsignedBigInteger('user_id')->nullable(); + $table->boolean('public')->default(true); $table->timestamps(); }); } diff --git a/database/migrations/2025_01_10_190409_create_movie_production_companies_table.php b/database/migrations/2025_01_10_190409_create_movie_production_companies_table.php new file mode 100644 index 0000000..920a2ab --- /dev/null +++ b/database/migrations/2025_01_10_190409_create_movie_production_companies_table.php @@ -0,0 +1,29 @@ +id(); + $table->unsignedBigInteger('movie_id'); + $table->unsignedBigInteger('production_company_id'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('movie_production_companies'); + } +}; diff --git a/database/migrations/2025_01_10_190417_create_movie_production_countries_table.php b/database/migrations/2025_01_10_190417_create_movie_production_countries_table.php new file mode 100644 index 0000000..ccd7f7f --- /dev/null +++ b/database/migrations/2025_01_10_190417_create_movie_production_countries_table.php @@ -0,0 +1,29 @@ +id(); + $table->unsignedBigInteger('movie_id'); + $table->unsignedBigInteger('production_country_id'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('movie_production_countries'); + } +}; diff --git a/public/img/mask1.png b/public/img/mask1.png new file mode 100644 index 0000000..f70d2c4 Binary files /dev/null and b/public/img/mask1.png differ diff --git a/public/img/mask2.png b/public/img/mask2.png new file mode 100644 index 0000000..135f698 Binary files /dev/null and b/public/img/mask2.png differ diff --git a/public/img/mask3.png b/public/img/mask3.png new file mode 100644 index 0000000..c7de2f1 Binary files /dev/null and b/public/img/mask3.png differ diff --git a/public/img/no_avatar_female.png b/public/img/no_avatar_female.png new file mode 100644 index 0000000..a7542b8 Binary files /dev/null and b/public/img/no_avatar_female.png differ diff --git a/public/img/no_avatar_male.png b/public/img/no_avatar_male.png new file mode 100644 index 0000000..60cba77 Binary files /dev/null and b/public/img/no_avatar_male.png differ diff --git a/resources/sass/app.scss b/resources/sass/app.scss index 1026a0b..d198b7c 100644 --- a/resources/sass/app.scss +++ b/resources/sass/app.scss @@ -6,3 +6,68 @@ // Bootstrap @import 'bootstrap/scss/bootstrap'; + +.dark-mode{ + +} + +body.light-mode{ + background-color: #d9d9d9 !important; +} + +.light-mode{ + header{ + background: white; + padding-right: 1rem; + } + .card{ + margin-bottom: 1rem; + box-shadow: 0px 1px 2px -1px #918f8f; + .card-header{ + background: white; + border-bottom: 1px dashed #d9d9d9; + } + .card-body{} + } + + .movie-card{ + border: 1px solid #c3c4c5; + background: #d9d9d9; + box-shadow: 0px 0px 3px 1px #ccc; + .quick-actions{ + list-style: none; + padding: 2px 0px 7px 0px; + li{ + float: left; + width: 33%; + text-align: center; + } + } + } + .movie-page{ + .card{ + .card-header{ + h1{ + display: inline-block; + font-size: 1.7em; + } + } + } + .tagline{ + text-transform: uppercase; + } + .cast-list{ + .department{ + .persons{ + .person{ + img{ + max-width: 45px; + margin-right: 5px; + } + margin-bottom: 30px; + } + } + } + } + } +} diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index fdf80fd..c9642e6 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -1,25 +1,45 @@ @extends('layouts.app') @section('content') -
+
-
- @livewire(App\Livewire\Homepage\Movies\LatestTrailersComponent::class) - @livewire(App\Livewire\Homepage\Movies\NewMoviesComponent::class) - @livewire(App\Livewire\Homepage\Movies\UpcomingMoviesComponent::class) +
+
-
{{ __('Dashboard') }}
-
- @if (session('status')) - - @endif - - {{ __('You are logged in!') }} +
+ +
+
+ New movies + +
+
+ @livewire(App\Livewire\Homepage\Movies\NewMoviesComponent::class) +
+
+ +
+
+ Upcoming movies + +
+
+ @livewire(App\Livewire\Homepage\Movies\UpcomingMoviesComponent::class) +
+
+ + latest members + +
+
+ right
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 73348a4..5e9beef 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -12,66 +12,18 @@ + + + + @vite(['resources/sass/app.scss', 'resources/js/app.js']) @livewireStyles - +
- + @include('layouts.header')
@yield('content') diff --git a/resources/views/layouts/header.blade.php b/resources/views/layouts/header.blade.php new file mode 100644 index 0000000..1ee5e08 --- /dev/null +++ b/resources/views/layouts/header.blade.php @@ -0,0 +1,50 @@ +
+ + + Simple header + + + +
diff --git a/resources/views/livewire/homepage/movies/new-movies-component.blade.php b/resources/views/livewire/homepage/movies/new-movies-component.blade.php index 379e555..fe34b4a 100644 --- a/resources/views/livewire/homepage/movies/new-movies-component.blade.php +++ b/resources/views/livewire/homepage/movies/new-movies-component.blade.php @@ -1,3 +1,32 @@
- {{-- If you look to others for fulfillment, you will never truly be fulfilled. --}} +
+ @foreach($newMovies as $newMovie) +
+
+ + {{ $newMovie->title }} + + +
+
+ @endforeach +
diff --git a/resources/views/livewire/homepage/movies/upcoming-movies-component.blade.php b/resources/views/livewire/homepage/movies/upcoming-movies-component.blade.php index cdda2ce..5f56fc0 100644 --- a/resources/views/livewire/homepage/movies/upcoming-movies-component.blade.php +++ b/resources/views/livewire/homepage/movies/upcoming-movies-component.blade.php @@ -1,3 +1,32 @@
- {{-- In work, do what you enjoy. --}} +
+ @foreach($upcomingMovies as $upcomingMovie) +
+
+ + {{ $upcomingMovie->title }} + + +
+
+ @endforeach +
diff --git a/resources/views/livewire/movie-page/tabs/cast.blade.php b/resources/views/livewire/movie-page/tabs/cast.blade.php new file mode 100644 index 0000000..dc44d26 --- /dev/null +++ b/resources/views/livewire/movie-page/tabs/cast.blade.php @@ -0,0 +1,31 @@ +
+
+ @foreach($peopleByDepartment as $department => $personInfo) +
+ {{ $department }} +
+
+
+ @foreach($personInfo as [$person, $character]) +
+
+ @if($person->profile_path == null) + @if($person->gender == 2) + + @else + + @endif + @else + + @endif + {{ $person->name }}
+ {{ $character }} +
+
+ @endforeach +
+
+
+ @endforeach +
+
diff --git a/resources/views/livewire/movie-page/tabs/crew.blade.php b/resources/views/livewire/movie-page/tabs/crew.blade.php new file mode 100644 index 0000000..bc7718c --- /dev/null +++ b/resources/views/livewire/movie-page/tabs/crew.blade.php @@ -0,0 +1,3 @@ +
+ {{-- A good traveler has no fixed plans and is not intent upon arriving. --}} +
diff --git a/resources/views/livewire/movie-page/tabs/details.blade.php b/resources/views/livewire/movie-page/tabs/details.blade.php new file mode 100644 index 0000000..0551f06 --- /dev/null +++ b/resources/views/livewire/movie-page/tabs/details.blade.php @@ -0,0 +1,45 @@ +
+
+
+ Studio +
+
+ +
+
+ +
+
+ Country +
+
+ @foreach($productionCountries as $productionCountry) + {{ $productionCountry->name }} + @endforeach +
+
+ +
+
+ Language +
+
+ {{ $movie->original_language }} +
+
+ +
+
+ Alternative titles +
+
+
    + @foreach($alternativeTitles as $alternativeTitle) +
  • + {{ $alternativeTitle->title }} +
  • + @endforeach +
+
+
+
diff --git a/resources/views/livewire/movie-page/tabs/releases.blade.php b/resources/views/livewire/movie-page/tabs/releases.blade.php new file mode 100644 index 0000000..a573dbb --- /dev/null +++ b/resources/views/livewire/movie-page/tabs/releases.blade.php @@ -0,0 +1,3 @@ +
+ {{-- Success is as dangerous as failure. --}} +
diff --git a/resources/views/movie/index.blade.php b/resources/views/movie/index.blade.php new file mode 100644 index 0000000..4852c5c --- /dev/null +++ b/resources/views/movie/index.blade.php @@ -0,0 +1,51 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Movies
+
+
+ @foreach($movies as $movie) +
+
+ + {{ $movie->title }} + + +
+
+ @endforeach +
+
+
+ {{ $movies->links() }} +
+
+
+ menu +
+
+
+
+@endsection diff --git a/resources/views/movie/show.blade.php b/resources/views/movie/show.blade.php new file mode 100644 index 0000000..25961b9 --- /dev/null +++ b/resources/views/movie/show.blade.php @@ -0,0 +1,106 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
+

{{ $movie->title }}

({{ $movie->release_date->format('Y') }}) +
+
+
+
+ {{ $movie->title }} + +
+ @foreach($movie->watchProviders as $watchProvider) + {{ $watchProvider->provider_name }} + @endforeach +
+ + view trailer / + external ids +
+
+ + Directed by + @foreach($movie->director as $director) + {{ $director->name }}@if(!$loop->last), @endif + @endforeach + + +
{{ $movie->tagline }}
+
{{ $movie->overview }}
+
+ + +
+
+ @livewire(App\Livewire\MoviePage\Tabs\Details::class, ['movie' => $movie]) +
+
+ @livewire(App\Livewire\MoviePage\Tabs\Cast::class, ['movie' => $movie]) +
+
...
+
...
+
+
+
+
+
+
+
+
Similar
+
+
+
+
Recommended
+
+
+
+
Write review
+
+
+
+
+
+ +
+
+
+
+@endsection diff --git a/resources/views/profile/lists/create.blade.php b/resources/views/profile/lists/create.blade.php new file mode 100644 index 0000000..8f1da89 --- /dev/null +++ b/resources/views/profile/lists/create.blade.php @@ -0,0 +1,32 @@ +@extends('profile.profile') + +@section('page_content') +
+
+
+
+ @csrf +
+
New list
+
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+
+
+
+
+
+@endsection diff --git a/resources/views/profile/lists/index.blade.php b/resources/views/profile/lists/index.blade.php new file mode 100644 index 0000000..659c1fe --- /dev/null +++ b/resources/views/profile/lists/index.blade.php @@ -0,0 +1,17 @@ +@extends('profile.profile') + +@section('page_content') +
+
+
+ @if($lists->count()) + lists + @else +
+ No lists yet. Start one? +
+ @endif +
+
+
+@endsection diff --git a/resources/views/profile/profile.blade.php b/resources/views/profile/profile.blade.php new file mode 100644 index 0000000..f7e5b82 --- /dev/null +++ b/resources/views/profile/profile.blade.php @@ -0,0 +1,27 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+ avatar/name/etc
+ +
+
+
+
+ @yield('page_content') +@endsection diff --git a/routes/web.php b/routes/web.php index 2b74de3..d12f766 100644 --- a/routes/web.php +++ b/routes/web.php @@ -9,3 +9,17 @@ use Illuminate\Support\Facades\Route; Auth::routes(); Route::get('/', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); + + +Route::prefix('movies')->group(function () { + Route::get('/', [\App\Http\Controllers\MovieController::class, 'index'])->name('movie.index'); + Route::get('/{slug}', [\App\Http\Controllers\MovieController::class, 'show'])->name('movie.show'); +}); + +Route::prefix('profile/{slug}')->group(function () { + Route::get('/lists', [\App\Http\Controllers\MediaListController::class, 'index'])->name('profile.list.index'); + Route::get('/lists/create', [\App\Http\Controllers\MediaListController::class, 'create'])->name('profile.list.create'); + Route::post('/lists/store', [\App\Http\Controllers\MediaListController::class, 'store'])->name('profile.list.store'); + Route::get('/lists/view/{slug}', [\App\Http\Controllers\MediaListController::class, 'show'])->name('profile.list.show'); + +});