Download the PHP package marcha/filament-tree without Composer

On this page you can find all versions of the php package marcha/filament-tree. 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-tree

Filament Tree

Filament Tree is a plugin for Filament Admin that creates a model management page with a heritage tree structure view. This plugin can be used to create menus and more.

Installation

To install the package, run the following command:

Note: Add plugin Blade files to your custom theme tailwind.config.js for dark mode.

To set up your own custom theme, you can visit the official instruction page on the Filament website.

Add the plugin's views to your tailwind.config.js file.

Then, publish the config file using:

You can set your preferred options by adding the following code to your config/filament-tree.php file:

Usage

Prepare the database and model

To use Filament Tree, follow these table structure conventions:

Tip: The parent_id field must always default to -1!!!

This plugin provides a convenient method called treeColumns() that you can use to add the required columns for the tree structure to your table more easily. Here's an example:

This will automatically add the required columns for the tree structure to your table.

The above table structure contains three required fields: parent_id, order, title, and other fields do not have any requirements.

The corresponding model is app/Models/ProductCategory.php:

The field names of the three fields parent_id, order, and title in the table structure can also be modified:

Widget

Filament provides a powerful feature that allows you to display widgets inside pages, below the header and above the footer. This can be useful for adding additional functionality to your resource pages.

To create a Tree Widget and apply it to a resource page, you can follow these steps:

1. Creating a Filament Resource Page

To create a resources page, run the following command:

2. Create Tree Widget

Prepare the filament-tree Widget and show it in Resource page.

Now you can see the Widget in Filament Folder

3. Displaying a widget on a resource page

Once you have created the widget, modify the getHeaderWidgets() or getFooterWidgets() methods of the resource page to show the tree view:

Resources

Filament allows you to create a custom pages for resources, you also can create a tree page that display hierarchical data.

Create a Page

To create a tree page for resource, you can use:

Register a Page to the resource

You must register the tree page to a route in the static getPages() methods of your resource. For example:

Actions

Define the available "actions" for the tree page using the getActions() and getTreeActions() methods of your page class.

The getActions() method defines actions that are displayed next to the page's heading:

The getTreeActions() method defines the actions that are displayed for each record in the tree. For example:

Alternatively, you can use the hasDeleteAction(), hasEditAction(), and hasViewAction() methods to customize each action individually.

Record ICON

To customize the prefix icon for each record in a tree page, you can use the getTreeRecordIcon() method in your tree page class. This method should return a string that represents the name of the icon you want to use for the record. For example:

Node collapsed state

You can customize a collapsed state of the node. If you would like to show your tree initially collapsed you can use:

Record Title

To customize the ttile for each record in a tree page, you can use the getTreeRecordTitle() method in your tree page class. This method should return a string that represents the name of the icon you want to use for the record. For example:

Pages

This plugin enables you to create tree pages in the admin panel. To create a tree page for a model, use the make:filament-tree-page command. For example, to create a tree page for the ProductCategory model, you can run:

Create a Page

Tip: Note that you should make sure the model contains the required columns or already uses the ModelTree trait

Actions, Widgets and Icon for each record

Once you've created the tree page, you can customize the available actions, widgets, and icon for each record. You can use the same methods as for resource pages. See the Resource Page for more information on how to customize actions, widgets, and icons.

Translation

Suggest used with Spatie Translatable (https://filamentphp.com/plugins/filament-spatie-translatable) Plugin.

  1. Ensure your model already apply translatable setup. (Refence on https://spatie.be/docs/laravel-translatable/v6/installation-setup)

  2. You need to add the necessary trait and LocaleSwitcher header action to your tree page:

Publishing Views

To publish the views, use:

Publishing Translations

To publish the translations, use:

Testing

To run the tests, run:

Changelog

See the CHANGELOG for more information on what has changed recently.

Contributing

See CONTRIBUTING for details.

Security Vulnerabilities

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

Filament Tree is open-sourced software licensed under the MIT license.


All versions of filament-tree with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
filament/filament Version ^3.0
filament/support Version ^3.0
spatie/laravel-package-tools Version ^1.15.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 marcha/filament-tree contains the following files

Loading the files please wait ....