Содержит все Базовые методы.
Поле HiddenIds
используется для передачи первичного ключа выбранных элементов.
Например, в таблице при массовых действиях необходимо собрать значения ID всех выбранных элементов и отправить в форму.
make(string $forComponent)
make(string $forComponent)
make(string $forComponent)
make(string $forComponent)
make(string $forComponent)
$forComponent
- название компонента со списком элементов.
use MoonShine\UI\Fields\HiddenIds;
HiddenIds::make('index-table')
use MoonShine\UI\Fields\HiddenIds;
HiddenIds::make('index-table')
use MoonShine\UI\Fields\HiddenIds;
HiddenIds::make('index-table')
use MoonShine\UI\Fields\HiddenIds;
HiddenIds::make('index-table')
use MoonShine\UI\Fields\HiddenIds;
HiddenIds::make('index-table')
Таблица должна содержать поле ID.
use MoonShine\UI\Components\FlexibleRender;
use MoonShine\UI\Components\ActionButton;
use MoonShine\UI\Fields\HiddenIds;
use MoonShine\UI\Components\FormBuilder;
ActionButton::make('Active', route('moonshine.posts.mass-active', $this->uriKey()))
->inModal(
'Active',
fn (): string => (string) FormBuilder::make(
route('moonshine.posts.mass-active', $this->uriKey()),
fields: [
HiddenIds::make($this->listComponentName()), FlexibleRender::make(__('moonshine::ui.confirm_message')),
]
)
->async()
->submit('Active', ['class' => 'btn-secondary'])
)
->bulk()
namespaces
use MoonShine\UI\Components\FlexibleRender;
use MoonShine\UI\Components\ActionButton;
use MoonShine\UI\Fields\HiddenIds;
use MoonShine\UI\Components\FormBuilder;
ActionButton::make('Active', route('moonshine.posts.mass-active', $this->uriKey()))
->inModal(
'Active',
fn (): string => (string) FormBuilder::make(
route('moonshine.posts.mass-active', $this->uriKey()),
fields: [
HiddenIds::make($this->listComponentName()), // название компонента, из которого необходимо получить ID
FlexibleRender::make(__('moonshine::ui.confirm_message')),
]
)
->async()
->submit('Active', ['class' => 'btn-secondary'])
)
->bulk()
use MoonShine\UI\Components\FlexibleRender;
use MoonShine\UI\Components\ActionButton;
use MoonShine\UI\Fields\HiddenIds;
use MoonShine\UI\Components\FormBuilder;
ActionButton::make('Active', route('moonshine.posts.mass-active', $this->uriKey()))
->inModal(
'Active',
fn (): string => (string) FormBuilder::make(
route('moonshine.posts.mass-active', $this->uriKey()),
fields: [
HiddenIds::make($this->listComponentName()), // название компонента, из которого необходимо получить ID
FlexibleRender::make(__('moonshine::ui.confirm_message')),
]
)
->async()
->submit('Active', ['class' => 'btn-secondary'])
)
->bulk()
namespaces
use MoonShine\UI\Components\FlexibleRender;
use MoonShine\UI\Components\ActionButton;
use MoonShine\UI\Fields\HiddenIds;
use MoonShine\UI\Components\FormBuilder;
ActionButton::make('Active', route('moonshine.posts.mass-active', $this->uriKey()))
->inModal(
'Active',
fn (): string => (string) FormBuilder::make(
route('moonshine.posts.mass-active', $this->uriKey()),
fields: [
HiddenIds::make($this->listComponentName()), // название компонента, из которого необходимо получить ID
FlexibleRender::make(__('moonshine::ui.confirm_message')),
]
)
->async()
->submit('Active', ['class' => 'btn-secondary'])
)
->bulk()
use MoonShine\UI\Components\FlexibleRender;
use MoonShine\UI\Components\ActionButton;
use MoonShine\UI\Fields\HiddenIds;
use MoonShine\UI\Components\FormBuilder;
ActionButton::make('Active', route('moonshine.posts.mass-active', $this->uriKey()))
->inModal(
'Active',
fn (): string => (string) FormBuilder::make(
route('moonshine.posts.mass-active', $this->uriKey()),
fields: [
HiddenIds::make($this->listComponentName()), // название компонента, из которого необходимо получить ID
FlexibleRender::make(__('moonshine::ui.confirm_message')),
]
)
->async()
->submit('Active', ['class' => 'btn-secondary'])
)
->bulk()