Undefined variable: editor (View: /home/marco/prova/resources/views/home.blade.php) - development

Undefined variable: editor (View: /home/marco/prova/resources/views/home.blade.php)

I have a problem, blade not find the variable: editor.
This is the function of my Controller.

public function HomeText()
{
    $data = [];
    $data['editor'] = Editore::get();

    return view('home')->with($data);
}

And these are the instructions in the file blade.php:

<select class="form-control select_editore">
@foreach ($editor as $editore)
<option></option>
@endforeach  </select>

What is the error?
I hope that you help me!
I’m newbie with Laravel,
I want to understand where I’m wrong.



from Laravel Questions and Answers https://laravelquestions.com/php/undefined-variable-editor-view-home-marco-prova-resources-views-home-blade-php/
via Lzo Media

Comments

Popular posts from this blog

ng-include of inline SVG does not display gradient except in Chrome

Using PHP and MySQL data to generate PDF letters like in MS Word mailmerge functionality - development

ng-show doesn’t work correct with value boolean