/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Novelty::destroy($id);
     return redirect('/admin/novelties');
 }
Exemplo n.º 2
0
 public function noveltiesAndEvents()
 {
     $noveltiesAndEvents = array_merge(Event::get([DB::raw('*, 1 as Event')])->toArray(), Novelty::get([DB::raw('*, 1 as Novelty')])->toArray());
     $datetimeList = array();
     foreach ($noveltiesAndEvents as $key => $value) {
         $datetimeList[$key] = $value['created_at'];
     }
     array_multisort($datetimeList, SORT_DESC, $noveltiesAndEvents);
     return view('home.noveltiesAndEvents', ['noveltiesAndEvents' => $noveltiesAndEvents]);
 }