BookStack/app/Providers/AppServiceProvider.php

32 lines
729 B
PHP
Raw Normal View History

<?php namespace BookStack\Providers;
2015-07-12 15:01:42 -04:00
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
// 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-12 15:01:42 -04:00
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}