/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { foreach (servicePic::where('service_id', $id)->get() as $s) { unlink($s->pic); $s->delete(); } foreach (eventServices::where('service_id', $id)->get() as $s) { $s->delete(); } service::find($id)->delete(); return redirect('/'); }