getHost(); $channel = Channel::with('prefixes') ->where('hostname', $hostname) ->first(); if (! $channel) { abort(404); } app()->instance(Channel::class, $channel); view()->share('channel', $channel); view()->addNamespace('theme', array_values(array_filter([ resource_path('views/themes/' . $channel->template), resource_path('views/themes/default'), ], 'is_dir'))); return $next($request); } }