With Craftable you can quickly scaffold your typical CRUD admin interface. It generates all the code based on the existing, migrated table in the database.
Imagine you have a posts
table defined with this migration:
Let's migrate this table:
And now we are ready to generate whole CRUD interface.
You will be prompted to migrate generated migration that attaches permissions to the default Administrator
role. You can read more about it, for now just choose yes
We love to organize things. That's why we have changed the default namespace for models toApp\Models
. But you can always specify any other (i.e. Laravel's defaultApp\
) with an-m
option.
Finally we need to re-compile all the assets. If you are using Laravel with Webpack, you need to call:
If you are using Laravel with Vite, you need to call:
Now you can refresh your admin interface in a browser. You should be able to see new menu item Posts
.