2015-07-13 03:01:42 +08:00
|
|
|
<?php
|
|
|
|
|
2015-09-11 02:31:09 +08:00
|
|
|
namespace BookStack\Providers;
|
2015-07-13 03:01:42 +08:00
|
|
|
|
2015-08-29 22:03:42 +08:00
|
|
|
use Illuminate\Support\Facades\Auth;
|
2015-07-13 03:01:42 +08:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2015-09-11 02:31:09 +08:00
|
|
|
use BookStack\User;
|
2015-07-13 03:01:42 +08:00
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
2016-07-02 03:11:49 +08:00
|
|
|
// Custom validation methods
|
|
|
|
\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);
|
|
|
|
});
|
|
|
|
|
2015-07-13 03:01:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
}
|