I’m new to Filament and I’d like to ask if it’s possible (or allowed) to use a nested schema function inside another schema.
Here’s my current setup. I created a tasks schema that returns a table:
public function tasks(Schema $schema): Schema{ return $schema->components([ Table::make() // table structure here ]);}
public function tasks(Schema $schema): Schema{ return $schema->components([ Table::make() // table structure here ]);}
And I also have a cardSchema:
public function cardSchema(Schema $schema): Schema{ return $schema->components([ // schema here ]);}
public function cardSchema(Schema $schema): Schema{ return $schema->components([ // schema here ]);}
What I’d like to do is reuse the tasks schema inside the cardSchema, something like this:
public function cardSchema(Schema $schema): Schema{ return $schema->components([ $this->tasks ]);}
public function cardSchema(Schema $schema): Schema{ return $schema->components([ $this->tasks ]);}
My question is: Is this the right way to include the tasks schema inside the cardSchema? If not, could you please suggest the correct approach or best practice for this kind of setup?
I’m still learning Filament and trying to figure out the right patterns. Any advice would be appreciated.