updated controller

This commit is contained in:
Vedde
2020-06-25 09:15:21 +02:00
parent ccddf4d2f3
commit 27b4f48af2
2 changed files with 16 additions and 6 deletions
@@ -70,7 +70,8 @@ class ExternalLinkController extends Controller
*/
public function edit($id)
{
//
$link = ExternalLink::find($id);
return Response::detect("external-links.edit", ["externallink" => $link]);
}
/**
@@ -82,7 +83,15 @@ class ExternalLinkController extends Controller
*/
public function update(Request $request, $id)
{
//
$data = $request->validate([
"name" => "",
"link" => ""
]);
$id->update($data);
$id->save();
return Response::detect("external-links.update");
}
/**
@@ -93,6 +102,7 @@ class ExternalLinkController extends Controller
*/
public function destroy($id)
{
//
$id->delete();
return Response::detect("external-links.destroy");
}
}