How to modify the header values in adminlte.php in laravel 10?

42 views Asked by At

I want to dynamically modify the values of the admilte.php configuration file

'logo' => 'TutosCODERS',
'logo_img' => 'vendor/adminlte/dist/img/AdminLTELogo.png',
use App\Models\Setting;

$events->listen(BuildingMenu::class, function (BuildingMenu $event) {
    $settings = Setting::first();
    $event->menu->logo(['logo' => $setting->company]);
});

In serviceprovider I tried to execute this code, but it doesn't work, I guess there must be another way, does anyone know how to solve it?

1

There are 1 answers

0
Diego fernandez On

I could find the answer this code works correctly

$events->listen(BuildingMenu::class, function (BuildingMenu $event) {

  $settings = Setting::first();

  config(['adminlte.logo' => $settings->company]);
  config(['adminlte.logo_img' => Storage::url($settings->logo)]);

});