Add new option for make:model for specific table |
Usually, after building the model, I have to add the names of the fields to $allowedFields.This is time-consuming for me.
I don't know exactly whether other developers have experienced this issue or not. I suggest to add a new option to command php spark make:modelfor this issue. Option -for takes the name of the table and adds the fields to $allowedFields to generate the model. I think this option helps a lot in saving the developer's time. Code: Data of Table "sms_sender": Code: php spark make:model -for sms_sender PHP Code: protected $DBGroup = 'default';
No problem. Good idea!
I agree. I myself had tables of the type date_1, date_N... When creating, it is important to take into account the primary key
Simple CI 4 project for beginners codeigniter-expenses
Yes, good idea but somefields will not need to be in allowFields.
So we will need to look into that. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(07-27-2023, 10:35 PM)InsiteFX Wrote: Yes, good idea but somefields will not need to be in allowFields.For example? Default dates can be added (created_at, etc). ID as the `id` field to ignore. There is a problem if the ID is of a different type (`product_id`). Then you need to request it from the console. After creating the model, remind the developer to check these fields
Simple CI 4 project for beginners codeigniter-expenses
The option --table was implemented.
Code: $ php spark make:model --help |
Welcome Guest, Not a member yet? Register Sign In |