Support the ongoing development of Laravel.io →
Input Database

Hi,

Laravel 5.2 here.

I can't save my checkbox values to db

$data = $request->all();
$data["uid"] = Auth::user()->id;
$new_ad = \App\Ad::Create($data);

Everything is saved other than the checkbox values. All the required values have been added to the $fillable variable. When I dd( $request->all()) I can see the checkboxes having been checked and their value is 'on'. So the controller is getting the getting the values that have to be written into the database, but it's just not happening. Any ideas why?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

corona corona Joined 8 Apr 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.