mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Fixes issue with the validation message not being translated.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
This commit is contained in:
parent
c44c42103c
commit
f42d355fd7
@ -120,7 +120,7 @@ class ImageController extends Controller
|
|||||||
{
|
{
|
||||||
$this->checkPermission('image-create-all');
|
$this->checkPermission('image-create-all');
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'file' => 'is_image'
|
'file' => 'image'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!$this->imageRepo->isValidType($type)) {
|
if (!$this->imageRepo->isValidType($type)) {
|
||||||
|
@ -15,7 +15,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
// Custom validation methods
|
// Custom validation methods
|
||||||
Validator::extend('is_image', function ($attribute, $value, $parameters, $validator) {
|
Validator::extend('image', function ($attribute, $value, $parameters, $validator) {
|
||||||
$imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp'];
|
$imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp'];
|
||||||
return in_array($value->getMimeType(), $imageMimes);
|
return in_array($value->getMimeType(), $imageMimes);
|
||||||
});
|
});
|
||||||
|
@ -37,7 +37,7 @@ return [
|
|||||||
'email' => 'The :attribute must be a valid email address.',
|
'email' => 'The :attribute must be a valid email address.',
|
||||||
'filled' => 'The :attribute field is required.',
|
'filled' => 'The :attribute field is required.',
|
||||||
'exists' => 'The selected :attribute is invalid.',
|
'exists' => 'The selected :attribute is invalid.',
|
||||||
'image' => 'The :attribute must be an image.',
|
'image' => 'The :attribute must be an image.',
|
||||||
'in' => 'The selected :attribute is invalid.',
|
'in' => 'The selected :attribute is invalid.',
|
||||||
'integer' => 'The :attribute must be an integer.',
|
'integer' => 'The :attribute must be an integer.',
|
||||||
'ip' => 'The :attribute must be a valid IP address.',
|
'ip' => 'The :attribute must be a valid IP address.',
|
||||||
|
Loading…
Reference in New Issue
Block a user