Advertisement
Guest User

Untitled

a guest
Mar 4th, 2021
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. Вьюшка ===============================
  2.  
  3. <div class="col-5 mt-5">
  4. <form action="{{route('pgztool.create_new')}}" method="POST">
  5. @csrf
  6. @if($dataForSelect)
  7. <label for="users">Выбрать проект</label>
  8. <select class="form-control color_label" name="project_id" id="project" onchange="check()">
  9. <option default="project" value="false">Выберите проект</option>
  10. @foreach($dataForSelect as $value)
  11. <option value="{{ $value['id'] }}">{{$value['title']}}</option>
  12. @endforeach
  13. </select>
  14. <br>
  15. <label for="users">Выбрать инструмент</label>
  16. <select class="form-control" name="tool" id="tools" disabled onchange="check_tools()">
  17. @foreach($dataForSelect as $tools)
  18. @foreach($tools['available_tools'] as $availableTool)
  19. <option value="{{$availableTool}}">{{$availableTool}}</option>
  20. @endforeach
  21. @endforeach
  22. </select>
  23. <button type="submit" class="btn btn-warning mt-4">Создать</button>
  24. @else
  25. <p class="bg-warning mt-3 tools_message">Выпадающие списки будут доступны после создания хотя бы одного проекта!</p>
  26. @endif
  27. </form>
  28. </div>
  29.  
  30. То что приходит с контроллера ========================
  31.  
  32. array:2 [▼
  33. 1 => array:3 [▼
  34. "id" => 1
  35. "title" => "Test project"
  36. "available_tools" => array:4 [▼
  37. 0 => "App\Models\AdministrativeBudgetTool"
  38. 1 => "App\Models\ContractPaymentRegisterTool"
  39. 2 => "App\Models\PaymentReportTool"
  40. 4 => "App\Models\PgzTool"
  41. ]
  42. ]
  43. 2 => array:3 [▼
  44. "id" => 2
  45. "title" => "Project 2"
  46. "available_tools" => array:5 [▼
  47. 0 => "App\Models\AdministrativeBudgetTool"
  48. 1 => "App\Models\ContractPaymentRegisterTool"
  49. 2 => "App\Models\PaymentReportTool"
  50. 3 => "App\Models\RegisterOfContractsTool"
  51. 4 => "App\Models\PgzTool"
  52. ]
  53. ]
  54. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement