Example #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if ($this->user->subscription_expired_at) {
         if ($this->user->subscription_expired_at->diffInDays(null, false) >= 0) {
             return redirect()->route('user.subscription.index');
         }
     }
     if ($this->user->hasOnlyOneFreeAdtype()) {
         return redirect()->route('user.ad.create', $this->user->adtypes->first());
     }
     $page = (object) $this->pageService->show('user.adtype.index', true);
     return view('__templates::' . $page->templateFile, $page->data);
 }