GithubHelp home page GithubHelp logo

phpcollective / menumaker Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 2.0 210 KB

Menu Maker is a nice and convenient way to manage your menu items for the Laravel framework.

License: MIT License

PHP 100.00%
laravel menu-generator menu-item menu-management

menumaker's Introduction

Laravel Menu Maker

Latest Version on Packagist Software License Quality Score Total Downloads

Menu Maker is a nice and convenient way to manage your menu items for the Laravel framework. You can create multi level menu items for different sections of your site like Left Menu, Top Menu etc with it. It will provide the authorization of menu as well.

Structure

Directory structure of the project are as follows:

config/
public/        
resources/        
src/

Install

You may use Composer to install the package into your Laravel project:

$ composer require phpcollective/menumaker
Laravel 5.5+:

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

PhpCollective\MenuMaker\MenuServiceProvider::class,

After installing Menu Maker, publish its assets using the menu:install Artisan command. It will publish all assets and configurations as well as run migrations related to menu maker.

$ php artisan menu:install

Add MenuMaker trait in User model.

<?php

namespace App;

use PhpCollective\MenuMaker\MenuMaker;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable, MenuMaker;
    
    ...
}

At this point you're all good to go. See Uses for how to get started with the package.

Usage

Accessing Package

By default all routes are prefixed with /menu-maker.

  • Users: /menu-maker/users
  • Roles: /menu-maker/roles
  • Sections: /menu-maker/sections
  • Menus: /menu-maker/menus
  • Permissions: /menu-maker/permissions

You can change this prefix by editing path in config/menu.php.

'path' => 'menu-maker'

Middleware

Menu Maker uses menu for middleware.

<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::middleware('menu')->group(function () {
    // Your routes will goes here
});

Credits

License

Laravel Menu Maker is open-sourced software licensed under the MIT license.

menumaker's People

Contributors

al-amin-chayan avatar alaminchayan avatar sohelamin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.