kregel/menu

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (v1.1.1) of this package.

This will automatically build/ generate a menu based upon your configuration file.

v1.1.1 2016-09-02 02:55 UTC

This package is auto-updated.

Last update: 2020-01-29 03:34:11 UTC


README

downloads

What is it?

This is an menu generator build with Laravel and Bootstrap in mind

Demo

You can see a demo on my website

Set up

  1. composer require kregel/menu or add "kregel/menu": "dev-master" to your composer.json file.
  2. Register the service provider with your config/app.php file.
 'providers' => [
   ...,
   Kregel\Menu\MenuServiceProvider::class,
   ...,
 ]
  1. Publish our config
php artisan vendor:publish --provider="Kregel\Menu\MenuServiceProvider"
  1. Which ever blade file is storing your current nav set up just add ONE line of code to replace your whole menu system and where ever you start your menu, just replace it with what's below.
@include('menu::main.bootstrap')

Other frameworks will be supported at a later time, the Materialize framework is being worked on right now.

Configuration

So, now you have your menu system set up, it's recommended that you edit your configuration. How? You might ask. There's so much and it's soooo confusing that I don't know where to begin!

Well... Let me help you out here.

Brand Name

There are quite a few things that you should really change. Something like the brand.name, should be changed to your brand's name. Whether that is your business's name, your product/projects name, or your name. You don't need to use font-awesome(but you totally should).

Theme

I usually leave the theme alone; however, you can change it to what ever you want.

Items

The array within the "items" section is every element that will be located on every page whether logged in or logged out.

Login

This is enabled by default. Those elements located withing the "sign-in" section. These elements will be shown ONLY when the end user is NOT logged in.

Within the "sign-out" section, the default is actually a Dropdown menu. The title of it is "My Account", there is a divider header entitled "settings", then there is an element entitiled settings, the empty single quotes is a way for the default frameworks to differentiate between when to use the divider header and just a divider.

Custom Css Frameworks!

While it is described more below, the best way to access this is by just newing up your framework handler. That can be done by just making an anonymous function and having it return a new class.

YOU DON'T HAVE MY FRAMEWORK HOW DARE YO-

Just stop right there... Build your own framework handler!

How?

Just look below...

How can I build my own framework for this menu system? All you need to do is (somewhere) make a class that has the same methods as the class below.

class MyFramework extends Kregel\Menu\Interfaces\AbstractMenu{
    public function add(Array $options)
    {
		// This will add each actual menu item to the menu variable
    }
    public function addDropdown($dropdown_name, $elements)
    {
		// This will build a dropdown ($elements should be an arary 
    }
    public function devour()
    {
		// Should return the menu item
    }
    public function buildMenu($menu)
    {
		// This should build the actual menu. For the config file I have
		// And you would call it like 
		// $menu->using('myframework')->buildMenu(['Home'=>'/']->devour()
    }
    public function config()
    {
    	// This would be how you handle your framework pulling form the config file.
    }
}

Okay... Now what...?

Well... Now you can customize this how you want. I would recommend looking at the default bootstrap handler, and if you have any questions send me an email! :)