add admin gate

This commit is contained in:
TimmensOne
2023-03-31 17:17:09 +02:00
parent 7a95a3d36f
commit 8b7ae81d66
11 changed files with 80 additions and 86 deletions

View File

@@ -28,11 +28,13 @@ class OwnerTransactionController extends Controller
public function edit(OwnerTransaction $owner)
{
$this->authorize('admin-only');
return view('owners.edit', ['owner' => $owner]);
}
public function update(OwnerTransaction $owner, Request $request)
{
$this->authorize('admin-only');
$formFields = $request->validate([
'rz_username' => 'required',
'timestamp_owner_since' => 'required'
@@ -45,6 +47,7 @@ class OwnerTransactionController extends Controller
public function destroy(OwnerTransaction $owner)
{
$this->authorize('admin-only');
$owner->delete();
return back();
}