Add Menu Template functionality: Created MenuTemplate resource with CRUD pages, schemas, and table configuration. Implemented localization for menu template fields and integrated menu rendering capabilities. Enhanced TemplatePreviewController to support menu templates and updated dynamic template documentation accordingly.

This commit is contained in:
Ümit Tunç
2025-11-03 15:43:47 -03:00
parent 9629652d0a
commit 4a2a66c55c
18 changed files with 768 additions and 1 deletions
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use App\Models\HeaderTemplate;
use App\Models\FooterTemplate;
use App\Models\SectionTemplate;
use App\Models\MenuTemplate;
use App\Services\TemplatePreviewService;
use App\Services\TemplateService;
use Illuminate\Http\Request;
@@ -23,7 +24,7 @@ class TemplatePreviewController extends Controller
$type = $request->input('type', 'section'); // header, footer, section
// Validate type
if (!in_array($type, ['header', 'footer', 'section'])) {
if (!in_array($type, ['header', 'footer', 'section', 'menu'])) {
$type = 'section';
}
@@ -70,6 +71,7 @@ class TemplatePreviewController extends Controller
'header' => HeaderTemplate::find($id),
'footer' => FooterTemplate::find($id),
'section' => SectionTemplate::find($id),
'menu' => MenuTemplate::find($id),
default => null,
};
}