Download the PHP package datlechin/filament-menu-builder without Composer

On this page you can find all versions of the php package datlechin/filament-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 filament-menu-builder

Filament Menu Builder

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Filament Menu Builder

A Filament plugin for building menus with drag-and-drop ordering, nesting, custom links, and dynamic panels.

Requirements

Upgrading

From v0.7.x (Filament v3) to v1.x (Filament v5)

  1. Update your composer.json:

  2. Publish and run the new migration to add the panel, icon, and classes columns:

The upgrade migration checks for existing columns before adding them, so it's safe on fresh installs too.

  1. Re-publish the config file if you published it previously:

Installation

Install via Composer:

Publish and run the migrations:

Optionally, publish the config file:

Or use the install command:

You will need to set up a Filament custom theme

If you don't yet have a custom theme, run the following command:

Next, open up the theme.css file for the custom theme and add the following line:

Usage

Register the plugin in your panel provider:

Locations

Locations define where menus appear in your application:

Menu Panels

Panels provide item sources for menus, either from Eloquent models or static lists.

Model Panel

Implement MenuPanelable on your model:

Then register it:

Static Panel

add() also accepts target, icon, and classes:

Custom Link & Custom Text Panels

The custom link panel is shown by default. The custom text panel (for non-link items like headings) is opt-in:

Custom Fields

Add extra fields to the menu or menu item forms:

Singular methods work too:

Multiple calls are merged, so fields registered from different service providers won't overwrite each other.

Customizing Navigation

Indent / Unindent

Nesting via indent/unindent actions is enabled by default:

Translatable Menus

Built-in multilingual support with no extra packages required. Translatable fields are stored as JSON with locale tabs in the form UI.

Setup

  1. Enable translatable with your locales:

  2. Publish and run the migration to convert columns from string to json:

Existing string data is wrapped in the default locale (en). Edit $defaultLocale in the published migration to change this.

Configuring Translatable Fields

Only MenuItem.title is translatable by default:

Rendering Translated Titles

Use resolveLocale() in Blade to display titles in the current locale:

resolveLocale() returns the translation for app()->getLocale(), falls back to the first available translation, or returns the raw string for non-translatable setups.

Spatie Translatable Compatibility

The JSON format is compatible with Spatie Laravel Translatable. If you add HasTranslations to a custom model, the plugin detects it and defers to Spatie's mutators.

Custom Models

Replace the default models with your own:

Rendering Menus

Retrieve a menu by location. Results are cached and automatically busted on changes:

Render menu items:

Active State Detection

Check if a menu item matches the current URL:

MenuItem Properties

Property Type Description
title string|array The display title (array when translatable)
url ?string The URL (null for text-only items)
target string Link target (_self, _blank, etc.)
icon ?string Icon identifier (e.g. heroicon-o-home)
classes ?string CSS classes for the item
rel ?string Link rel attribute (e.g. nofollow noopener)
type string Panel name / source type (accessor)
children Collection Nested child items

Testing

Changelog

See CHANGELOG for recent changes.

License

MIT License. See LICENSE.md.


All versions of filament-menu-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
filament/filament Version ^5.0
spatie/laravel-package-tools Version ^1.16
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 datlechin/filament-menu-builder contains the following files

Loading the files please wait ...