contrainte des images de gamme
This commit is contained in:
parent
3635e5f6c0
commit
dc5ef76bb6
3 changed files with 8 additions and 4 deletions
|
|
@ -33,7 +33,9 @@ class RangesController extends Controller
|
|||
$request->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'description' => 'required',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:max-width=' .
|
||||
config('theme.range_image_maxwidth') . ',max-height=' .
|
||||
config('theme.range_image_maxheight'),
|
||||
]);
|
||||
|
||||
$range = new Range();
|
||||
|
|
@ -70,7 +72,9 @@ class RangesController extends Controller
|
|||
$request->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'description' => 'required',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:max-width=' .
|
||||
config('theme.range_image_maxwidth') . ',max-height=' .
|
||||
config('theme.range_image_maxheight'),
|
||||
]);
|
||||
|
||||
$range = Range::findOrFail($id);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<textarea class="form-control" id="description" name="description" placeholder="Description *"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="picture">Image <small class="text-muted">- JPEG/PNG, 2Mo max.</small></label></br>
|
||||
<label for="picture">Image <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('theme.range_image_maxwidth') }} px par {{ Config::get('theme.range_image_maxheight') }} px</small></label></br>
|
||||
<input type="file" id="picture" name="picture" accept="image/png, image/jpeg">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<textarea class="form-control" id="description" name="description" placeholder="Description *">{{$range->description}}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="picture">Image <small class="text-muted">- JPEG/PNG, 2Mo max.</small></label></br>
|
||||
<label for="picture">Image <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('theme.range_image_maxwidth') }} px par {{ Config::get('theme.range_image_maxheight') }} px</small></label></br>
|
||||
<input type="file" id="picture" name="picture" accept="image/png, image/jpeg">
|
||||
@if ($range->picture !== null)
|
||||
<br/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue