예제 #1
0
 public function getSearch()
 {
     $query = Input::get('query');
     $v = Validator::make(['id' => $query], ['id' => 'max:200']);
     if ($v->fails()) {
         abort(400);
     }
     dd($this->category->findBy('name', '%' . $query . '%', 'like'));
     return view('category.index', ['root_category' => Product::where('id', (int) $id)->get()->first(), 'categoruies' => $this->category->findBy('name', $query, 'LIKE')]);
 }
 /**
  * Bootstrap any necessary services.
  *
  * @return void
  */
 public function boot()
 {
     User::observe(new \App\Mircurius\Observers\UserObserver(new EloquentUserRepository()));
     Product::observe(new \App\Mircurius\Observers\ProductObserver());
 }