Download the PHP package outerweb/filament-link-picker without Composer

On this page you can find all versions of the php package outerweb/filament-link-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-link-picker

Filament Link Picker

Latest Version on Packagist Total Downloads

This package adds a field to pick a link from your defined routes or external links. It also adds a blade component to render the links.

Features

The link picker field will show the following options:

The link picker will automatically show and bind the parameters of the selected route. This includes:

The link picker can also show route options:

The link can be rendered using the <x-filament-link-picker-link /> blade component.

Installation

You can install the package via composer:

Add the plugin to your desired Filament panel:

Configuration

Disabling the external link option

You can disable the external link option by adding the disableExternalLinks method to the plugin.

Disabling the email link option

You can disable the email link option by adding the disableMailto method to the plugin.

Disabling the telephone link option

You can disable the telephone link option by adding the disableTel method to the plugin.

Disabling the 'download' option

You can disable the 'download' option by adding the disableDownload method to the plugin.

Disabling the 'opens in new tab' option

You can disable the 'opens in new tab' option by adding the disableOpenInNewTab method to the plugin.

Multi language support

You can enable multi language support by adding the translateLabels method to the plugin.

The following items can be translated:

To do so, just set the values to the translation key.

Usage

Setting up routes

You can mark a route for the link picker to discover by adding the filamentLinkPicker() method to the route.

Customizing the route's label

The label of the route will be used in the dropdown of the link picker. You can customize the label by passing it as an argument to the filamentLinkPicker() method.

By default, the label will be the route's name. If the route name contains dots, they will be replaced by '>'.

Customizing the route's group

The group will be used to group the routes in the dropdown of the link picker. You can customize the group by passing it as an argument to the filamentLinkPicker() method.

Marking the route as 'localized'

Marking a route as 'localized' will make the link picker combine all localized versions of that route. This is useful when you have a multi-language where you have the same route for different languages so that the link picker does not show the same route multiple times. See the Localization section for more information.

Defining specific parameter labels

You can define specific parameter labels for the route by passing an array to the filamentLinkPicker() method. These labels will be used in the link picker as labels for the parameter input fields.

Defining specific parameter options

You can define specific parameter options for the route by passing an array to the filamentLinkPicker() method. These options will be used in the link picker as options for the parameter select field.

Explicitly defining the column name to store the value in the database

By default, the package will use the $model->getKey() method to store the selected value of a parameter in the database. If you want to store the value in a different column, you can pass the column name as an argument to the filamentLinkPicker() method.

Setting up route model binding

Route model binding is supported by default. The link picker will automatically show the available models in the parameter select field. It will save the primary key of the model to the database.

By default, we go through the following attributes to automatically find the model's label:

If none of these attributes are found, the application will throw an exception.

Explicitly defining the model's label

You can explicitly define the model's label by adding a getLinkPickerLabel method to the model.

Or you can define the label as a property on the model.

Filtering the available models

You can filter the available models by adding a scopeLinkPickerOptions method to the model. This scope will then be applied to the model's query when fetching the available options for the select field.

Localization

The link picker can handle localized routes well. To do so, follow these steps:

  1. Mark the route as 'localized' by adding the localized argument to the filamentLinkPicker() method on your route.

  2. Configure how the link picker should combine the localized routes by adding the combineLocalizedRoutesUsing method to the plugin.

By default, the package will combine the localized routes by removing the part of the name before the first dot. If you want to use this behavior, you do not need to specify the combineLocalizedRoutesUsing method.

  1. Configure how the link picker should build the localized routes by adding the buildLocalizedRouteUsing method to the plugin.

As a fallback, when you do not specify a callback function, the link picker will use the outerweb/localization package to build the localized routes if it is installed. This package provides a localizedRoute helper that you can use in your application. Read more about this package here.

Using the actual value

To use the actual value of the link, you can cast the attribute in your model or use the facade.

Casting

You can cast your model's attribute to the Outerweb\FilamentLinkPicker\Entities\Link class to take advantage of the entity's properties and methods.

Using the facade

You can use the Outerweb\FilamentLinkPicker\Facades\LinkPicker facade to cast the value to a Link entity.

Rendering the link

You can use the <x-filament-link-picker-link /> blade component to render the link.

The link picker options like is_download and opens_in_new_tab will only take effect when you do not specify them on the component itself. If you do specify them, the component will use the specified values.

Here, we specified the download and target attributes. The component will use these values instead of the ones from the link picker.

Changelog

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

Credits

License

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


All versions of filament-link-picker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
filament/filament Version ^3.2
laravel/framework Version ^10.0|^11.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 outerweb/filament-link-picker contains the following files

Loading the files please wait ....