Installation Add the package via Composer:
composer require chapter-three-company/c3-bundle
Publish the default configuration:
php artisan vendor:publish --provider="CHAPTERTHREECOMPANY\C3Bundle\C3BundleServiceProvider" --tag="config"
Environment Configuration
Define Twig parameters in .env:
STISLA_TITLE="My Admin Dashboard"
STISLA_SITE_NAME="My Company"
STISLA_VERSION="1.0.0"
STISLA_MENU_LONG="MyApp"
STISLA_MENU_SHORT="MA"
STISLA_GA_TRACKING_ID="UA-XXXXXX"
First Use Case
Extend your base layout in resources/views/layouts/app.blade.php:
{% extends 'c3-bundle::page.html' %}
{% block title %}{{ app.config.stisla.title }}{% endblock %}
Theming & Layouts
resources/views/vendor/c3-bundle/.{% block content %}
{{ include('my_custom_content') }}
{% endblock %}
Dynamic Menus
Leverage the menu_long/menu_short config for consistent branding:
<div class="brand-logo">
{{ app.config.stisla.menu_long }}
</div>
Turbo Mode Enable Turbo for SPA-like navigation:
// config/c3-bundle.php
'turbo' => env('STISLA_TURBO', false),
Then use Turbo links in Twig:
<a href="{{ path('dashboard') }}" data-turbo="true">Dashboard</a>
Google Analytics Inject tracking ID dynamically:
{% if app.config.stisla.ga_tracking_id %}
<script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments)}; gtag('js', new Date()); gtag('config', '{{ app.config.stisla.ga_tracking_id }}');</script>
{% endif %}
turbo config to conditionally load Turbo-compatible JS:
if (process.env.MIX_STISLA_TURBO) {
require('turbo-drive');
}
Blade::render() in Twig templates:
{{ Blade::render('partials._header') }}
Configuration Overrides
.env values not updating.php artisan config:clear
Template Caching
config/view.php or use:
php artisan view:clear
Turbo Conflicts
data-turbo="false" on non-Turbo links.dd(config('stisla')); // Check loaded values
config/view.php:
'debug' => env('APP_DEBUG', true),
Custom Templates
page.html for full control:
cp vendor/chapter-three-company/c3-bundle/resources/views/page.html resources/views/vendor/c3-bundle/page.html
Dynamic Config Extend the config class:
// app/Providers/C3ServiceProvider.php
use CHAPTERTHREECOMPANY\C3Bundle\Config\StislaConfig;
class C3ServiceProvider extends ServiceProvider {
public function boot() {
$this->app->singleton(StislaConfig::class, function () {
return new class extends StislaConfig {
public function getCustomValue() {
return 'dynamic_value';
}
};
});
}
}
Asset Management Publish assets for customization:
php artisan vendor:publish --tag="public"
Then override in public/vendor/c3-bundle/.
How can I help you explore Laravel packages today?