1 <?php namespace BookStack\Providers;
3 use BookStack\Services\SettingService;
5 use Illuminate\Support\ServiceProvider;
8 class AppServiceProvider extends ServiceProvider
11 * Bootstrap any application services.
15 public function boot()
17 // Custom validation methods
18 Validator::extend('is_image', function ($attribute, $value, $parameters, $validator) {
19 $imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp'];
20 return in_array($value->getMimeType(), $imageMimes);
23 \Blade::directive('icon', function ($expression) {
24 return "<?php echo icon($expression); ?>";
27 // Allow longer string lengths after upgrade to utf8mb4
28 \Schema::defaultStringLength(191);
32 * Register any application services.
36 public function register()
38 $this->app->singleton(SettingService::class, function ($app) {
39 return new SettingService($app->make(Setting::class), $app->make('Illuminate\Contracts\Cache\Repository'));