0
votes

Result from MODAL:

Result from MODAL

Result from FORM:

Result from FORM

DESCRIPTION:

So I wanna make a FORM from MODAL that will send data to actual FORM's table, but at the first IMAGE that not send like the FORM one.

CODE:

This is code from FORM attribute:

public function setLandCertificateIdAttribute($values)
{
    // dd($values);
    $this->attributes['land_certificate_id'] = implode(',', $values);
}

This is code using MODAL:

public function form(Model $model)
{
    $this->multipleSelect('land_certificate_id', 'Nomor Sertifikat')
        ->options(LandCertificate::where('data_order_id', $model->id)->pluck('number', 'id'));
}

And the MODAL always return : implode(): Invalid arguments passed

I'm using laravel-admin project btw

1

1 Answers

0
votes

implode(): Invalid arguments passed: It means that the function is expecting an array of data. The implode function in PHP is easily remembered as "array to string"

In your modal html set your land_certificate_id name as array.

For example.

<input type="text" name="land_certificate_id[]"></input>