I'm doing a search in my database, I want to get the value found and save it (are two different tables) but the value is not being saved, the number 0 is being saved.
I use this command in my controller:
$clientes = DB::table('cliente')->pluck('razaosocial', 'id');
return view('admin.contrato.create', ['cliente' => $clientes]);
And in my view I use this:
<div class="form-group col-md-5">
{{ Form::label('cliente', 'Cliente') }}
<select class="js-example-basic-multiple" name="cliente_id" >
<option selected>Selecione o cliente</option>
@foreach ($cliente as $cli)
<option value="{{ $cli }}">{{ $cli }}</option>
@endforeach
</select>
</div>
When I use this the data appears to me, but I can not save it. I do not handle a lot of PHP, does anyone know how I can solve it?