]> BookStack Code Mirror - bookstack/blob - app/Providers/AppServiceProvider.php
Merge branch 'master' of https://github.com/BookStackApp/BookStack
[bookstack] / app / Providers / AppServiceProvider.php
1 <?php namespace BookStack\Providers;
2
3 use Illuminate\Support\ServiceProvider;
4 use Validator;
5
6 class AppServiceProvider extends ServiceProvider
7 {
8     /**
9      * Bootstrap any application services.
10      *
11      * @return void
12      */
13     public function boot()
14     {
15         // Custom validation methods
16         Validator::extend('is_image', function($attribute, $value, $parameters, $validator) {
17             $imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp'];
18             return in_array($value->getMimeType(), $imageMimes);
19         });
20     }
21
22     /**
23      * Register any application services.
24      *
25      * @return void
26      */
27     public function register()
28     {
29         //
30     }
31 }