form.blade.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!DOCTYPE html>
  2. <html lang="ru">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Тест Laravel</title>
  7. <style>
  8. * { margin: 0; padding: 0; box-sizing: border-box; }
  9. body {
  10. font-family: Arial, sans-serif;
  11. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  12. min-height: 100vh;
  13. display: flex;
  14. justify-content: center;
  15. align-items: center;
  16. padding: 20px;
  17. }
  18. .container {
  19. background: white;
  20. padding: 40px;
  21. border-radius: 10px;
  22. box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  23. max-width: 500px;
  24. width: 100%;
  25. }
  26. h1 {
  27. color: #333;
  28. margin-bottom: 10px;
  29. text-align: center;
  30. }
  31. .subtitle {
  32. color: #666;
  33. text-align: center;
  34. margin-bottom: 30px;
  35. font-size: 14px;
  36. }
  37. .form-group {
  38. margin-bottom: 20px;
  39. }
  40. label {
  41. display: block;
  42. margin-bottom: 5px;
  43. color: #333;
  44. font-weight: bold;
  45. }
  46. input, textarea {
  47. width: 100%;
  48. padding: 12px;
  49. border: 2px solid #e1e1e1;
  50. border-radius: 5px;
  51. font-size: 14px;
  52. transition: border-color 0.3s;
  53. }
  54. input:focus, textarea:focus {
  55. outline: none;
  56. border-color: #667eea;
  57. }
  58. textarea {
  59. resize: vertical;
  60. min-height: 100px;
  61. }
  62. .btn {
  63. width: 100%;
  64. padding: 12px;
  65. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  66. color: white;
  67. border: none;
  68. border-radius: 5px;
  69. font-size: 16px;
  70. font-weight: bold;
  71. cursor: pointer;
  72. transition: transform 0.2s;
  73. }
  74. .btn:hover {
  75. transform: translateY(-2px);
  76. }
  77. .alert {
  78. padding: 15px;
  79. border-radius: 5px;
  80. margin-bottom: 20px;
  81. }
  82. .alert-success {
  83. background: #d4edda;
  84. color: #155724;
  85. border: 1px solid #c3e6cb;
  86. }
  87. .alert-error {
  88. background: #f8d7da;
  89. color: #721c24;
  90. border: 1px solid #f5c6cb;
  91. }
  92. .error-text {
  93. color: #e74c3c;
  94. font-size: 12px;
  95. margin-top: 5px;
  96. }
  97. </style>
  98. </head>
  99. <body>
  100. <div class="container">
  101. <h1>Laravel Форма</h1>
  102. <p class="subtitle">Laravel {{ app()->version() }} | PHP {{ phpversion() }}</p>
  103. @if(session('success'))
  104. <div class="alert alert-success">
  105. {{ session('success') }}
  106. </div>
  107. @endif
  108. @if($errors->any())
  109. <div class="alert alert-error">
  110. <strong>Ошибки:</strong>
  111. <ul style="margin-top: 10px; margin-left: 20px;">
  112. @foreach($errors->all() as $error)
  113. <li>{{ $error }}</li>
  114. @endforeach
  115. </ul>
  116. </div>
  117. @endif
  118. <form action="{{ route('form.submit') }}" method="POST">
  119. @csrf
  120. <div class="form-group">
  121. <label for="name">Имя:</label>
  122. <input
  123. type="text"
  124. id="name"
  125. name="name"
  126. value="{{ old('name') }}"
  127. placeholder="Введите ваше имя"
  128. >
  129. @error('name')
  130. <div class="error-text">{{ $message }}</div>
  131. @enderror
  132. </div>
  133. <div class="form-group">
  134. <label for="email">Email:</label>
  135. <input
  136. type="email"
  137. id="email"
  138. name="email"
  139. value="{{ old('email') }}"
  140. placeholder="your@email.com"
  141. >
  142. @error('email')
  143. <div class="error-text">{{ $message }}</div>
  144. @enderror
  145. </div>
  146. <div class="form-group">
  147. <label for="message">Сообщение:</label>
  148. <textarea
  149. id="message"
  150. name="message"
  151. placeholder="Минимум 10 символов..."
  152. >{{ old('message') }}</textarea>
  153. @error('message')
  154. <div class="error-text">{{ $message }}</div>
  155. @enderror
  156. </div>
  157. <button type="submit" class="btn">
  158. Отправить форму
  159. </button>
  160. </form>
  161. </div>
  162. </body>
  163. </html>