updated Externallink. Should be able to do crud
This commit is contained in:
@@ -83,15 +83,13 @@ class ExternalLinkController extends Controller
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$data = $request->validate([
|
||||
"name" => "max:255",
|
||||
"link" => "max:255"
|
||||
]);
|
||||
$data = $request->all();
|
||||
|
||||
$id->update($data);
|
||||
$id->save();
|
||||
$link = ExternalLink::find($id);
|
||||
$link->update($data);
|
||||
$link->save();
|
||||
|
||||
return Response::detect("external-links.update");
|
||||
return Response::detect("external-links.update", [ "link" => $link]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,7 +100,8 @@ class ExternalLinkController extends Controller
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$id->delete();
|
||||
return Response::detect("external-links.destroy");
|
||||
$link = ExternalLink::find($id);
|
||||
$link->delete();
|
||||
return redirect()->route("external-links.index");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user