Download the PHP package unexpectedjourney/filament-modal-resource-picker without Composer

On this page you can find all versions of the php package unexpectedjourney/filament-modal-resource-picker. 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-modal-resource-picker

A powerful resource picker for Filament.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Adds a new ResourcePicker form component that lets users browse and select models using your existing resources in modal.

Installation

You can install the package via composer:

Usage

Add the plugin to your panel provider

Then add the component to your form

This adds a button to your form that when clicked opens a modal with the table from the resource specified in the resource() method. All columns and filters will be available while all Actions are removed.

Just click a record to select it and click it again to deselect it. When a record is selected it will show up in the right hand sidebar. You may deselect a record in this sidebar by hovering your mouse over it and clicking the trash icon that appears.

Once you've selected the record (or records in the case of a multiple select) click the update and close. The modal will close and you will see the selected records reflected in your form. You may remove a record from the selection by hovering your mouse over it and clicking the trash icon that appears.

Selecting multiple records (and sorting)

To select multiple records use the multiple() method.

If you would like the selected records to be sortable than call the sortable() method.

Integrating with an Eloquent relationship

You may employ the relationship() method of the ResourcePicker to configure a HasMany relationship. The ResourcePicker will load the item data from the relationship, and save it back to the relationship when the form is submitted. If a custom relationship name is not passed to relationship(), the field name will be used as the relationship name:

Sorting items in a relationship

By default, reordering relationship items is disabled. This is because your related model needs a sort column to store the order of related records. To enable sorting, you may use the orderColumn() method, passing in a name of the column on your related model to store the order in:

Searching selected records

When selecting multiple records you can search the selected records using the text input above the selected records on the right hand side of the ResourcePicker modal. By default, this filter will use search the recordTitleAttribute configured on the resource. You can configure the columns used in this filter on a resource by resource basis by configuring your resource pickers.

Configuring your resource pickers

Inside the boot method of a service provider call ResourcePickerManager::configure() and pass a key value array. The key is the class name of the resource you want to configure and the value is a closure that receives a ResourcePickerConfiguration argument named $configuration.

Configuring fields used for searching results

Use the searchColumns method of the ResourcePickerConfiguration to pass an array of columns that should be used when searching through the results in the ResourcePicker modal.

Configuring the selected record previews

The ResourcePicker displays the record title configured on your Filament resource by default. Use the previewComponent() method on the ResourcePickerConfiguration and pass it the name of a Blade component to be used to display the preview.

Your Blade component can access the selected record by adding a record property as documented https://laravel.com/docs/10.x/blade#data-properties-attributes.

Configuring a custom ResourceBrowser component

In some cases you may want to extend the ResourceBrowser component to add your own functionality, for instance adding support for the [Advanced Table](https://filamentphp.com/plugins/kenneth-sese-advanced-tables] plugin) to the table.

First create your custom ResourceBrowser component making sure to extend UnexpectedJourney\FilamentResourcePicker\Livewire\ResourceBrowser.

Then configure the plugin to use your custom ResourceBrowser in your plugin Panel provider.

Render Hooks

Filament Resource Picker exposes some render hooks to allow you to inject custom HTML into the UI. View the Filament documentation for how to register a render hook.

Available Render Hooks

Changelog

Please see CHANGELOG for more information on what has changed recently.

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-modal-resource-picker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
filament/filament Version ^3.0
illuminate/contracts Version ^10.0|^11.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 unexpectedjourney/filament-modal-resource-picker contains the following files

Loading the files please wait ....