2022-04-25 19:50:01 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Livewire\Admin;
|
|
|
|
|
|
|
|
use App\Models\Joined;
|
|
|
|
use Livewire\Component;
|
|
|
|
use Livewire\WithPagination;
|
|
|
|
|
|
|
|
class ListFanlistings extends Component
|
|
|
|
{
|
|
|
|
use WithPagination;
|
|
|
|
|
|
|
|
public string $class;
|
|
|
|
|
|
|
|
public function render()
|
|
|
|
{
|
|
|
|
if ($this->class == 'joined') {
|
|
|
|
$fanlistings = auth_collective()->joined()->paginate(8);
|
2022-04-26 11:15:27 -07:00
|
|
|
} elseif ($this->class == 'owned') {
|
|
|
|
// TODO: add owned class
|
2022-04-25 19:50:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return view('livewire.admin.list-fanlistings', [
|
|
|
|
'fanlistings' => $fanlistings,
|
|
|
|
]);
|
|
|
|
}
|
2022-04-26 11:15:27 -07:00
|
|
|
|
|
|
|
public function approve(Joined $fl)
|
|
|
|
{
|
|
|
|
if ($fl->approved == false) {
|
|
|
|
$fl->approved = true;
|
|
|
|
$fl->save();
|
|
|
|
}
|
|
|
|
}
|
2022-04-25 19:50:01 -07:00
|
|
|
}
|