jeudi 22 décembre 2016

How to store values

I construct one, different values for each id ,this is my code

$errorMessage = array();
        $result = CheckpointErrormsg::where('checklist_template_id', $checklist_template_id)->orderby('error_message', 'asc')->select('checkpoint_id', 'error_message')->get()->toArray();
        foreach ($result as $row) {
            $errorMessage[$row['checkpoint_id']][] = $row['error_message'];
        }
        return $errorMessage;

} This is my blade view page:

 {!! Form::select($checkpoint['id'].'_c[]', isset($error_messages[$checkpoint['id']])?$error_messages[$checkpoint['id']] : array(), $explode_values, array('multiple'=>'true', 'class'=>'form-control js-example-tags select2','id'=>$checkpoint['id'].'_c')) !!}

in my database inserted this formate :values 0,1,2 but I need red,blue,green please help me



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire