progress
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\ShowPage\Tabs;
|
||||
|
||||
use App\Models\Person;
|
||||
use App\Models\Show;
|
||||
use Livewire\Component;
|
||||
|
||||
class Cast extends Component
|
||||
{
|
||||
public $show;
|
||||
public $peopleByDepartment;
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.show-page.tabs.cast');
|
||||
}
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->show = Show::with('castList')->where('id', $this->show->id)->first();
|
||||
|
||||
$peopleByDepartment = [];
|
||||
|
||||
foreach ($this->show->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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\ShowPage\Tabs;
|
||||
|
||||
use App\Models\Person;
|
||||
use App\Models\Show;
|
||||
use Livewire\Component;
|
||||
|
||||
class Crew extends Component
|
||||
{
|
||||
public $show;
|
||||
public $peopleByDepartment;
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.show-page.tabs.crew');
|
||||
}
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->show = Show::with('castList')->where('id', $this->show->id)->first();
|
||||
|
||||
$peopleByDepartment = [];
|
||||
|
||||
foreach ($this->show->crewList as $castMember) {
|
||||
|
||||
if (!isset($peopleByDepartment[$castMember->pivot->department])) {
|
||||
$peopleByDepartment[$castMember->pivot->department] = [];
|
||||
}
|
||||
$peopleByDepartment[$castMember->pivot->department][] = [
|
||||
Person::find($castMember->pivot->person_id),
|
||||
$castMember->pivot->job,
|
||||
];
|
||||
}
|
||||
$this->peopleByDepartment = $peopleByDepartment;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\ShowPage\Tabs;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class Details extends Component
|
||||
{
|
||||
public $show;
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.show-page.tabs.details');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\ShowPage\Tabs;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class Releases extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.show-page.tabs.releases');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user