Hi. I am using the Table of the Relation Manager. I have an action "Tables\Actions\ViewAction::make()"
It opens an empty modal. How can I add the View (best case from the Resource View)?
Solution
do you have a form Schema or infolist Schema defined? You can reuse the Schema of another Resource like this:
public function form(Schema $schema): Schema { return $schema ->components(OtherResource::formSchema()); }
public function form(Schema $schema): Schema { return $schema ->components(OtherResource::formSchema()); }
But you have to define formSchema in OtherResource:
public static function formSchema(): array { return [...Fields]; } public static function form(Schema $schema): Schema { return $schema ->components(self::formSchema()); }
public static function formSchema(): array { return [...Fields]; } public static function form(Schema $schema): Schema { return $schema ->components(self::formSchema()); }