Download the PHP package javaabu/menu-builder without Composer

On this page you can find all versions of the php package javaabu/menu-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package menu-builder

Laravel Menu Builder

Latest Version on Packagist Total Downloads

This Laravel package makes it breeze to set up and render menus for different parts of your application. The Menu Builder class is highly configurable, allowing you to define the structure and behavior of your menus in a flexible and maintainable way.

Installation

You can install the package via composer:

Usage

Defining a Menu

Each menu is defined by a class that extends Javaabu\MenuBuilder\Menu\Menu. Those classes must define menuItems() method.

Here is an example menu class:

The $id is an optional property you can set to give an id to the menu. The $icon_prefix is an optional property you can set to give a prefix to icons of all the menu items. The $guard is an optional property you can set to specify the guard used to find the current user. The menuItems method returns an array that defines the items in the menu. Each item is created with the MenuItem::make method. The MenuItem::make method accepts the label for the menu item and returns a MenuItem instance.

You may use any of the following methods to set the link of the menu item. The link would be generated using the last called method:

When the link is set using any of the above methods, the active state will be determined automatically. If you want to customize the active state logic, you can use the following methods:

You may use any of the following methods to set the conditions to determine whether to show the item to the current user:

If you call both permissions and can, then the conditions defined in both methods should be met to show the item

You may use the following methods to further configure the menu item:

Displaying a Menu

After you have defined a menu class, you can display it in a view file by calling the links() method.

Here's a sample code to display a menu:

When displaying the menu, you can use the following methods to further customize how the menu is displayed: iconPrefix - sets the icon prefix used by all the menu items guard - sets the guard used to find the current user id - sets the css id of the menu

Changing the CSS Framework

By default, the menu would be rendered as a Bootstrap 5 menu. The package support Bootstrap 5 and Material Admin 2.6 CSS frameworks. To change the framework used, you can call any of the following methods:

You can also change the default framework by calling the MenuBuilder's useBootstrap5 and useMaterialAdmin26 methods within the boot method of your App\Providers\AppServiceProvider class.

Customizing the rendered menu

The links method will accept your own view if you want to render the menu on your own.

The view will receive the following date:

The following methods will be available for the menu items:

If you want to customize the default views, you can publish the package views and customize them. To publish the view files to resources/views/vendor/menu-builder, run:

This comprehensive Laravel package streamlines the process of creating custom menus while providing flexibility for your unique needs.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of menu-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^9.0 || ^10.0 || ^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package javaabu/menu-builder contains the following files

Loading the files please wait ....