/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $editorial = Editorial::find($id);
     $editorial->delete();
     Flash::success('La editorial ' . $editorial->descripcion . ' ha sido eliminada con exito!');
     return redirect()->route('admin.editoriales.index');
 }
예제 #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $editoriales = Editorial::orderBy('descripcion', 'ASC')->lists('descripcion', 'id');
     $generos = Genero::orderBy('descripcion', 'ASC')->lists('descripcion', 'id');
     $idiomas = Idioma::orderBy('descripcion', 'ASC')->lists('descripcion', 'id');
     $formatos = Formato::orderBy('descripcion', 'ASC')->lists('descripcion', 'id');
     $libro = Libro::find($id);
     return view('admin.libros.edit')->with('editoriales', $editoriales)->with('generos', $generos)->with('idiomas', $idiomas)->with('formatos', $formatos)->with('libro', $libro);
 }