Skip to content

Commit 1c1f27f

Browse files
committed
Refactoring views, facades stracture; comprehensive mvc; add database seeder; add README
1 parent 1318645 commit 1c1f27f

24 files changed

+674
-245
lines changed

README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Laravel Menu Architect
2+
[![Total Downloads](https://poser.pugx.org/rc1021/laravel-menu-architect/downloads.svg)](https://packagist.org/packages/rc1021/laravel-menu-architect)
3+
[![License](https://poser.pugx.org/rc1021/laravel-menu-architect/license.svg)](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+
![Laravel Menu Architect](https://raw.githubusercontent.com/rc1021/laravel-menu-architect/master/screenshot.png)
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.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "rc1021/laravel-menu-architect",
33
"description": "backend menu builder",
44
"require": {
5-
"spatie/laravel-menu": "3.4.0",
6-
"illuminate/support": "^6.0"
5+
"php": ">=7.0",
6+
"illuminate/support": "^5.5|^6|^7"
77
},
88
"license": "MIT",
99
"authors": [

config/menu_architect.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
/*
66
|--------------------------------------------------------------------------
7-
| Ajax Build ?
7+
| tips ?
88
|--------------------------------------------------------------------------
99
|
10-
| View edit by ajax if the value is true.
10+
| view tips: how to use;
1111
|
1212
*/
1313

14-
'ajax' => false,
14+
'tips' => true,
1515

1616
/*
1717
|--------------------------------------------------------------------------
@@ -29,7 +29,8 @@
2929
| Output display
3030
|--------------------------------------------------------------------------
3131
|
32-
| Display html by 'nestable', 'bootstrap', 'array', 'json', 'adminlte-sidebar'
32+
| Display html by 'nestable', 'adminlte', 'bootstrap',
33+
| or data by '_array', '_json'
3334
|
3435
*/
3536

@@ -198,12 +199,6 @@
198199
'name' => 'Laravel Menu Architect Main Assets',
199200
'active' => true,
200201
'files' => [
201-
// Boostrap Submenu
202-
[
203-
'type' => 'css',
204-
'asset' => true,
205-
'location' => 'vendor/menu_architect/css/boostrap-submenu.css',
206-
],
207202
// Nestable2 Draggable Handles
208203
[
209204
'type' => 'css',

0 commit comments

Comments
 (0)