create_team_social_icons_table.php
$table->increments('id');
$table->integer('order_id');
$table->integer('team_id');
$table->integer('social_class');
$table->string('link');
Hello, I have two different array from create form social_class[] and link[]. Trying to record values from a form using the form at one time.
<select name="social_class[]">
<select name="social_class[]">
<select name="social_class[]">
<select name="link[]">
<select name="link[]">
<select name="link[]">
I received an error message:
preg_replace(): Parameter mismatch, pattern is a string while replacement is an array.
$social_class = Input::get('social_class');
$link = Input::get('link');
foreach ($social_class as $socialClass) {
$tsi = new TeamSocialIcon();
$tsi->order_id = 0;
$tsi->team_id = $insertedId;
$tsi->social_class = $socialClass;
$tsi->link = $link;
$tsi->save();
}
$sc? it seems to me you are trying to save the$social_classarray, not the array element. Try, changing:$tsi->social_class = $social_class;to$tsi->social_class = $sc;$tsi->social_class = $socialClass;and updated some variable buttsi->linkor$linkstill not catch value. and preg_replace error.