Download the PHP package guava/filament-nested-resources without Composer

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

Filament Nested Resources

Latest Version on Packagist Total Downloads

Filament Nested Resources allows you to create nested resources of any depth. This is useful for resources which are too complex for relation manager, yet don't make sense as a standalone resource.

First public release is here.

Showcase

Screenshot 1 Screenshot 2

Support us

Your support is key to the continual advancement of our plugin. We appreciate every user who has contributed to our journey so far.

While our plugin is available for all to use, if you are utilizing it for commercial purposes and believe it adds significant value to your business, we kindly ask you to consider supporting us through GitHub Sponsors. This sponsorship will assist us in continuous development and maintenance to keep our plugin robust and up-to-date. Any amount you contribute will greatly help towards reaching our goals. Join us in making this plugin even better and driving further innovation.

Installation

You can install the package via composer:

Usage

Throughout the documentation I refer to root nested resource and child nested resources. The only difference is that the Root is the first resource in the relationship tree.

In the examples: ArtistResource > AlbumResource > SongResource

Artist would be the root resource, the other would be child resources.

Supported relationships

Currently we support one-to-many and polymoprhic one-to-many relationships only.

Demo Project

To better understand how nested resources work and to troubleshoot any issues you might encounter, we've created a demo laravel project: https://github.com/GuavaCZ/filament-nested-resources-demo

Quick start

In order to set up Nested Resources, you need to do these steps:

  1. On the resources (root and all child resources) you want to nest, add the NestedResource trait. You will be required to implement the getAncestor method. For the root resource, return null, for all child resources implement it according to the documentation below.
  2. On every page of the resources from the 1st step, add the NestedPage trait.
  3. Create a RelationManager (Filament documentation) or a RelationPage (Filament documentation) to bind the Resources together. Add the NestedRelationManager trait to either of them.

Let's imagine the scenario from the Showcase screenshots, where we have this schema:

  1. Artist Model.
  2. Album Model (Belongs to Artist).
  3. Song Model (Belongs to Album).

First we create ArtistResource:

Next, we create the AlbumResource:

In every page of our ArtistResource and AlbumResource, we add the NestedPage trait:

Now let`s create a new page which will be used to create child records. Let's create CreateArtistAlbum page inside ArtistResource/Pages:

Don`t forget to register the page in the getPages method.

And finally we create either the AlbumsRelationManager or if you prefer to use a Relation Page then create a ManageArtistAlbums page. We just need to add the NestedRelationManager trait here.

For RelationManager:

For RelationPage:

Optionally, we recommend deleting the index and create pages from your child NestedResources (in this case AlbumResource).

Customizing the breadcrumbs

Every resource can control their own part of the breadcrumb, which by default consists of an index breadcrumb and a detail breadcrumb.

The index breadcrumb typically redirects to the index page.

The detail breadcrumb typically redirects to the detail (edit or view) and by default, will display the route key (ID if not configured otherwise) of the record.

You can override the label via the getBreadcrumbRecordLabel method of a NestedResource:

Or you can override the resource`s breadcrumb part completely, by overriding the getBreadcrumbs method on the resource:

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of filament-nested-resources with dependencies

PHP Build Version
Package Version
Requires filament/filament Version ^3.0.0
spatie/laravel-package-tools Version ^1.15
livewire/livewire Version ^3.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 guava/filament-nested-resources contains the following files

Loading the files please wait ....