groups icon indicating copy to clipboard operation
groups copied to clipboard

how to added another attribute to groupe $Data

Open mehdithemaker opened this issue 5 years ago • 3 comments

Hello how can I add another attribute to the array $data when creating a groupe I tryed : but it's not working

[public function store(Request $request){ $userId=Auth::User()->id;

    $filiereid = $request->input('filiere');

    $data= [
    'name'              => $request->input('groupename'),
    'description'       => '', // optional
    'short_description' => '', // optional
    'filiere_id'        => $filiereid,

    'image'             => '', // optional
    'private'           => 0,  // 0 (public) or 1 (private)
    'extra_info'        => '', // optional
    'settings'          => '', // optional
    'conversation_id'   => 0,  // optional if you want to add messaging to your groups this can be useful
    ];
    $group = Groups::create($userId, $data);

    return view('/home');](url)

mehdithemaker avatar May 26 '19 17:05 mehdithemaker

can you show your function? Are all the other attributes showing?

musonza avatar Jun 01 '19 14:06 musonza

Check Vendor->musonza->groups->src->Models->Group.php and modify $fillable.

I don't know other way to solve this so I had to make changes to source code.

markoman78 avatar Jul 07 '19 15:07 markoman78

You could add a json blob to extra_info column

musonza avatar Jul 07 '19 21:07 musonza