Exemplo n.º 1
0
 public function __construct(Request $request)
 {
     $segments = $request->segments();
     $locales = LaravelLocalization::getSupportedLanguagesKeys();
     $non_locale_route = '';
     $lang = App::getLocale();
     foreach ($segments as $segment) {
         if (!in_array($segment, $locales)) {
             $non_locale_route .= '/' . $segment;
         }
     }
     DEFINED('NON_LOCALE_ROUTE') or DEFINE('NON_LOCALE_ROUTE', trim($non_locale_route, '/'));
     DEFINED('LANG') or DEFINE('LANG', $lang);
     $categories[1] = ProductCategory::getByBrand(5);
     $categories[2] = ProductCategory::getByBrand(6);
     $categories[3] = ProductCategory::getByBrand(7);
     $this->categories = $categories;
 }
 public function getByBrand($brand_id)
 {
     return $this->responseAnswer(false, Model::getByBrand($brand_id));
 }