Пример #1
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $categorias = CategoriaNoticia::lists('nombre_categoria', 'id');
     return view('noticias.create', ['categorias' => $categorias]);
 }
Пример #2
0
 public function categoriaNoticias()
 {
     $categorias = CategoriaNoticia::with('noticia')->get();
     return response()->json($categorias);
 }