Esempio n. 1
0
 public function index(Advertisement $advertModel)
 {
     $b1_baner = Baner::where('type', 'b1')->get();
     $b2_baner = Baner::where('type', 'b2')->get();
     $latest_advert = $advertModel->get_last_advert();
     $popular_advert = $advertModel->get_popular_advert();
     $categoryModel = new Category();
     $categories = $categoryModel->get_order_count();
     return view('site.front')->with('b1_baner', $b1_baner)->with('b2_baner', $b2_baner)->with('latest_advert', $latest_advert)->with('popular_advert', $popular_advert)->with('categories', $categories);
 }
 public function create(Advertisement $advertModel)
 {
     $categoryModel = new Category();
     $categories = $categoryModel->get_order_count();
     $categories_select = Category::lists(Config::get('app.locale') . '_title', 'id');
     $validtor = JsValidator::make($this->rules);
     $b1_baner = Baner::where('type', 'b1')->get();
     $popular_advert = $advertModel->get_popular_advert();
     $title = trans('message.new_advert');
     return view('site.advertisements.create')->with('categories', $categories)->with('categories_select', $categories_select)->with('validator', $validtor)->with('title', $title)->with('b1_baner', $b1_baner)->with('popular_advert', $popular_advert);
 }