just see how others implement that. http://crudbooster.com/ https://github.com/appzcoder/crud-generator/tree/master look into the source code and learn from it.
Laravel CRUD Generator
Hello guys i was wondering if there is any way to implement CRUD generator for the Laravel. I know there are alot of them wich do the job well but i want a custom one i want to make it in my own admin dashboard!.
Hi,
There are lots of ways to implement CRUD. Always depends on your needs.
Some tips:
-
Define what you want in the end. Choose a template or prepare to use your own (for example: AdminLTE), what fields do you need, etc...
-
Start with a basic example, 1 table, 1 column type text.
2.1. Seed it that table. Create the model. Create your controller. Add a resourceful route.
2.2. Add a map for each of your fields in model, for example:
protected $adminColumns = ['name' => 'text'];.2.3. Start by display all your database table contents in a html table, through the index method. Using the adminColumns.
2.4. The the show, update, destroy, .... methods.
After the easy part, start to abstract each part one by one. Add textareas, images. For example create a Class to handle the stores and updates to database, one to display data in the form. Add a trait on your model to easier implementation on other ones. Add CRUD commands.
Basically one step at a time.
Hope it helps :)
Please or to participate in this conversation.