Pages · Laravilt
CreateAction
Create records through the create page or a modal form.
php
Defaults: icon Plus, color primary. Hidden when the user can't create records.
Inside a resource, it configures itself from the page:
- Full resources: links to the resource's create page.
- Simple ("manage records") resources: opens a modal with the resource form, creates the record, and shows a success notification.
Modal form outside a resource
php
formSchema() switches the action to a modal, sets the submit/cancel labels, and uses a lg width.
Custom creation logic
php
API reference
| Method | Description |
|---|---|
model(string) | Model class to create |
formSchema(array) | Modal form fields |
using(?Closure) | Creation handler; no argument uses the default |
modalHeading(), modalWidth(), slideOver() | Modal options |