Example #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(NoticiaCreateRequest $request)
 {
     if ($request->ajax()) {
         Noticia::create($request->all());
         return response()->json(["message" => "creado"]);
     }
 }
Example #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(NoticiaCreateRequest $request)
 {
     if ($request->ajax()) {
         $id_site = \Session::get('id_site');
         $new = Noticia::create($request->all());
         $noticia = Noticia::find($new->id);
         $noticia->id_site = $id_site;
         $noticia->save();
         return response()->json(["message" => "creado"]);
     }
 }