cwsps154/theme-maker

Tool creating components for theme making

v1.0.6 2023-03-30 19:23 UTC

This package is auto-updated.

Last update: 2024-05-30 00:54:05 UTC


README

GitHub issues GitHub stars GitHub license

Tool creating components for theme making

Installation

Using Composer

composer require cwsps154/theme-maker

Documentation

Usage

You can create new theme components and layout by using this command

php artisan make:theme

It will ask some queries

  Please enter the name of the theme: \\Type your theme name
  > MyTheme
  What are the components you want to build your theme? (Multiple options are separate by comma) [All]:
  [0 ] Head
  [1 ] Header
  [2 ] Logo
  [3 ] Navbar
  [4 ] Sidebar
  [5 ] Account
  [6 ] Search
  [7 ] Notification
  [8 ] Foot
  [9 ] Footer
  [10] All
  > 10
  Do you want any additional components (yes/no) [yes]:
  > yes
  Please enter the name of the components (Multiple values are separate by comma):
  > Profile,Test
   0/12 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
   INFO  Component [app/View/Components/MyTheme/Head.php] created successfully.  

  1/12 [▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░]   8%
   INFO  Component [app/View/Components/MyTheme/Header.php] created successfully.  

  2/12 [▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░]  16%
   INFO  Component [app/View/Components/MyTheme/Logo.php] created successfully.  

  3/12 [▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░]  25%
   INFO  Component [app/View/Components/MyTheme/Navbar.php] created successfully.  

  4/12 [▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░]  33%
   INFO  Component [app/View/Components/MyTheme/Sidebar.php] created successfully.  

  5/12 [▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░]  41%
   INFO  Component [app/View/Components/MyTheme/Account.php] created successfully.  

  6/12 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░]  50%
   INFO  Component [app/View/Components/MyTheme/Search.php] created successfully.  

  7/12 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░]  58%
   INFO  Component [app/View/Components/MyTheme/Notification.php] created successfully.  

  8/12 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░]  66%
   INFO  Component [app/View/Components/MyTheme/Foot.php] created successfully.  

  9/12 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░]  75%
   INFO  Component [app/View/Components/MyTheme/Footer.php] created successfully.  

 10/12 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░]  83%
   INFO  Component [app/View/Components/MyTheme/Profile.php] created successfully.  

 11/12 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░]  91%
   INFO  Component [app/View/Components/MyTheme/Test.php] created successfully.  

 12/12 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

File : /var/www/html/TestApp/resources/views/layout/mytheme/mytheme_layout.blade.php created
Theme successfully created

The mytheme_layout.blade.php

   <!DOCTYPE html>
    <html lang='{{ str_replace('_', '-', app()->getLocale()) }}'>
        <x-mytheme.head>
            @stack("styles")
        </x-mytheme.head>
    <body>
        <x-mytheme.header/>
        <x-mytheme.navbar/>
        <x-mytheme.sidebar/>
        @yield("content")
        <x-mytheme.footer/>
        <x-mytheme.foot>
            @stack("scripts")
        </x-mytheme.foot>
    </body>
    </html>

To publishing the config file

 php artisan vendor:publish --tag=config

Create a new ENV variable LAYOUT and set your layout name Or you can update this config file directly

return [
    'layout' => env('LAYOUT')
];

Use the layout in blade pages

@extends(config('theme.layout'))
@push('styles')

  \\Custom CSS
  
@endpush
@section('content')

  \\Blade Contant
  
@endsection
@push('scripts')

  \\Custom Scripts
  
@endpush

Change Log

  • v1.0.0 - Initial Version
  • v1.0.1 - Package dependency changed, config file introduced and bug fixes
  • v1.0.2 - Bugfixes
  • v1.0.3 - Bugfixes
  • v1.0.4 - Bugfixes
  • v1.0.5 - ReadMe Updated

Author

License

MIT