Custom Schema V4

Hello, i have a problem with making new custom Schema in InfoList I want to make new instance of Schema and working ith custom data inside an
$customSchema = Schema::make($livewire)
->record(User::first())
->components([
Action::make('testAction')->requiresConfirmation(),
Infolists\Components\TextEntry::make('id'),
]);
$customSchema = Schema::make($livewire)
->record(User::first())
->components([
Action::make('testAction')->requiresConfirmation(),
Infolists\Components\TextEntry::make('id'),
]);
i set record as custom (User model) in components, TextEntry can render model and show ID, but when clicking on Action, modal is not opening
9 Replies
LeandroFerreira
LeandroFerreira4mo ago
Did you implement HasActions? Did you add <x-filament-actions::modals /> to the view?
navidsafavi
navidsafaviOP4mo ago
Hello @Leandro Ferreira actually i am not using template, in v4, schema will be rendered into page actually i am adding this custom $customSchema to my info list schema, if i want to add action option into info list action is working, but when i want to make new instance of schema, modal can not be opened.
->schema([
Action::make('testAction')->requiresConfirmation(),
])
->schema([
Action::make('testAction')->requiresConfirmation(),
])
LeandroFerreira
LeandroFerreira4mo ago
is it a custom page?
navidsafavi
navidsafaviOP4mo ago
no in ViewPage
navidsafavi
navidsafaviOP4mo ago
example first array is outside of a new instance of schema -> work second one, in custom schema (that I needed), and in this schema i added same action ->modal is not opened
No description
navidsafavi
navidsafaviOP4mo ago
it means left action (same inner schema) -> works
No description
navidsafavi
navidsafaviOP4mo ago
but second one, (also i send livewire component) -> modal not opening purpose of this way for making instance of schema, working with some custom action and update into viewpage, it can works with some relation, but I want to call a custom schema and working isolation between my components
LeandroFerreira
LeandroFerreira4mo ago
Honestly, I'm not sure why it isn't working. The first action probably receives a schemaComponentas a action argument, but the second might be in a different schemaComponent, which could be causing the issue..
navidsafavi
navidsafaviOP3mo ago
Hi @LeandroFerreira actually i need similar this, but does not work,
Group::make()
->model( Admin::first())
->schema([
Infolists\Components\TextEntry::make('email')
]),
Group::make()
->model( Admin::first())
->schema([
Infolists\Components\TextEntry::make('email')
]),
imagine, in user model view, i want to load externl model and show in my view, I dont want to working with relation, in my example I want to make a wrapper (similr group or anything as I can) and pass a Admin model, but this example does not work, i coud not find a way for handling similar this i did by this way, I thought it can be help, but unfortunately does not work this post has a related to https://discord.com/channels/883083792112300104/1392776840258650163

Did you find this page helpful?