Sorry for my bad english.
How should I save the TINYINT fields using the checkbox in the BREAD forms?
I solved this problem as follows:
I published the controllers, then overwritten the update method in VoyagerBaseController.php
<?php
namespace App\Http\Controllers\Admin\Voyager;
use Illuminate\Http\Request;
use TCG\Voyager\Http\Controllers\VoyagerBaseController as BaseVoyagerBaseController;
class VoyagerBaseController extends BaseVoyagerBaseController
{
public function update(Request $request, $id)
{
$requestData = $request->all();
foreach ($requestData as $name=>$field) {
if ($field == 'on') {
$requestData[$name]= true;
}
if ($field == 'off') {
$requestData[$name] = false;
}
}
$request->merge($requestData);
return parent::update($request, $id);
}
}
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Most helpful comment
I solved this problem as follows:
I published the controllers, then overwritten the
updatemethod inVoyagerBaseController.php