Create menu links with a seeder or migration

araminho - 1 month ago

Is it possible to create menu links with a seeder or migration? The links should be related to certain pages, not just URLs. I found an example of seeding URL-type links in PyroCMS core "navigation-module" (LinkSeeder.php), but can't find an example of page-type links anywhere.

ryanthompson - 1 month ago

It's very much the same thing - but the page type has it's own stream information. So you would need to seed that in very much the same fashion.

https://github.com/anomalylabs/navigation-module/blob/2.3/src/Link/LinkSeeder.php#L52

You would use the page link type model and check the DB for required fields but pretty straight forward - exact same process. Different model is all.