maestriam / samurai
Create awsome themes for your Laravel projects.
Requires
- laravel/framework: >=10.0
- maestriam/filesystem: >=0.0.1
Requires (Dev)
- orchestra/testbench: >=6.17
- phpunit/phpunit: >=9.5
- squizlabs/php_codesniffer: >=3.7.1
README
🔴 maestriam/samurai
Create awesome themes for your Laravel projects.
Maestriam/Samurai is a simple package for creating and managing themes for Laravel applications, using component and include functions of Laravel Blade.
You can publishing your themes and install-it in another projects using composer.
Requirements
- Laravel 8.*^
Installation
Install via composer
composer require maestriam/samurai
Publish samurai.php into config folder
php artisan vendor:publish --tag=Samurai
Getting Started
To create a new theme
php artisan samurai:make-init
Creating a new theme with default configs
php artisan samurai:make-theme my-vendor/my-theme
Creating a new include
php artisan samurai:make-include my-include my-vendor/my-theme
The theme
param is optional. If not informed, assume the default theme automatically.
To edit your include file, go to themes/my-vendor/my-theme/src/my-include/my-include-include.blade.php
Creating a new component
php artisan samurai:make-component my-component my-vendor/my-theme
The theme
param is optional. If not informed, assume the default theme automatically.
To edit your include file, go to themes/my-vendor/my-theme/src/my-component/my-component-component.blade.php
Using theme in your project
To publish your assets and define your theme as current:
php artisan samurai:use my-vendor/my-theme
Using components into blade files
To use component in your view.blade.php, use:
@myComponent() My content inside @endmyComponent()
Now, also, you can use Blade UI notation too:
<x-my-component> My content inside </x-my-component>
Using includes into blade files
To use include in your view.blade.php, use:
@myInclude()
Now, also, you can use Blade UI notation too:
<x-my-include />
Load assets into theme files
To import any file into your theme(like css, js, imgs), use directive @public.
E.g:
<script src="@public('js/index.js')" />
Created by Giuliano Sampaio with ❤️, ☕ and 🍺!