with([ 'user', 'user.categories', 'user.categories.foods' ])->where('domain', $domain ?? '192.168.1.101')->first(); $template = $domain->user->template; if(!$domain){ throw new NotFoundHttpException(); } return view("food-menu/{$template}/theme", [ 'domain' => $domain ]); } }