Andrew Vanusi Andrew Vanusi - 1 year ago 127
PHP Question

How to save checkbox value to database Laravel

here's my form code :

<div class="form-group">
{{ Form::checkbox('warranty', 0, false) }}

here's my controller code :

public function save(Request $request, $obj = null) {

if (!$obj) {
$obj = new Service;
(Input::has('warranty')) ? true : false;
return $this->saveHandler($request, $obj);

it throws this error Class 'App\Http\Controllers\Input' not found

any idea ?

Answer Source

You can use request object to get the warranty input as:



Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download