I am working on a Laravel 4 project and I am trying to add a bunch of services to the services column in a simple service table. the columns are formatted as:
id userID services price
What I would like it to do is when a user selects the services all the services that user selects get's put into the services column to look like:
id userID services price
1 5 clean $4.95
2 5 unload $7.95
3 5 dance $1.95
4 5 vacuum $12.95
5 5 clean $4.95
basically all the services are in different input fields. So they aren't related.
I tried adding an array to the model but it gives an error:
Array to String conversion
Part of my Controller
$service = new Service();
$service->userID = $user->id;
$service->services = array(
Input::get('rooms'),
Input::get('pr_deodorizer'),
Input::get('pr_protectant') .
Input::get('pr_sanitzer'),
Input::get('fr_couch'),
Input::get('fr_chair'),
Input::get('fr_sectional'),
Input::get('fr_ottoman')
);
var_dump($service->services);die;
$service->save();