public function show($id) { $infoConfig = InfoConfig::first()->toArray(); $object = Model::find($id); if ($object) { return view('info.promo', ['object' => $object, 'type' => 'vacancies', 'title' => LANG . '_title', 'text' => LANG . '_text', 'requirements' => LANG . '_requirements', 'infoConfig' => $infoConfig]); } return redirect('info-center'); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $object = Model::find($id); if ($object) { $object->delete(); } return redirect()->back(); }