Populating dropdown menu from MySQL database

Posted 1 month ago by BarbaraTackaBa

Hello everybody! I have problem with my window modal. My code is here:

web.php

Route::resource('/admin/directory','DirectoriesController'); //Directory - routes
Route::get('/admin/directory','[email protected]');

Controller

public function getDropdown()
{
    $genders = Gender::pluck('gender', 'id');
    $statuses = Status::pluck('status', 'id');
    return view('pages.admin.modals-admin.create.add-directory', compact('genders', 'statuses'));
}

View

  <div class="form-group">
    {{Form::label('gender','Spol')}}
    {{Form::select('gender', $genders,'', ['class' => 'form-control'])}}
  </div>
  <div class="form-group">
    {{Form::label('status','Status')}}
    {{Form::select('status', $statuses,'', ['class' => 'form-control'])}}
  </div>

It works ok but it doesn't look as it should be.. It looks like plain text... It should be modal window (form) from Bootstrap... and also other links (modals) don't work... And before adding dropdown menu looked good..

What I did wrong?

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.