fanatic/app/Http/Controllers/JoinedController.php
2022-04-23 16:25:16 -07:00

62 lines
1.1 KiB
PHP

<?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()
{
return view('admin.joined.index');
}
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);
return redirect()->route('joined.index')->with('success', 'Fanlisting added.');
}
public function show(Joined $joined)
{
//
}
public function edit(Joined $joined)
{
//
}
public function update(UpdateJoinedRequest $request, Joined $joined)
{
//
}
public function destroy(Joined $joined)
{
//
}
}