Adminix Documentation Help

Link

Description

The "Link" module purpose - render a link button to some route in Laravel app, or to some page in Adminix panel.

Configuration

use App\Models\User; use AlexKudrya\Adminix\Modules\Link\AdminixLinkModule; use AlexKudrya\Adminix\Modules\Link\LinkModule; use AlexKudrya\Adminix\Enums\HttpMethodsEnum; ... $page = new AdminixPage(); ... $page->addModules( AdminixLinkModule::name('user_cart_btn') ->title('USER CART') ->uri(UserCartPage::URI) ->icon('bi bi-cart3') ->params(['param:0']), LinkModule::name('user_account_btn') ->title('USER ACCOUNT') ->uri('user_account') ->icon('bi bi-person') ->params(['param:0']) LinkModule::name('user_ban_btn') ->title('BAN USER') ->uri('user_ban') ->icon('bi bi-person-fill-slash') ->method(HttpMethodsEnum::POST) ->params(['param:0']) ); ... ]

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.

For non-GET methods LinkModule renders a form with CSRF protection. PUT, PATCH, and DELETE use a POST form with Laravel method spoofing.

LinkModule can also render small forms before the submit button by adding shared ActionField fields:

use AlexKudrya\Adminix\Actions\ActionField; use AlexKudrya\Adminix\Enums\HttpMethodsEnum; use AlexKudrya\Adminix\Modules\Module; Module::link() ->name('cash-upload') ->title('Start import') ->uri('admin.cash-import.upload') ->method(HttpMethodsEnum::POST) ->addFields( ActionField::make('csv_file', 'CSV file')->file()->accept('.csv,.txt')->required(), ActionField::make('dry_run', 'Dry-run')->boolean(), ActionField::make('analyze', 'Analyze')->boolean(), );

Field names are submitted directly to the application route, for example csv_file, dry_run, and analyze. File fields automatically enable multipart/form-data; boolean fields render as Adminix switch controls and submit 0/1.

AdminixLinkModule and LinkModule configurations

Method

Description

name

Name of module, must be unique in current page.

name('user_cart_btn')

Required

uri

In case AdminixLinkModule uri means the uri directive of page which defined in Adminix config file. In this case better to use URI constant from target page provider class.

uri(UserCartPage::URI)

In case LinkModule uri means the name of any route defined in router of your Laravel application. Just copy route name from router.

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 <i class="bi bi-people-fill"></i> you need paste here bi bi-people-fill class name

icon('bi bi-cart3')

Optional

method

Type of HTTP request, can be provided only by AlexKudrya\Adminix\Enums\HttpMethodsEnum Enum class

In case AdminixLinkModule method can be only GET so it is redundant.

In case LinkModule method must be match to the route defined in uri directive.

By default, it is equal to HttpMethodsEnum::GET

method(HttpMethodsEnum::POST)

Optional

params

It is the list of parameters added to the link. For new pages, param:n uses zero-based page route params: param:0 is the first parameter after the Adminix page URI. For example, current page URL https://example.com/adminix/user/123 resolves param:0 to 123,

link url will be https://example.com/adminix/user_cart/123

Example:

params(['param:0'])

Legacy one-based page providers that use param:1 for the first route parameter remain supported for compatibility. New code should use param:0.

Optional

Shared action metadata methods:

  • tooltip() stores hover text.

  • criteria() controls row action visibility when the link is used inside ListModule.

  • confirm() stores a confirmation message for state-changing links.

  • color() stores an optional ColorsEnum value or CSS color string for custom renderers.

  • destructive() marks dangerous actions without changing the current route contract.

  • actionMetadata() returns ActionMetadataDto.

Appearance example

image.png
Last modified: 01 July 2026