Link
Description
The "Link" module purpose - render a link button to some route in Laravel app, or to some page in Adminix panel.
Configuration
To add to the page Link to some page in your Adminix panel, you need paste AlexKudrya\Adminix\Modules\Link\AdminixLinkModule class instance as an argument to addModule or addModules method of AdminixPage object. This link used only for navigation between adminix pages, difened in adminix config file
To add to the page Link to some page outside the Adminix panel, but in your Laravel Application, you need paste AlexKudrya\Adminix\Modules\Link\LinkModule class instance as an argument to addModule or addModules method of AdminixPage object. This link used to access any route in your Laravel application (route must be named and optionally protected by AlexKudrya\Adminix\Http\Middleware\AuthMiddleware. Use this middleware only after web and auth middlewares)
LinkModule and AdminixLinkModule implement the shared Actions metadata contract. Use actionMetadata() when a custom renderer or extension needs the common action fields.
AdminixLinkModule and LinkModule configurations
Method | Description | |
|---|---|---|
name | Name of module, must be unique in current page.
name('user_cart_btn')
| Required |
uri | In case
uri(UserCartPage::URI)
In case
uri('user_account')
| Required |
title | Title which will be displayed on the button
name('USER CART')
| Optional |
icon | Icon class name from Bootsrap icons Example: to generate in the Link an icon
icon('bi bi-cart3')
| Optional |
method | Type of HTTP request, can be provided only by In case In case By default, it is equal to
method(HttpMethodsEnum::POST)
| Optional |
params | It is list of parameters which you added to link. When link url will be Example:
params([
['value' => 'param:1']
])
| Optional |
Shared action metadata methods:
tooltip()stores hover text.criteria()controls row action visibility when the link is used insideListModule.confirm()stores a confirmation message for state-changing links.color()stores an optionalColorsEnumvalue or CSS color string for custom renderers.destructive()marks dangerous actions without changing the current route contract.actionMetadata()returnsActionMetadataDto.
Appearance example
