Laravel-adminlte: Undefined index: icon

Created on 29 Nov 2016  路  17Comments  路  Source: jeroennoten/Laravel-AdminLTE

After install

ErrorException in 9dcf61b8761ef39af9d88755df9f76b70b292f8d.php line 8:
Undefined index: icon (View: a/p/p/p/a/t/h/resources\views\vendor\adminlte\partials\menu-item.blade.php) (View: a/p/p/p/a/t/h/resources\views\vendor\adminlte\partials\menu-item.blade.php) (View: a/p/p/p/a/t/h/resources\views\vendor\adminlte\partials\menu-item.blade.php) (View: a/p/p/p/a/t/h/resources\views\vendor\adminlte\partials\menu-item.blade.php)

Most helpful comment

I know this is an old thread, but I had to change the "or" to "??"... I'm running Laravel 5.7 on PHP 7

All 17 comments

Same issue here. Looks to be an issue with the latest update breaking font awesome icons on the menu. I got around it (for now) by making sure all non-header menu items explicitly had an icon set (even though they still dont show up).

any work around for override this ?

As said above, if you don't mind the icons not showing, just explicitly set icons for all menu items, eg:
'menu' => [ [ 'text' => 'Users', 'url' => 'admin/user', 'icon' => '', ], [ 'text' => 'Competitions', 'url' => 'admin/comp', 'icon' => '', ], ],

Hmm strange. The template has {{ $item['icon'] or 'circle-o' }}, which is a Blade shorthand for {{ isset($item['icon']) ? $item['icon'] : 'circle-o' }} (see https://laravel.com/docs/5.3/blade#displaying-data), so I am wondering why the error shows up. I will look into this somewhere next week.

I think it may be related to a Laravel package update.

I cannot reproduce this error. Can you try to run:

php artisan vendor:publish --provider="JeroenNoten\LaravelAdminLte\ServiceProvider" --tag=assets --force

I'll close this for now. Let me know if it needs to be reopened.

I know this is an old thread, but I had to change the "or" to "??"... I'm running Laravel 5.7 on PHP 7

I had the same issue here, and solved with solution propose by @robertheath

I have the same problem here. I'm using php 7.2.9 and Laravel 5.7. I tried the solution proposed by @fryiee but it did not work for me. I'm newbie, is my first instalation, and I can do something wrong.

Same problem here with 5.7

This is addressed in #244

fixed with #244

...\storage\framework\views\a2...php
on line [ 8 ]
Changing 'or' to '??' for laravel 5.7
_8 ... php echo e($item['icon'] ?? 'circle-o')..._

same issue with laravel 5.7

@Rodrigusto solutions works for me

solutions works for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Basili0 picture Basili0  路  5Comments

iHeartBard picture iHeartBard  路  4Comments

claytongf picture claytongf  路  5Comments

niltonssjr picture niltonssjr  路  4Comments

Shidersz picture Shidersz  路  4Comments