7
I’m trying to make a button select
in the Blade with @foreach
to get the list of all Mysql databases. Only the @foreach
works, I can get the values, but I’m not getting to put the bases inside a select
. Is making a mistake:
htmlspecialchars() expects Parameter 1 to be string, Object Given(View: C: Generator Resources views geradors create.blade.php)
My controller:
public function create(Request $request)
{
$tables = DB::select('SHOW TABLES');
//dd($tables);
//GeradorController->criacontroller($request);
return view("geradors.create",['tables'=>$tables]);
}
My View:
<div class="col-md-2">
<div class="panel panel-default">
<div class="panel-heading">Tabelas:</div>
@foreach($tables as $table)
{{ $table }}
@endforeach
<select name="tables">
{!! Form::select('table', $table, ['class' => 'form-control']) !!}
</select>
</div>
</div>