Search code examples
cakephpcakedc

Cakedc users plugin new table entry


I am using Cakedc Users plugin and I want to add a small entry to the Users table which is "Balance" (integer)

I read the extending part in the documentation and I honestly got dizzy from all the modifications that I have to do

I don't want to rewrite the whole thing just for a small entry, Is there anyway I can add it to the table with minumum modification or rename another entry that I don't need, like "tos_date" or something


Solution

  • Well, let me try to help about how extending the model should be:

    1. Modify the users table (via migrations or manually) and add the columns you want.
    2. Copy the template files with the forms, from the plugin itself to your app under the folder src/Template/Plugin/CakeDC/Users/name_of_the_controller/name_of_the_action, then modify the forms to add a new control for your custom column
    3. You're done

    Thanks!