eimkasp

Laravel select example blade

Nov 23rd, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.73 KB | None | 0 0
  1. @extends("layouts.app")
  2.  
  3. {{-- Idomusis budas --}}
  4. @section("content")
  5.     // Turinys
  6.     {{ Form::open(['route' => ['dish.update']]) }}
  7.  
  8.  
  9.     {{Form::select('menu_id', $selectMenus, $dish->menu_id) }}
  10. @endsection
  11.  
  12. {{-- Senasis budas --}}
  13. @section("content")
  14.     <form action="">
  15.  
  16.         <input type="text" name="title">
  17.         <select name="menu_id">
  18.             @foreach($menus as $menu)
  19.                 @if($dish->menu_id == $menu->id)
  20.                     <option selected value="{{ $menu->id }}}">{{ $menu->title }}}</option>
  21.                 @else
  22.                     <option value="{{ $menu->id }}}">{{ $menu->title }}}</option>
  23.                 @endif
  24.             @endforeach
  25.         </select>
  26.  
  27.     </form>
  28. @endsection
Add Comment
Please, Sign In to add comment