こっちのほうがマシ

This commit is contained in:
shibafu 2019-10-14 02:24:39 +09:00
parent 99a92c6106
commit 332b6d7dd0

View File

@ -106,9 +106,7 @@ class EjaculationController extends Controller
{
$ejaculation = Ejaculation::findOrFail($id);
if (Auth::user()->cant('edit', $ejaculation)) {
abort(403);
}
$this->authorize('edit', $ejaculation);
return view('ejaculation.edit')->with(compact('ejaculation'));
}
@ -117,9 +115,7 @@ class EjaculationController extends Controller
{
$ejaculation = Ejaculation::findOrFail($id);
if (Auth::user()->cant('edit', $ejaculation)) {
abort(403);
}
$this->authorize('edit', $ejaculation);
$inputs = $request->all();
@ -172,9 +168,7 @@ class EjaculationController extends Controller
{
$ejaculation = Ejaculation::findOrFail($id);
if (Auth::user()->cant('edit', $ejaculation)) {
abort(403);
}
$this->authorize('edit', $ejaculation);
$user = User::findOrFail($ejaculation->user_id);
$ejaculation->tags()->detach();