caffeinated / menus

:pushpin: Menu generator package for the Laravel framework
https://caffeinatedpackages.com
132 stars 59 forks source link

PHP 7.4: Trying to access array offset on value of type null at caffeinated/menus/src/Menu.php:66 #114

Closed vedmant closed 4 years ago

vedmant commented 4 years ago

Hi, I have an error on PHP 7.4 Trying to access array offset on value of type null at caffeinated/menus/src/Menu.php:66

Looks like this line makes problem:

return $options['default'];

When $options returns null

tormjens commented 4 years ago

If you bump your version to ^4.0 it should work. This was added in #113

piperone commented 4 years ago

If you're on Laravel 5.x, you're out of luck. Menus 4.x requires illuminate/support ^6.0, i.e. Laravel 6. The PR that fixes this issue should ideally be pulled in at the 3.x-branch of menus as well.