Search code examples
phplaravelcomposer-phpadminltevendor

AdminLTE : Config in the vendor?


On a current web project I'm working on, I have the adminlte preloader that is constantly at the top of the page and just does a white bar, I decided to remove it but couldn't find anywhere, except in a config file that is located in the vendor (/vendor/jeroennoten/laravel-adminlte/config/adminlte.php) where I can disable the preloader with a boolean, isn't there a way to do that outside of the vendor? And why is there a config file in the vendor in the first place knowing it's going to be replaced at the next composer update ?

For details here's the part of the config file in the vendor that is about the preloader :

    /*
    |--------------------------------------------------------------------------
    | Preloader Animation
    |--------------------------------------------------------------------------
    |
    | Here you can change the preloader animation configuration. Currently, two
    | modes are supported: 'fullscreen' for a fullscreen preloader animation
    | and 'cwrapper' to attach the preloader animation into the content-wrapper
    | element and avoid overlapping it with the sidebars and the top navbar.
    |
    | For detailed instructions you can look the preloader section here:
    | https://github.com/jeroennoten/Laravel-AdminLTE/wiki/Basic-Configuration
    |
    */

    'preloader' => [
        'enabled' => true,
        'mode' => 'fullscreen',
        'img' => [
            'path' => 'vendor/adminlte/dist/img/AdminLTELogo.png',
            'alt' => 'AdminLTE Preloader Image',
            'effect' => 'animation__shake',
            'width' => 60,
            'height' => 60,
        ],
    ],

Sorry if this may sound stupid, I'm pretty new with adminlte and laravel.


Solution

  • The documentation for this library at https://github.com/jeroennoten/Laravel-AdminLTE/wiki/Installation mentions to run php artisan adminlte:install to publish the config file to config/adminlte.php directory.

    In https://github.com/jeroennoten/Laravel-AdminLTE/wiki/Basic-Configuration, it also mentions that you can run it with the --only=config option to publish just the config file.

    php artisan adminlte:install --only=config
    

    If that doesn't work, try running

    php artisan vendor:publish
    

    It should show a list of names/service providers. Find the name/service provider for this library and publish it.

    If all of that doesn't work, try copying the adminlte.php config file to your config directory, laravel should then read from your config directory instead of the vendor directory