2015-02-06 13:43:19 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace FireflyIII\Providers;
|
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
use FireflyIII\Support\Amount;
|
|
|
|
use FireflyIII\Support\ExpandedForm;
|
|
|
|
use FireflyIII\Support\Navigation;
|
|
|
|
use FireflyIII\Support\Preferences;
|
|
|
|
use FireflyIII\Support\Steam;
|
2015-05-02 02:06:07 -05:00
|
|
|
use FireflyIII\Support\Twig\Budget;
|
2015-05-01 15:44:35 -05:00
|
|
|
use FireflyIII\Support\Twig\General;
|
2015-05-02 04:32:45 -05:00
|
|
|
use FireflyIII\Support\Twig\Journal;
|
|
|
|
use FireflyIII\Support\Twig\PiggyBank;
|
2015-05-14 02:51:54 -05:00
|
|
|
use FireflyIII\Support\Twig\Translation;
|
2015-02-11 00:35:10 -06:00
|
|
|
use FireflyIII\Validation\FireflyValidator;
|
2015-02-06 13:43:19 -06:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2015-05-01 01:29:41 -05:00
|
|
|
use Twig;
|
|
|
|
use TwigBridge\Extension\Loader\Functions;
|
2015-02-07 18:15:15 -06:00
|
|
|
use Validator;
|
2015-02-06 13:43:19 -06:00
|
|
|
|
2015-02-07 18:15:15 -06:00
|
|
|
/**
|
|
|
|
* Class FireflyServiceProvider
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Providers
|
2015-05-25 12:58:13 -05:00
|
|
|
* @codeCoverageIgnore
|
2015-02-07 18:15:15 -06:00
|
|
|
*/
|
2015-02-06 13:43:19 -06:00
|
|
|
class FireflyServiceProvider extends ServiceProvider
|
|
|
|
{
|
2015-02-11 00:35:10 -06:00
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
Validator::resolver(
|
2015-06-06 16:09:12 -05:00
|
|
|
function ($translator, $data, $rules, $messages) {
|
2015-02-11 00:35:10 -06:00
|
|
|
return new FireflyValidator($translator, $data, $rules, $messages);
|
|
|
|
}
|
|
|
|
);
|
2015-05-01 11:44:49 -05:00
|
|
|
/*
|
|
|
|
* Default Twig configuration:
|
|
|
|
*/
|
2015-05-01 13:17:06 -05:00
|
|
|
|
2015-07-07 12:09:45 -05:00
|
|
|
$config = app('config');
|
2015-05-01 11:44:49 -05:00
|
|
|
Twig::addExtension(new Functions($config));
|
2015-05-02 04:32:45 -05:00
|
|
|
Twig::addExtension(new PiggyBank);
|
2015-05-01 15:44:35 -05:00
|
|
|
Twig::addExtension(new General);
|
2015-05-02 04:32:45 -05:00
|
|
|
Twig::addExtension(new Journal);
|
2015-05-02 02:06:07 -05:00
|
|
|
Twig::addExtension(new Budget);
|
2015-05-09 15:42:45 -05:00
|
|
|
Twig::addExtension(new Translation);
|
2015-02-07 18:15:15 -06:00
|
|
|
}
|
2015-02-11 00:35:10 -06:00
|
|
|
|
2015-05-17 03:30:18 -05:00
|
|
|
/**
|
2016-01-02 09:31:14 -06:00
|
|
|
*
|
2015-05-17 03:30:18 -05:00
|
|
|
*/
|
2015-02-06 13:43:19 -06:00
|
|
|
public function register()
|
|
|
|
{
|
2015-05-01 01:29:41 -05:00
|
|
|
|
|
|
|
|
2015-02-06 13:43:19 -06:00
|
|
|
$this->app->bind(
|
2015-06-06 16:09:12 -05:00
|
|
|
'preferences', function () {
|
2015-02-11 00:35:10 -06:00
|
|
|
return new Preferences;
|
2015-02-06 13:43:19 -06:00
|
|
|
}
|
|
|
|
);
|
2015-02-06 14:23:14 -06:00
|
|
|
$this->app->bind(
|
2015-06-06 16:09:12 -05:00
|
|
|
'navigation', function () {
|
2015-02-11 00:35:10 -06:00
|
|
|
return new Navigation;
|
2015-02-06 14:23:14 -06:00
|
|
|
}
|
|
|
|
);
|
2015-02-06 23:49:24 -06:00
|
|
|
$this->app->bind(
|
2015-06-06 16:09:12 -05:00
|
|
|
'amount', function () {
|
2015-02-11 00:35:10 -06:00
|
|
|
return new Amount;
|
2015-02-06 23:49:24 -06:00
|
|
|
}
|
|
|
|
);
|
2015-02-07 01:23:44 -06:00
|
|
|
|
|
|
|
$this->app->bind(
|
2015-06-06 16:09:12 -05:00
|
|
|
'steam', function () {
|
2015-02-11 00:35:10 -06:00
|
|
|
return new Steam;
|
2015-02-07 01:23:44 -06:00
|
|
|
}
|
|
|
|
);
|
2015-02-07 18:15:15 -06:00
|
|
|
$this->app->bind(
|
2015-06-06 16:09:12 -05:00
|
|
|
'expandedform', function () {
|
2015-02-11 00:35:10 -06:00
|
|
|
return new ExpandedForm;
|
2015-02-07 18:15:15 -06:00
|
|
|
}
|
|
|
|
);
|
2015-02-09 00:23:39 -06:00
|
|
|
|
|
|
|
$this->app->bind('FireflyIII\Repositories\Account\AccountRepositoryInterface', 'FireflyIII\Repositories\Account\AccountRepository');
|
2015-02-22 02:46:21 -06:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Budget\BudgetRepositoryInterface', 'FireflyIII\Repositories\Budget\BudgetRepository');
|
2015-02-22 09:19:32 -06:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Category\CategoryRepositoryInterface', 'FireflyIII\Repositories\Category\CategoryRepository');
|
2015-12-29 15:51:31 -06:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface', 'FireflyIII\Repositories\Category\SingleCategoryRepository');
|
2015-02-09 00:23:39 -06:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Journal\JournalRepositoryInterface', 'FireflyIII\Repositories\Journal\JournalRepository');
|
2015-02-25 08:19:14 -06:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Bill\BillRepositoryInterface', 'FireflyIII\Repositories\Bill\BillRepository');
|
2015-02-25 12:32:33 -06:00
|
|
|
$this->app->bind('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface', 'FireflyIII\Repositories\PiggyBank\PiggyBankRepository');
|
2015-04-05 13:47:19 -05:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface', 'FireflyIII\Repositories\Currency\CurrencyRepository');
|
2015-04-28 01:58:01 -05:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Tag\TagRepositoryInterface', 'FireflyIII\Repositories\Tag\TagRepository');
|
2015-07-19 02:37:28 -05:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface', 'FireflyIII\Repositories\Attachment\AttachmentRepository');
|
2015-02-27 04:09:23 -06:00
|
|
|
$this->app->bind('FireflyIII\Support\Search\SearchInterface', 'FireflyIII\Support\Search\Search');
|
2015-02-22 09:19:32 -06:00
|
|
|
|
2015-07-04 23:18:02 -05:00
|
|
|
// CSV import
|
|
|
|
$this->app->bind('FireflyIII\Helpers\Csv\WizardInterface', 'FireflyIII\Helpers\Csv\Wizard');
|
|
|
|
|
2015-07-18 02:49:59 -05:00
|
|
|
// attachments
|
|
|
|
$this->app->bind('FireflyIII\Helpers\Attachments\AttachmentHelperInterface', 'FireflyIII\Helpers\Attachments\AttachmentHelper');
|
|
|
|
|
2015-06-29 00:17:39 -05:00
|
|
|
// make charts:
|
2015-06-27 10:05:39 -05:00
|
|
|
$this->app->bind('FireflyIII\Generator\Chart\Account\AccountChartGenerator', 'FireflyIII\Generator\Chart\Account\ChartJsAccountChartGenerator');
|
2015-06-27 10:32:52 -05:00
|
|
|
$this->app->bind('FireflyIII\Generator\Chart\Bill\BillChartGenerator', 'FireflyIII\Generator\Chart\Bill\ChartJsBillChartGenerator');
|
2015-06-27 10:05:39 -05:00
|
|
|
$this->app->bind('FireflyIII\Generator\Chart\Budget\BudgetChartGenerator', 'FireflyIII\Generator\Chart\Budget\ChartJsBudgetChartGenerator');
|
2015-06-27 10:32:52 -05:00
|
|
|
$this->app->bind('FireflyIII\Generator\Chart\Category\CategoryChartGenerator', 'FireflyIII\Generator\Chart\Category\ChartJsCategoryChartGenerator');
|
2015-06-27 13:52:06 -05:00
|
|
|
$this->app->bind('FireflyIII\Generator\Chart\PiggyBank\PiggyBankChartGenerator', 'FireflyIII\Generator\Chart\PiggyBank\ChartJsPiggyBankChartGenerator');
|
2015-06-27 13:39:50 -05:00
|
|
|
$this->app->bind('FireflyIII\Generator\Chart\Report\ReportChartGenerator', 'FireflyIII\Generator\Chart\Report\ChartJsReportChartGenerator');
|
2015-06-27 01:18:47 -05:00
|
|
|
|
2015-03-07 02:21:06 -06:00
|
|
|
|
2015-04-07 12:58:49 -05:00
|
|
|
$this->app->bind('FireflyIII\Helpers\Help\HelpInterface', 'FireflyIII\Helpers\Help\Help');
|
2015-02-23 13:25:48 -06:00
|
|
|
$this->app->bind('FireflyIII\Helpers\Report\ReportHelperInterface', 'FireflyIII\Helpers\Report\ReportHelper');
|
|
|
|
$this->app->bind('FireflyIII\Helpers\Report\ReportQueryInterface', 'FireflyIII\Helpers\Report\ReportQuery');
|
|
|
|
|
2015-05-01 01:29:41 -05:00
|
|
|
|
2015-02-06 13:43:19 -06:00
|
|
|
}
|
|
|
|
|
2015-03-29 01:14:32 -05:00
|
|
|
}
|