Pro
Generators
Viewing latest docs.
Switch version:
v3
Generators
Generators
mix petal.gen.live
This produces the same files as Phoenix’s mix phx.gen.live (docs). The only difference is that the templates use Tailwind and Petal Components. You can try it out with:
shell
mix petal.gen.live Todos Todo todos label:string is_done:boolean
ℹ️ Information: The default implementation uses the Table component and Streams. The following variation will generate an alternate template using the Data Table component (without Streams):
``shell
mix petal.gen.live Todos Todo todos label:string is_done:boolean --data-table
``
ℹ️ Information: If you're wondering where to put the routes, you can search in the router file for the text "Add live authenticated routes here", and add them straight after that line.