|
| 1 | +# Laravel Menu Architect |
| 2 | +[](https://packagist.org/packages/rc1021/laravel-menu-architect) |
| 3 | +[](https://packagist.org/packages/rc1021/laravel-menu-architect) |
| 4 | + |
| 5 | + |
| 6 | +A quick and easy way to build menus in [Laravel](http://laravel.com/) |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +## Installation |
| 11 | + |
| 12 | +```bash |
| 13 | +composer require rc1021/laravel-menu-architect |
| 14 | +``` |
| 15 | + |
| 16 | +If you are in Laravel 5.5 you won't need to edit your `config/app.php`, if you are in a previous version of Laravel, please do the following: |
| 17 | + |
| 18 | +Append Laravel Menu service provider to `providers` array in `config/app.php`. |
| 19 | + |
| 20 | +```php |
| 21 | +'providers' => [ |
| 22 | + |
| 23 | + /* |
| 24 | + * Laravel Framework Service Providers... |
| 25 | + */ |
| 26 | + Illuminate\Foundation\Providers\ArtisanServiceProvider::class, |
| 27 | + Illuminate\Auth\AuthServiceProvider::class, |
| 28 | + Illuminate\Broadcasting\BroadcastServiceProvider::class, |
| 29 | + |
| 30 | + ... |
| 31 | + |
| 32 | + Rc1021\LaravelMenuArchitect\LaravelMenuArchitectServiceProvider::class, |
| 33 | + |
| 34 | + ... |
| 35 | + |
| 36 | +], |
| 37 | +``` |
| 38 | + |
| 39 | +At the end of `config/app.php` add `'MenuArct' => Rc1021\LaravelMenuArchitect\Facades\MenuArct::class` to the `$aliases` array: |
| 40 | + |
| 41 | +```php |
| 42 | +'aliases' => [ |
| 43 | + |
| 44 | + 'App' => Illuminate\Support\Facades\App::class, |
| 45 | + 'Artisan' => Illuminate\Support\Facades\Artisan::class, |
| 46 | + ... |
| 47 | + 'MenuArct' => Rc1021\LaravelMenuArchitect\Facades\MenuArct::class, |
| 48 | + |
| 49 | +], |
| 50 | +``` |
| 51 | + |
| 52 | +This registers the package with Laravel and creates an alias called `MenuArct`. |
| 53 | + |
| 54 | + |
| 55 | +To use your own settings, publish config. |
| 56 | +```bash |
| 57 | +php artisan vendor:publish --provider="Rc1021\\LaravelMenuArchitect\\LaravelMenuArchitectServiceProvider" |
| 58 | +``` |
| 59 | + |
| 60 | +## Getting Started |
| 61 | + |
| 62 | +Start up laravel server |
| 63 | + |
| 64 | +```bash |
| 65 | +php artisan serve |
| 66 | +``` |
| 67 | + |
| 68 | +and open [http://127.0.0.1:8000/menu_arct](http://127.0.0.1:8000/menu_arct) get start. |
| 69 | + |
| 70 | +## Demo data (seeder) |
| 71 | + |
| 72 | +You can seeder the database first. |
| 73 | +```bash |
| 74 | +php artisan db:seed --class=MenuArchitectSeeder |
| 75 | +``` |
| 76 | + |
| 77 | +Finally, open a view and add: |
| 78 | +```php |
| 79 | +{!! menu_arct('admin') !!} |
| 80 | +``` |
| 81 | +Your menu will be created and displayed on the page. |
| 82 | + |
| 83 | +## If You Need Help |
| 84 | + |
| 85 | +Please submit all issues and questions using GitHub issues and I will try to help you. |
| 86 | + |
| 87 | + |
| 88 | +## Contributing |
| 89 | + |
| 90 | +Please feel free to submit pull requests if you can improve or add any features. |
| 91 | + |
| 92 | +## Credits |
| 93 | + |
| 94 | +* [許益銘 rc1021](https://github.com/rc1021) |
| 95 | +* [All Contributors](https://github.com/rc1021/laravel-menu-architect/graphs/contributors) |
| 96 | + |
| 97 | +## License |
| 98 | + |
| 99 | +*Laravel Menu Architect* is free software distributed under the terms of the MIT license. |
0 commit comments