lavary / laravel-menu

A quick way to create menus in Laravel
MIT License
1.16k stars 233 forks source link

Add interface for add and some other method #265

Open Grummfy opened 4 years ago

Grummfy commented 4 years ago

Hello, in the builder, the item and probably other place we have a add method that take the same parameters. Why not add an interface with it. This allow some global method custom made easily.

dustingraham commented 4 years ago

Is this something you're interested in taking a pass at adding?

Grummfy commented 4 years ago

it's just an helper for the syntax, here it is a small example

    private function addRoute($menu, string $route, string $label): Item
    {
        return $menu->add(trans($label), ['route' => $route]);
    }

here the "$menu" could have been typed