fanatic/app/Http/Controllers/JoinedController.php

64 lines
1.1 KiB
PHP
Raw Normal View History

2022-04-23 16:25:16 -07:00
<?php
namespace App\Http\Controllers;
use App\Http\Requests\StoreJoinedRequest;
use App\Http\Requests\UpdateJoinedRequest;
use App\Models\Category;
use App\Models\Joined;
class JoinedController extends Controller
{
public function __construct()
{
$this->authorizeResource(Joined::class, 'joined');
}
public function index()
{
2022-04-23 19:31:00 -07:00
$collective = auth_collective();
2022-04-25 19:50:01 -07:00
return view('admin.joined.index');
2022-04-23 16:25:16 -07:00
}
public function create()
{
return view('admin.joined.create')->with([
'categories' => Category::all(),
]);
}
public function store(StoreJoinedRequest $request)
{
$validated = $request->safe()->only([
'categories',
'url',
'subject',
'image',
'approved',
]);
Joined::store($validated);
2022-04-25 19:50:01 -07:00
return redirect()->route('admin.joined.index')->with('success', 'Fanlisting added.');
}
2022-04-23 16:25:16 -07:00
public function show(Joined $joined)
{
//
}
public function edit(Joined $joined)
{
//
}
public function update(UpdateJoinedRequest $request, Joined $joined)
{
//
}
public function destroy(Joined $joined)
{
//
}
}