/**
  * gets deleted journeys
  *
  * @param $filter
  * @return \Illuminate\Database\Eloquent\Collection|static[]
  */
 public function deleted($filter)
 {
     $filter = array_only($filter, ['deleted_at']);
     $query = $this->journey->onlyTrashed()->where(function ($q) use($filter) {
         foreach ($filter as $key => $value) {
             $q->where($key, '>', $value);
         }
     });
     return $query->get(['id', 'deleted_at']);
 }
Exemplo n.º 2
0
 /**
  * @param Journey $journey
  * @return mixed
  */
 public function buildJourney(Journey $journey)
 {
     $journeyArray['id'] = $journey->id;
     $journeyArray['title'] = $journey->title;
     $journeyArray['menu_image_link'] = $journey->menu_image_link;
     $journeyArray['featured_image_link'] = $journey->featured_image_link;
     $journeyArray['small_image_link'] = $journey->small_menu_image_link;
     $journeyArray['sub_categories'] = $journey->subCategories()->get(['id', 'title', 'position'])->toArray();
     $journeyArray['position'] = $journey->position;
     $journeyArray['created_at'] = $journey->created_at->timestamp;
     $journeyArray['updated_at'] = $journey->updated_at->timestamp;
     return $journeyArray;
 }