You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
647 B
28 lines
647 B
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Domain;
|
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
|
|
class MenuController extends Controller
|
|
{
|
|
public function index($domain = null)
|
|
{
|
|
$domain = Domain::query()->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
|
|
]);
|
|
}
|
|
}
|
|
|