Inherits Text.
* has the same capabilities.
Basics
The Url field is an extension of Text that defaults to setting type=url
.
use MoonShine\UI\Fields\Url; Url::make('Link')
Title
The title()
method allows you to set the link title.
title(Closure $callback)
use MoonShine\UI\Fields\Url; Url::make('Link') ->title(fn(string $url, Url $ctx) => str($url)->limit(3))
Blank
The blank()
method adds the attribute target="_blank"
for the link preview. Therefore, in this mode, the link will open in a new window.
blank()
use MoonShine\UI\Fields\Url; Url::make('Link') ->blank()