Key value pair editor.

Published 1 week ago by phpMick

Hi,

Has anyone done anything like this? I want the user to be able to enter key value pairs like name=test

Cheers,

Mick

Yorki
Yorki
1 week ago (29,510 XP)

Create you key value pair model with user_id and thats it.

class KeyValuePair extends Model
{
    protected $fillable = ['user_id', 'key', 'value'];
}

Database table would be:

table:
    - id
    - created_at
    - updated_at
    - user_id
    - key
    - value
phpMick
phpMick
1 week ago (52,220 XP)

I was wondering more about the user interface, I was thinking maybe create a Vue component.

Yorki
Yorki
1 week ago (29,510 XP)

Yes you could make your CRUD controller for this and use it via vue. It's all up to you how will you display and edit that data cause it could be done in many ways.

phpMick
phpMick
1 week ago (52,220 XP)

Yes, clearly it can be done in many ways. I was wondering if anyone had done anything similar.

Please sign in or create an account to participate in this conversation.