alphalemon/business-website-theme-bundle
Installation
composer require alphalemon/business-website-theme-bundle
Ensure alphalemon/app-business-* dependencies are installed (they’re auto-resolved via require in composer.json).
Publish Assets
php artisan vendor:publish --provider="AlphaLemon\BusinessWebsiteThemeBundle\BusinessWebsiteThemeBundle" --tag=public
php artisan vendor:publish --provider="AlphaLemon\BusinessWebsiteThemeBundle\BusinessWebsiteThemeBundle" --tag=views
This copies theme assets (CSS/JS) and Blade templates to public/vendor/business-theme/ and resources/views/vendor/business-theme/.
Apply Theme Globally
In config/app.php, add the bundle to the providers array:
AlphaLemon\BusinessWebsiteThemeBundle\BusinessWebsiteThemeBundle::class,
Then extend your base layout (e.g., resources/views/layouts/app.blade.php) to include the theme’s partials:
@extends('business-theme::base')
@section('content')
{{ $slot }}
@endsection
First Use Case: Quick Styling
Override a single component (e.g., header) by creating resources/views/vendor/business-theme/partials/header.blade.php. The theme uses Blade inheritance, so extend/modify as needed.
header, footer, slider). Override them in resources/views/vendor/business-theme/ to customize without forking.
@extends('business-theme::partials/header')
@section('header-nav')
<!-- Custom navigation -->
@endsection
@inject or service containers to pass data to partials:
@inject('menu', 'App\Services\MenuService')
@include('business-theme::partials/menu', ['items' => $menu->getItems()])
public/vendor/business-theme/. Override them by copying files to public/css/ or public/js/ with the same structure.?v={{ filemtime(public_path('vendor/business-theme/css/theme.css')) }} to cache-bust CSS/JS in production.app-business-slider-bundle and app-business-carousel-bundle via their service providers:
$slider = app(\AlphaLemon\AppBusinessSliderBundle\Slider::class);
Render in Blade:
@component('business-theme::partials/slider', ['slides' => $slider->getSlides()])
@endcomponent
php artisan vendor:publish --tag=business-theme-config
Customize in config/business-theme.php (e.g., colors, breakpoints).php artisan vendor:publish --tag=business-theme-translations
Edit resources/lang/en/business-theme.php.Dependency Hell:
dev-master versions of AlphaLemon’s sub-bundles. Pin versions in composer.json to avoid breaking changes:
"repositories": [
{"type": "vcs", "url": "https://github.com/alphalemon/app-business-slider-bundle"}
],
"require": {
"alphalemon/app-business-slider-bundle": "1.0.0"
}
composer update --with-dependencies cautiously.Asset Overrides:
theme.css but forget to clear Laravel’s cache, changes won’t reflect. Run:
php artisan cache:clear
php artisan view:clear
Blade Inheritance Conflicts:
@extends('business-theme::base'). If your layout extends a different template, partials may break. Use @stack/@push for granular control:
@push('styles')
<link rel="stylesheet" href="/custom.css">
@endpush
Slider/Carousel Initialization:
app-business-slider-bundle may require jQuery or specific JS libraries. Ensure they’re loaded in resources/views/layouts/app.blade.php before the theme’s JS:
<script src="https://code.jquery.com/jquery-3.6.min.js"></script>
@include('business-theme::scripts')
Check Published Files:
ls public/vendor/business-theme/
ls resources/views/vendor/business-theme/
Blade Debugging:
config/view.php:
'debug' => env('APP_DEBUG', true),
@dump($variable) in Blade templates to inspect data.Service Container Issues:
@inject fails, bind the service manually in a service provider:
$this->app->bind(\AlphaLemon\AppBusinessSliderBundle\Slider::class, function ($app) {
return new \AlphaLemon\AppBusinessSliderBundle\Slider();
});
Custom Components:
resources/views/vendor/business-theme/partials/ (e.g., custom-card.blade.php) and include it via:
@include('business-theme::partials.custom-card', ['data' => $customData])
Theme Hooks:
@stack for extensibility. Check resources/views/vendor/business-theme/base.blade.php for hooks like @stack('footer-scripts').Dynamic Theme Switching:
ThemeService to support multiple themes:
$this->app->singleton(\AlphaLemon\BusinessWebsiteThemeBundle\Services\ThemeService::class, function ($app) {
return new \App\Services\CustomThemeService();
});
Webpack Mix Integration:
// webpack.mix.js
mix.disableSuccessNotifications();
mix.sass('resources/sass/app.scss', 'public/css');
How can I help you explore Laravel packages today?