2015-12-13 04:42:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2017-04-19 04:22:02 +00:00
|
|
|
use Illuminate\Support\Facades\Schema;
|
2015-12-13 04:42:28 +00:00
|
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
2017-04-19 04:22:02 +00:00
|
|
|
// Fix utf8mb4-related error starting from Laravel 5.4
|
|
|
|
Schema::defaultStringLength(191);
|
|
|
|
|
2015-12-13 04:42:28 +00:00
|
|
|
// Add some custom validation rules
|
2015-12-15 16:28:54 +00:00
|
|
|
Validator::extend('path.valid', function ($attribute, $value, $parameters, $validator) {
|
2015-12-14 13:22:39 +00:00
|
|
|
return is_dir($value) && is_readable($value);
|
2015-12-13 04:42:28 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
}
|