2016-09-03 13:08:58 +02:00
|
|
|
<?php namespace BookStack\Providers;
|
2015-07-12 21:01:42 +02:00
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
2016-12-31 15:38:04 +01:00
|
|
|
use Validator;
|
2015-07-12 21:01:42 +02:00
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
2016-07-01 21:11:49 +02:00
|
|
|
// Custom validation methods
|
2016-12-31 15:38:04 +01:00
|
|
|
Validator::extend('is_image', function($attribute, $value, $parameters, $validator) {
|
2016-07-01 21:11:49 +02:00
|
|
|
$imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp'];
|
|
|
|
return in_array($value->getMimeType(), $imageMimes);
|
|
|
|
});
|
2015-07-12 21:01:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
}
|