Download the PHP package atthakasem/laravel-json-menu without Composer
On this page you can find all versions of the php package atthakasem/laravel-json-menu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download atthakasem/laravel-json-menu
More information about atthakasem/laravel-json-menu
Files in atthakasem/laravel-json-menu
Package laravel-json-menu
Short Description A simple Laravel menu builder using JSON
License MIT
Homepage https://github.com/atthakasem/laravel-json-menu
Informations about the package laravel-json-menu
Laravel Json Menu
This package is currently under development. Use at your own risk!
Installation
Via Composer
Usage
-
Create a menu file in
resouces/menus/main.json
containing an array of pages. A page can be represented by a string or an object. - Use the menu in your blade file via
@menu()
or@menu('main')
. The resulting output will be:
Options
These JSON properties can be used. When using object notation, only "name" is mandatory.
Property | Description | Value type | Default |
---|---|---|---|
name | Displayed name of the menu item | string | N/A |
url | Relative URL to desired page | string | Illuminate\Support\Str::slug($name) |
route | Named route to desired page | string | null |
external | Open link in a new tab | boolean | false |
children | Subpages of the menu item | array | [] |
class | CSS classes of the menu item | string | null |
Changing the path to the JSON menu files
will create a config file config/laravel-json-menu.php
where you can change the path.
Change log
Please see the changelog for more information on what has changed recently.
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
- Thitithan Atthakasem
- All Contributors
License
Please see the license file for more information.