Laravel-adminlte: Undefined variable: adminlte

Created on 3 Aug 2020  路  2Comments  路  Source: jeroennoten/Laravel-AdminLTE

| Question | Answer
| ----------------------- | -----------------------
| Issue or Enhancement | Enhancement
| Laravel Version | 7.22.4
| Project Version | 3.4

Description
I created a copy of "page.blade.php" called "pagefull.blade.php" with no changes in the file content.

But i am receiving the error "Undefined variable: adminlte" when trying to extend the new file.

Does anyone know how to fix this ?

Images
image
image
image

Most helpful comment

Hi @gdias1992 in that case you will need to register a new view composer. Try editing the file: vendor/jeroennoten/laravel-adminlte/src/AdminLteServiceProvider.php and change method registerViewComposers() like this:

/**
 * Register the package's view composers.
 *
 * @return void
 */
private function registerViewComposers(Factory $view)
{
    $view->composer('adminlte::page', AdminLteComposer::class);

    // Add next new line...
    $view->composer('adminlte::pagefull', AdminLteComposer::class);
}

Tell me if that works...

All 2 comments

Hi @gdias1992 in that case you will need to register a new view composer. Try editing the file: vendor/jeroennoten/laravel-adminlte/src/AdminLteServiceProvider.php and change method registerViewComposers() like this:

/**
 * Register the package's view composers.
 *
 * @return void
 */
private function registerViewComposers(Factory $view)
{
    $view->composer('adminlte::page', AdminLteComposer::class);

    // Add next new line...
    $view->composer('adminlte::pagefull', AdminLteComposer::class);
}

Tell me if that works...

@Shidersz It's working now! Thank you!

Was this page helpful?
0 / 5 - 0 ratings