2016-09-01 16:23:39 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2016-09-05 15:28:56 +01:00
|
|
|
use App\Helpers\ConfigHelper;
|
2016-09-03 17:09:49 +01:00
|
|
|
use App\Helpers\ImageHelper;
|
2016-09-02 10:42:05 +01:00
|
|
|
use App\Helpers\ThemeHelper;
|
2016-10-27 11:36:37 +01:00
|
|
|
use App\Helpers\ValidationHelper;
|
2016-09-02 21:27:50 +01:00
|
|
|
use Illuminate\Database\QueryException;
|
2016-09-06 14:19:16 +01:00
|
|
|
use Illuminate\Mail\Mailer;
|
2016-09-21 12:10:37 +01:00
|
|
|
use Illuminate\Support\Facades\DB;
|
2016-10-27 11:36:37 +01:00
|
|
|
use Illuminate\Support\Facades\Validator;
|
2016-09-02 10:42:05 +01:00
|
|
|
use Illuminate\Support\Facades\View;
|
2016-09-01 16:23:39 +01:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
2016-10-01 14:45:48 +01:00
|
|
|
$this->app->singleton('image', function ($app)
|
2016-09-03 17:09:49 +01:00
|
|
|
{
|
2016-10-01 14:45:48 +01:00
|
|
|
return new ImageHelper();
|
|
|
|
});
|
|
|
|
$this->app->singleton('theme', function ($app)
|
|
|
|
{
|
|
|
|
return new ThemeHelper();
|
|
|
|
});
|
|
|
|
$this->app->singleton('user_config', function ($app)
|
|
|
|
{
|
|
|
|
return new ConfigHelper();
|
|
|
|
});
|
2016-10-27 11:36:37 +01:00
|
|
|
|
|
|
|
Validator::extend('is_dir', (ValidationHelper::class . '@directoryExists'));
|
|
|
|
Validator::extend('dir_empty', (ValidationHelper::class . '@isDirectoryEmpty'));
|
|
|
|
Validator::extend('is_writeable', (ValidationHelper::class . '@isPathWriteable'));
|
2016-09-01 16:23:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
}
|