diff --git a/app/Http/Controllers/JoinedController.php b/app/Http/Controllers/JoinedController.php index 05cf561..be3274e 100644 --- a/app/Http/Controllers/JoinedController.php +++ b/app/Http/Controllers/JoinedController.php @@ -41,12 +41,6 @@ public function store(StoreJoinedRequest $request) return redirect()->route('admin.joined.index')->with('success', 'Fanlisting added.'); } - public function approve(Joined $joined) - { - $joined->approve(); - return redirect()->route('admin.joined.index')->with('success', 'Fanlisting approved.'); - } - public function show(Joined $joined) { // diff --git a/app/Http/Livewire/Admin/ListFanlistings.php b/app/Http/Livewire/Admin/ListFanlistings.php index 49f8b47..a3f71a6 100644 --- a/app/Http/Livewire/Admin/ListFanlistings.php +++ b/app/Http/Livewire/Admin/ListFanlistings.php @@ -3,7 +3,6 @@ namespace App\Http\Livewire\Admin; use App\Models\Joined; -use Illuminate\Pagination\LengthAwarePaginator; use Livewire\Component; use Livewire\WithPagination; @@ -17,12 +16,20 @@ public function render() { if ($this->class == 'joined') { $fanlistings = auth_collective()->joined()->paginate(8); - } else if ($this->class == 'owned') { - // + } elseif ($this->class == 'owned') { + // TODO: add owned class } return view('livewire.admin.list-fanlistings', [ 'fanlistings' => $fanlistings, ]); } + + public function approve(Joined $fl) + { + if ($fl->approved == false) { + $fl->approved = true; + $fl->save(); + } + } } diff --git a/resources/views/admin/layout.blade.php b/resources/views/admin/layout.blade.php index ef9c804..b5f89b3 100644 --- a/resources/views/admin/layout.blade.php +++ b/resources/views/admin/layout.blade.php @@ -41,15 +41,15 @@ @if (session()->has('success')) -
{{ session()->get('success') }}
+{{ session()->get('success') }}
@endif @if (session()->has('error')) -{{ session()->get('error') }}
+{{ session()->get('error') }}
@endif @if (session()->has('warning')) -{{ session()->get('warning') }}
+{{ session()->get('warning') }}
@endif @yield('content') @@ -58,5 +58,9 @@