create.blade.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!--
  2. Copyright (C) 2022 Echedey López Romero <elr@disroot.org>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. -->
  14. @extends('layouts.app')
  15. @section('content')
  16. <div class="container">
  17. <div class="row mb-3">
  18. <h1 class="col-12 mb-0 text-center">User creation</h1>
  19. </div>
  20. @if ($errors->any())
  21. <div class = "row mb-3">
  22. <div class="col-xl-6 col-lg-8 col-md-10 col-12 mx-auto alert alert-danger">
  23. <div class="container">
  24. <div class="row mb-2">
  25. <span class="col-12 text-center"><strong>Whoops!</strong> There were some problems with your input.</span>
  26. </div>
  27. <div class="row">
  28. <ul class="col-12 mb-0">
  29. @foreach ($errors->all() as $error)
  30. <li>{{ $error }}</li>
  31. @endforeach
  32. </ul>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. @endif
  38. <div class="row">
  39. <form class="col-xl-6 col-lg-8 col-md-10 col-12 mx-auto" action="{{ route('users.store') }}" method="POST" enctype="multipart/form-data">
  40. @csrf
  41. <div class="container">
  42. <div class="row mb-3">
  43. <div class="form-group col-12">
  44. <label class="form-label" for="name">Name</label>
  45. <input class="form-control" type="text" id="name" name="name" value="{{ old('name') }}" required=""/>
  46. </div>
  47. </div>
  48. <div class="row mb-3">
  49. <div class="form-group col-12">
  50. <label class="form-label" for="email">E-Mail</label>
  51. <input class="form-control" type="email" id="email" name="email" value="{{ old('email') }}" required=""/>
  52. </div>
  53. </div>
  54. <div class="row mb-3">
  55. <div class="form-group col-12">
  56. <label class="form-label" for="password">Password</label>
  57. <input class="form-control" type="password" id="password" name="password" value="{{ old('password') }}" required=""/>
  58. </div>
  59. </div>
  60. <div class="row mb-3">
  61. <div class="form-group col-12">
  62. <label class="form-label" for="Image">Image</label>
  63. <input class="form-control" type="file" id="image" name="image"/>
  64. </div>
  65. </div>
  66. <div class="row mb-3">
  67. <div class="col-12 px-0">
  68. <div class="container">
  69. <div class="row mb-2">
  70. <div class="col-12 px-0">
  71. <span class="fst-normal">Default image</span>
  72. </div>
  73. </div>
  74. <div class="row">
  75. <img src="/data/images/users/default_picture.webp" class="col-xl-8 col-lg-10 col-12 px-0 img-thumbnail" alt="Default user"/>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="row mb-3">
  81. <div class="col-12">
  82. <label class="form-label" for="role">Role</label>
  83. <select class="form-control" id="role" name="role_id" required="">
  84. <option value="">-- Choose --</option>
  85. @foreach ($roles as $role)
  86. @if ($role->id . '' === old('role_id'))
  87. <option value="{{ $role->id }}" selected="">{{ $role->name }}</option>
  88. @else
  89. <option value="{{ $role->id }}">{{ $role->name }}</option>
  90. @endif
  91. @endforeach
  92. </select>
  93. </div>
  94. </div>
  95. <div class="row">
  96. <div class="col-lg-6 col-12 mb-lg-0 mb-2">
  97. <div class="d-grid gap-2">
  98. <button type="submit" class="btn btn-primary">Add</button>
  99. </div>
  100. </div>
  101. <div class="col-lg-6 col-12">
  102. <div class="d-grid gap-2">
  103. <button type="reset" class="btn btn-danger">Reset</button>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </form>
  109. </div>
  110. </div>
  111. @endsection