43
rated 0 times
[
45]
[
2]
/ answers: 1 / hits: 31560
/ 6 Years ago, fri, september 21, 2018, 12:00:00
So I've got this code
View:
<div id=checkboxes>
<input type=checkbox class=checkbox name=services value={{ $service->id }} id={{ $service->id }} />
<label class=whatever for={{ $service->id }}><p class=serv-text> {{ $service->service_name }} + ${{ $service->price }} </p></label>
</div>
Controller:
public function store(Request $request)
{
orders::create(Request::all());
return 'test';
}
Model:
class orders extends Model
{
protected $fillable = [
'category',
'services',
'total_price',
'user_id',
'status',
'user_id'];
}
When I try to submit the form, in the database at services there is only one number even if I checked multiple boxes when I submitted the form.
I've tried to find on google a solution but nothing.
More From » php