blue-twilight/app/Providers/AppServiceProvider.php
Andy Heathershaw e7fbdaaa66 BLUE-1: A default local storage location is created on install that cannot be deleted. Storage locations can be made inactive and no new albums can be created against them.
BLUE-3: Validation is now performed on the file path selected.

Tweaks to the storage locations form to display validation errors against the correct fields.
2016-10-27 11:36:37 +01:00

53 lines
1.3 KiB
PHP

<?php
namespace App\Providers;
use App\Helpers\ConfigHelper;
use App\Helpers\ImageHelper;
use App\Helpers\ThemeHelper;
use App\Helpers\ValidationHelper;
use Illuminate\Database\QueryException;
use Illuminate\Mail\Mailer;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
$this->app->singleton('image', function ($app)
{
return new ImageHelper();
});
$this->app->singleton('theme', function ($app)
{
return new ThemeHelper();
});
$this->app->singleton('user_config', function ($app)
{
return new ConfigHelper();
});
Validator::extend('is_dir', (ValidationHelper::class . '@directoryExists'));
Validator::extend('dir_empty', (ValidationHelper::class . '@isDirectoryEmpty'));
Validator::extend('is_writeable', (ValidationHelper::class . '@isPathWriteable'));
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}