maestriam/samurai

Create awsome themes for your Laravel projects.

v3.1.4 2023-11-11 06:50 UTC

This package is auto-updated.

Last update: 2024-05-11 07:45:25 UTC


README

maestriam/samurai logo

🔴 maestriam/samurai

Create awesome themes for your Laravel projects.


Travis (.com) Scrutinizer Code Quality GitHub Last Commit

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 🍺!