Lara-App Theme Developer Guide
-
Quick Start
Build your first theme in under 15 minutes with a step-by-step guide.
-
Template Setup
Set up a local theme directory or build an installable theme package.
-
Theme Architecture
Understand directory layout, the skeleton theme, and Blade layout sections.
-
Helper Functions
Reference all available global PHP helpers: assets, products, menus, and more.
-
Pages Reference
Full variable and template reference for every supported page.
What is this?
This documentation describes how to create a frontend theme for the lara-app Laravel e-commerce platform. If you're familiar with Blade templating (Laravel's default template engine), you have everything you need to get started.
The application uses a multi-tenant, theme-based architecture. Each site can have its own theme, and themes can be swapped without touching the backend PHP code. As a theme developer, your job is to create the HTML structure and consume data through the provided helper functions.
Compared to the Legacy Laminas/Twig Theme
If you previously developed for the legacy Laminas/Twig platform, here's the paradigm shift:
| Aspect | Legacy (Twig) | New (Blade) |
|---|---|---|
| File extension | .twig |
.blade.php |
| Echo variable | {{ variable }} |
{{ $variable }} |
| Raw/unescaped | {{ variable \| raw }} |
{!! $variable !!} |
| Loop | {% for item in items %} |
@foreach($items as $item) |
| Conditional | {% if condition %} |
@if($condition) |
| Template include | {% include 'partial/header.twig' %} |
@include('partial.header') |
| Template extend | {% extends 'layout.twig' %} |
@extends('layout.layout') |
| Section define | {% block content %} |
@section('content') |
Blade is PHP
Unlike Twig, Blade templates allow raw PHP using the @php directive. This means you can call any helper function from theme_helpers.php directly in your template.
Architecture Overview
{themeName}/
├── config/ ← Theme metadata, settings, and values
├── layout/ ← Main layout (layout.blade.php)
├── template/ ← Page templates (index.blade.php, product_details.blade.php, etc.)
├── partial/ ← Reusable sub-components (productslider.blade.php, etc.)
└── public/ ← Browser-facing CSS, JavaScript, images, and fonts
The layout file is the outermost wrapper. All page templates @extend it, and inject content into named @section slots.
See Template Setup before creating a theme so its metadata, assets, version, and installable ZIP use the format expected by the application.