fanatic/app/Http/Controllers/CollectiveController.php

55 lines
1 KiB
PHP
Raw Normal View History

2022-04-23 11:39:07 -07:00
<?php
namespace App\Http\Controllers;
use App\Http\Requests\StoreCollectiveRequest;
use App\Http\Requests\UpdateCollectiveRequest;
use App\Models\Collective;
class CollectiveController extends Controller
{
public function dashboard()
{
return view('admin.dashboard');
}
public function create()
{
return view('admin.install');
}
public function store(StoreCollectiveRequest $request)
{
$validated = $request->safe()->only([
'title',
'name',
'email',
'password',
]);
$collective = Collective::store($validated);
auth()->login($collective);
return redirect()->route('dashboard')->with('success', 'Fanatic installed!');
}
public function show(Collective $collective)
{
//
}
public function edit(Collective $collective)
{
//
}
public function update(UpdateCollectiveRequest $request, Collective $collective)
{
//
}
public function destroy(Collective $collective)
{
//
}
}