/** * Display a listing of the resource. * * @return Response */ public function index() { $cats = Cat::all(); $bizs = Biz::all(); $states = State::all(); return view('admin.index', compact('biz', 'states', 'featured'))->withCats($cats); }
public function welcome() { $cats = Cat::all(); $products = Product::where('active', 1)->get(); if ($user = Sentinel::check()) { $num = $user->baskets()->where('order_id', 0)->count(); } else { $num = 0; } return view('welcome', compact('cats', 'products', 'num')); }
public function listCat() { $cats = Cat::all(); return view('admin.cat.listCat')->with('cats', $cats); }
<th>ID</th> <th width="300">Заголовок</th> <th>Категорія</th> <th>Місцезнаходження</th> <th>Статус</th> <th>Ціна</th> <th>Користувач</th> <th>Дата аукціону</th> <th>Дата додавання</th> <th></th> </tr> </thead> <tbody> <?php $cats = \App\Cat::all(); ?> @foreach($auctions as $auction) <tr> <td>{{ $auction->id }}</td> <td>{{ $auction->title }}</td> <td>{{ $cats->find($auction->category)->name }}</td> <td>{{ trans('theme.regions.'. $auction->region) }}@if($auction->city), {{ $auction->city }} @endif</td> <td> @if($auction->free_sale) <span @if($auction->status == 0)style="color: red" @endif>{{ trans('theme.statuses_free.'. $auction->status) }}</span> @else <span @if($auction->status == 0)style="color: red" @endif>{{ trans('theme.statuses.'. $auction->status) }}</span> @endif </td>
/** * Display a listing of the resource. * * @return Response */ public function index() { $cats = Cat::all(); return view('admin.cat.index')->withCats($cats); }
public function profile($userId) { $cats = Cat::all(); $user = \App\User::findOrFail($userId); $bizs = $user->favours; $favourites = \DB::table('favourites')->whereUserId(\Auth::user()->id)->lists('biz_id'); //$bizs = Biz::orderBy('created_at', 'desc')->paginate(6); $stateList = State::lists('name', 'name'); $lgaList = Lga::lists('name', 'id'); $catList = Cat::lists('name', 'name'); $featured = Biz::whereFeatured('YES')->paginate(3); $recent = Biz::orderBy('created_at', 'desc')->paginate(2); // dd($featured); return view('pages.user-profile', compact('stateList', 'lgaList', 'catList', 'cats', 'bizs', 'user', 'favourites', 'featured', 'recent', 'totalBiz', 'totalCat')); }
/** * Show all cats * * Get a JSON representation of all the cats * * @Get('/') */ public function index() { return $this->collection(Cat::all(), new CatTransformer()); }
// Event::fire(new TestEvent("rjb")); // return "hello rjb"; // $headers = ['rjb' => 'alex']; // // return redirect('about', 301, $headers); return View::make('home'); }); Route::get('rjb/{age}', ['middleware' => 'App\\Http\\Middleware\\OldMiddleware', function ($age) { return "rjb -> " . $age; }]); Route::get('jeff', 'WelcomeController@sendJson'); Route::get('about', function () { return View::make('about')->with(['number_of_cats' => 999]); }); Route::get('cats', function () { $cats = Cat::all(); return View::make('cats.index', compact('cats')); // ->with('cats', $cats); }); Route::get('cats/breeds/{name}', function ($name) { $breed = Breed::whereName($name)->with('cats')->first(); return View::make('cats.index')->with('breed', $breed)->with('cats', $breed->cats); }); //Route::get('cats/{id}', function($id) { // $cat = Cat::find($id); // // return View::make('cats.single') // ->with('cat', $cat); //}); // // The following route: cats/{cat} leverages the use of model binding to
/** * Display a listing of the resource. * * @return Response */ public function index() { $cats = Cat::all(); $totalCat = Cat::count(); return view('admin.cat.index', compact('cats', 'totalCat')); }