Feat: Увеличены лимиты для обложек курсов

 Мин. размеры: 400x300px
 Макс. размеры: 3000x2000px
 Макс. размер файла: 10MB
 Обновлены подсказки в формах

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
mirivlad 2026-03-26 12:34:25 +08:00
parent 5ee549fbd1
commit 65cb891658
3 changed files with 8 additions and 8 deletions

View File

@ -64,15 +64,15 @@ class CourseController extends Controller
'objectives' => 'nullable|string',
'category_id' => 'nullable|exists:course_categories,id',
'type' => 'required|in:standard,scorm,h5p',
'thumbnail' => 'nullable|image|mimes:jpeg,png,jpg,webp|max:2048|dimensions:min_width=400,min_height=300',
'thumbnail' => 'nullable|image|mimes:jpeg,png,jpg,webp|max:10240|dimensions:min_width=400,min_height=300,max_width=3000,max_height=2000',
'duration_minutes' => 'nullable|integer',
'passing_score' => 'nullable|integer|min:0|max:100',
'has_certificate' => 'boolean',
'is_active' => 'boolean',
], [
'thumbnail.dimensions' => 'Изображение должно быть не менее 400x300 пикселей. Ваш размер: :width x :height px',
'thumbnail.dimensions' => 'Изображение должно быть от 400x300 до 3000x2000 пикселей. Ваш размер: :width x :height px',
'thumbnail.mimes' => 'Допустимые форматы: JPEG, PNG, WebP',
'thumbnail.max' => 'Максимальный размер файла: 2MB',
'thumbnail.max' => 'Максимальный размер файла: 10MB',
]);
$validated['slug'] = $validated['slug'] ?? Str::slug($validated['title']);
@ -118,15 +118,15 @@ class CourseController extends Controller
'objectives' => 'nullable|string',
'category_id' => 'nullable|exists:course_categories,id',
'type' => 'required|in:standard,scorm,h5p',
'thumbnail' => 'nullable|image|mimes:jpeg,png,jpg,webp|max:2048|dimensions:min_width=400,min_height=300',
'thumbnail' => 'nullable|image|mimes:jpeg,png,jpg,webp|max:10240|dimensions:min_width=400,min_height=300,max_width=3000,max_height=2000',
'duration_minutes' => 'nullable|integer',
'passing_score' => 'nullable|integer|min:0|max:100',
'has_certificate' => 'boolean',
'is_active' => 'boolean',
], [
'thumbnail.dimensions' => 'Изображение должно быть не менее 400x300 пикселей. Ваш размер: :width x :height px',
'thumbnail.dimensions' => 'Изображение должно быть от 400x300 до 3000x2000 пикселей. Ваш размер: :width x :height px',
'thumbnail.mimes' => 'Допустимые форматы: JPEG, PNG, WebP',
'thumbnail.max' => 'Максимальный размер файла: 2MB',
'thumbnail.max' => 'Максимальный размер файла: 10MB',
]);
$validated['slug'] = $validated['slug'] ?? Str::slug($validated['title']);

View File

@ -75,7 +75,7 @@
<div class="mb-3">
<label class="form-label">Обложка</label>
<input type="file" name="thumbnail" class="form-control" accept="image/*">
<small class="text-muted">Мин. 400x300px, макс. 2MB, форматы: JPEG, PNG, WebP</small>
<small class="text-muted">400x300 - 3000x2000px, макс. 10MB, форматы: JPEG, PNG, WebP</small>
</div>
</div>
</div>

View File

@ -73,7 +73,7 @@
<label class="form-label">Обложка</label>
<input type="file" name="thumbnail" class="form-control" accept="image/*">
@if($course->thumbnail)<small class="text-muted d-block">Текущая: {{ basename($course->thumbnail) }}</small>@endif
<small class="text-muted">Мин. 400x300px, макс. 2MB, форматы: JPEG, PNG, WebP</small>
<small class="text-muted">400x300 - 3000x2000px, макс. 10MB, форматы: JPEG, PNG, WebP</small>
</div>
</div>
</div>