koel/app/Providers/AppServiceProvider.php

33 lines
645 B
PHP
Raw Normal View History

2015-12-13 04:42:28 +00:00
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
// Add some custom validation rules
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()
{
//
}
}