Updated Controllers

This commit is contained in:
frederikpyt
2020-06-25 12:40:26 +02:00
parent d73e540d09
commit b54bffb7a8
2 changed files with 44 additions and 6 deletions
@@ -69,7 +69,11 @@ class PermissionController extends Controller
*/
public function edit($id)
{
//
$permission = Permission::find($id);
return Response::detect("permissions.edit", [
"permission" => $permission
]);
}
/**
@@ -81,7 +85,19 @@ class PermissionController extends Controller
*/
public function update(Request $request, $id)
{
//
$data = $request->validate([
"time" => "required"
]);
$permission = Permission::find($id);
$permission->update($data);
$permission->save();
return Response::detect("permissions.edit", [
"permission" => $permission
]);
}
/**
@@ -92,6 +108,9 @@ class PermissionController extends Controller
*/
public function destroy($id)
{
//
$permission = Permission::find($id);
$permission->delete();
return Response::detect("permissions.destroy");
}
}