1. Go to this page and download the library: Download softlandtech/theme-builder library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
softlandtech / theme-builder example snippets
use SoftLand\ThemeBuilder\Facades\ThemeBuilder;
// 1) Storefront: render the active theme's home blocks.
Route::get('/', [\SoftLand\ThemeBuilder\Http\Controllers\StorefrontController::class, 'home']);
// 2) Editor + autosave/publish/picker endpoints. Wrap in YOUR auth/tenant middleware.
Route::middleware(['web'])->group(function () {
ThemeBuilder::routes();
});
namespace App\Models;
use SoftLand\ThemeBuilder\Contracts\Store as ThemeBuilderStore;
class Store extends Model implements ThemeBuilderStore
{
public function getThemeBuilderTenantKey(): int|string|null { return $this->getKey(); }
public function getThemeBuilderStoreName(): ?string { return $this->name; }
public function getThemeBuilderCurrencyCode(): string { return $this->currency ?? 'SAR'; }
public function getThemeBuilderLocale(): string { return $this->default_locale ?? 'ar'; }
}