/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { if (autText::where('id_autor', '=', $id)->first() != null) { Session::flash('message-error', 'No se puede eliminar el autor, existe un texto en el sistema que lo esta utilizando'); return Redirect::to('/autor/' . $id . '/edit'); } autor::destroy($id); Session::flash('message', 'autor eliminado correctamente'); return Redirect::to('/autor'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if (!empty($this->texto->path)) { \Storage::delete($this->texto->path); } autText::where('id_texto', $id)->delete(); textos::destroy($id); Session::flash('message', 'Texto eliminado correctamente'); return Redirect::to('/texto'); }