Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2016-12-31 14:38:04 +0000
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
0eb90cb3b693c9041d32bf24523b318ae4c4a9ae
0eb90cb3
1 parent
9fe158b7
Fixed carbon locale setting
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
app/Providers/AppServiceProvider.php
app/Providers/AppServiceProvider.php
View file @
0eb90cb
<?php
namespace
BookStack\Providers
;
use
Carbon\Carbon
;
use
Illuminate\Support\ServiceProvider
;
use
Validator
;
class
AppServiceProvider
extends
ServiceProvider
{
...
...
@@ -12,12 +14,12 @@ class AppServiceProvider extends ServiceProvider
public
function
boot
()
{
// Custom validation methods
\
Validator
::
extend
(
'is_image'
,
function
(
$attribute
,
$value
,
$parameters
,
$validator
)
{
Validator
::
extend
(
'is_image'
,
function
(
$attribute
,
$value
,
$parameters
,
$validator
)
{
$imageMimes
=
[
'image/png'
,
'image/bmp'
,
'image/gif'
,
'image/jpeg'
,
'image/jpg'
,
'image/tiff'
,
'image/webp'
];
return
in_array
(
$value
->
getMimeType
(),
$imageMimes
);
});
Carbon
::
setLocale
(
Config
::
get
(
'app.locale'
));
Carbon
::
setLocale
(
config
(
'app.locale'
));
}
/**
...
...
Please
register
or
sign in
to post a comment