Exemplo n.º 1
0
 /**
  * Display the specified resource.
  */
 public function show($id)
 {
     $search = \Veer\Models\Search::find($id);
     if (!$search) {
         return $this->index();
     }
     $search->increment('times');
     return $this->results($this->showSearch->getSearchResultsWithSite(app('veer')->siteId, $search->q, get_paginator_and_sorting()));
 }
Exemplo n.º 2
0
 public function attach($users_id, $id)
 {
     if (!empty($users_id) && !empty($id)) {
         $search = \Veer\Models\Search::find($id);
         if (is_object($search)) {
             $search->users()->attach($users_id);
             event('veer.message.center', trans('veeradmin.search.new'));
         }
     }
     return $this;
 }
Exemplo n.º 3
0
 /**
  * delete Search
  * @param int $id
  */
 protected function deleteSearch($id)
 {
     $s = \Veer\Models\Search::find($id);
     if (is_object($s)) {
         $s->users()->detach();
         $s->delete();
         return true;
     }
     return false;
 }