Download the PHP package outerweb/nova-link-picker without Composer
On this page you can find all versions of the php package outerweb/nova-link-picker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download outerweb/nova-link-picker
More information about outerweb/nova-link-picker
Files in outerweb/nova-link-picker
Package nova-link-picker
Short Description A Laravel Nova field to generates links
License MIT
Homepage https://github.com/outer-web/nova-link-picker
Informations about the package nova-link-picker
Nova Link Picker
This package provides a Nova field to generate a link. It shows a select field with the routes of your application you want to be used as a link. It also provides fixed options like external
, mailto
and tel
. Route model binding is automatically applied to the parameters to give the user dropdowns with the available options.
Screenshots
Edit
Index
Detail
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
This field stores its value as a JSON string in the database. So you need to make sure the column in the database is a json
column (or text
if json
is not (yet) supported by your DB engine).
The value of the field looks like this:
To make it easier to work with this value, you can use the Outerweb\NovaLinkPicker\Casts'LinkPickerCast
cast.
This cast will cast the value to a Outerweb\NovaLinkPicker\Entities'Link
instance.
On this instance you can call the following methods / properties:
Add the following syntax to the routes you want to be available in the select field:
By default, the label of the route will be the route name. If the route contains a dot, the label will split the parts with a ">" character. For example: my-route
will be My route
and my-route.sub-route
will be My route > Sub route
.
You can always customize the label of your named routes by adding the following to your routes:
Add the field to your Nova resource:
Overwriting
Sometimes your application requires some custom logic. We've tried to make it as easy as possible to overwrite the default behavior.
You can overwrite the LinkPicker
field by creating a new field that extends the LinkPicker
field. This way, you can just overwrite the methods you want to change.
You can overwrite the Link
entity by creating a new entity that extends the Link
entity. This way, you can just overwrite the methods you want to change.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Simon Broekaert
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of nova-link-picker with dependencies
laravel/framework Version ^10.0
laravel/nova Version ^4.0
spatie/laravel-package-tools Version ^1.16