Пример #1
0
 public function category($category)
 {
     //$venues = \Venues::on('sqlite')->whereCategory(\Input::get('category'))->get();
     $venues = Venues::where('category', $category)->get();
     //dd($venues);
     return View::make('venues', ['venues' => $venues]);
 }
Пример #2
0
 public function index()
 {
     if (Auth::check()) {
         $bands = Bands::all();
         $advertisers = Advertisers::all();
         $writers = Writers::all();
         $venues = Venues::all();
         return View::make('admin.index', ['bands' => $bands, 'advertisers' => $advertisers, 'writers' => $writers, 'venues' => $venues]);
     } else {
         return Redirect::to('/admin/login');
     }
 }
Пример #3
0
 public function remove($id)
 {
     try {
         //dd($id);
         //$venue = Venues::where('id', '=', $id)->get();
         $venue = Venues::find($id);
         $venue->delete();
         return View::make('admin.venues.delete', ['status' => 'successful', 'venue' => $venue, 'venues' => Venues::all(), 'id' => $id]);
     } catch (Illuminate\Database\Eloquent\ModelNotFoundException $e) {
         return View::make('admin.venues.delete', ['status' => 'unsuccessful', 'venue' => $venue, 'id' => $id]);
     }
 }