mirbaagheri/metronic

a library for using metronic theme in laravel 5

1.0.84 2019-05-05 15:55 UTC

This package is auto-updated.

Last update: 2024-09-06 06:57:57 UTC


README

Attention: This package is beta. I'll complete this package in future.

Installation instructions :

  1. composer require mirbaagheri/metronic

  2. Add bellow line to config/app.php in section providers:

Mirbaagheri\Metronic\Laravel\MetronicServiceProvider::class
  1. Add bellow lines to config/app.php in section aliases:
'Metronic'      => Mirbaagheri\Metronic\Laravel\Facades\Metronic::class,
'Sidebar'       => Mirbaagheri\Metronic\Laravel\Facades\Sidebar::class,
'PageHeader'    => Mirbaagheri\Metronic\Laravel\Facades\Header::class,

Publish config :

Use bellow command in your terminal to publish configuration file:

php artisan vendor:publish --provider="Mirbaagheri\Metronic\Laravel\MetronicServiceProvider"

Sample usage :

Set default config:

Metronic::config([
            'minify'        => false,
            'pageDirection' => 'rtl',
            'layoutName'    => 'layout4',
            'layoutTheme'   => 'layout|darkblue'
        ]);

Load core plugins:

Metronic::loadLoad('plugin',['jquery','js.cookie','jquery-slimscroll','jquery.blockui']);

Load global mandatory styles:

Metronic::loadLoad('plugin',['font-awesome','simple-line-icons','bootstrap']);

Load page level plugins:

Metronic::loadLoad('plugin',['bootstrap-select','fuelux','bootstrap-touchspin']);

Load theme global styles:

Metronic::loadLoad('style',['components-md-rtl','plugins-md-rtl']);

Load theme global scripts:

Metronic::loadLoad('script',['app','components-bootstrap-select']);

load default dependency:

Metronic::defaultsLoad();

Load your custom css or js file:

Metronic::loadLoad('custom',[
            'head'  => [
                'link'  => [
                    0 =>[
                        'href' => [
                            'custom',
                            'css',
                            'your-custom1.css'
                        ],
                        'rel'   => 'stylesheet',
                        'type'  => 'text/css'
                    ],
                    1 =>[
                        'href' => [
                            'plugins',
                            'custom',
                            'your-custom2.css'
                        ],
                        'rel'   => 'stylesheet',
                        'type'  => 'text/css'
                    ]
                ],
                'script' => [
                    0 => [
                        'src' => [
                            'js',
                            'custom1.js'
                        ],
                        'type' => 'text/javascript'
                    ]
                ],
            ],
            'body'  => [
                'script'=> [
                    0 => [
                        'src' => [
                            'plugins',
                            'custom-js',
                            'customize1.js'
                        ],
                        'type' => 'text/javascript'
                    ],
                    1 => [
                        'src' => [
                            'js',
                            'your script.js'
                        ],
                        'type' => 'text/javascript'
                    ]
                ]
            ]
        ]);