Поле HiddenIds используется для передачи первичного ключа выбранных элементов.
Метод make()
принимает имя компонента в качестве параметра.
HiddenIds::make('index-table')
HiddenIds::make('index-table')
HiddenIds::make('index-table')
HiddenIds::make('index-table')
HiddenIds::make('index-table')
Таблица должна содержать поле ID.
use MoonShine\Components\FlexibleRender;
use MoonShine\ActionButtons\ActionButton;
use MoonShine\Fields\HiddenIds;
public function buttons(): array
{
return [
ActionButton::make('Active', route('moonshine.posts.mass-active', $this->uriKey()))
->inModal(fn () => 'Active', fn (): string => (string) form(
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(),
];
}
use MoonShine\Components\FlexibleRender;
use MoonShine\ActionButtons\ActionButton;
use MoonShine\Fields\HiddenIds;
//...
public function buttons(): array
{
return [
ActionButton::make('Active', route('moonshine.posts.mass-active', $this->uriKey()))
->inModal(fn () => 'Active', fn (): string => (string) form(
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(),
];
}
//...
use MoonShine\Components\FlexibleRender;
use MoonShine\ActionButtons\ActionButton;
use MoonShine\Fields\HiddenIds;
//...
public function buttons(): array
{
return [
ActionButton::make('Active', route('moonshine.posts.mass-active', $this->uriKey()))
->inModal(fn () => 'Active', fn (): string => (string) form(
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(),
];
}
//...
use MoonShine\Components\FlexibleRender;
use MoonShine\ActionButtons\ActionButton;
use MoonShine\Fields\HiddenIds;
//...
public function buttons(): array
{
return [
ActionButton::make('Active', route('moonshine.posts.mass-active', $this->uriKey()))
->inModal(fn () => 'Active', fn (): string => (string) form(
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(),
];
}
//...
use MoonShine\Components\FlexibleRender;
use MoonShine\ActionButtons\ActionButton;
use MoonShine\Fields\HiddenIds;
//...
public function buttons(): array
{
return [
ActionButton::make('Active', route('moonshine.posts.mass-active', $this->uriKey()))
->inModal(fn () => 'Active', fn (): string => (string) form(
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(),
];
}
//...