2015-02-06 20:43:19 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace FireflyIII\Providers;
|
|
|
|
|
2015-05-01 08:29:41 +02:00
|
|
|
use App;
|
2015-02-11 07:35:10 +01:00
|
|
|
use FireflyIII\Support\Amount;
|
|
|
|
use FireflyIII\Support\ExpandedForm;
|
|
|
|
use FireflyIII\Support\Navigation;
|
|
|
|
use FireflyIII\Support\Preferences;
|
|
|
|
use FireflyIII\Support\Steam;
|
2015-05-02 09:06:07 +02:00
|
|
|
use FireflyIII\Support\Twig\Budget;
|
2015-05-01 22:44:35 +02:00
|
|
|
use FireflyIII\Support\Twig\General;
|
2015-05-02 11:32:45 +02:00
|
|
|
use FireflyIII\Support\Twig\Journal;
|
|
|
|
use FireflyIII\Support\Twig\PiggyBank;
|
2015-02-11 07:35:10 +01:00
|
|
|
use FireflyIII\Validation\FireflyValidator;
|
2015-02-06 20:43:19 +01:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2015-05-01 08:29:41 +02:00
|
|
|
use Twig;
|
|
|
|
use TwigBridge\Extension\Loader\Functions;
|
2015-02-08 01:15:15 +01:00
|
|
|
use Validator;
|
2015-02-06 20:43:19 +01:00
|
|
|
|
2015-02-08 01:15:15 +01:00
|
|
|
/**
|
|
|
|
* Class FireflyServiceProvider
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Providers
|
|
|
|
*/
|
2015-02-06 20:43:19 +01:00
|
|
|
class FireflyServiceProvider extends ServiceProvider
|
|
|
|
{
|
2015-02-11 07:35:10 +01:00
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
Validator::resolver(
|
|
|
|
function ($translator, $data, $rules, $messages) {
|
|
|
|
return new FireflyValidator($translator, $data, $rules, $messages);
|
|
|
|
}
|
|
|
|
);
|
2015-05-01 18:44:49 +02:00
|
|
|
/*
|
|
|
|
* Default Twig configuration:
|
|
|
|
*/
|
2015-05-01 20:17:06 +02:00
|
|
|
|
2015-05-01 18:44:49 +02:00
|
|
|
$config = App::make('config');
|
|
|
|
Twig::addExtension(new Functions($config));
|
2015-05-02 11:32:45 +02:00
|
|
|
Twig::addExtension(new PiggyBank);
|
2015-05-01 22:44:35 +02:00
|
|
|
Twig::addExtension(new General);
|
2015-05-02 11:32:45 +02:00
|
|
|
Twig::addExtension(new Journal);
|
2015-05-02 09:06:07 +02:00
|
|
|
Twig::addExtension(new Budget);
|
2015-02-08 01:15:15 +01:00
|
|
|
}
|
2015-02-11 07:35:10 +01:00
|
|
|
|
2015-02-06 20:43:19 +01:00
|
|
|
public function register()
|
|
|
|
{
|
2015-05-01 08:29:41 +02:00
|
|
|
|
|
|
|
|
2015-02-06 20:43:19 +01:00
|
|
|
$this->app->bind(
|
|
|
|
'preferences', function () {
|
2015-02-11 07:35:10 +01:00
|
|
|
return new Preferences;
|
2015-02-06 20:43:19 +01:00
|
|
|
}
|
|
|
|
);
|
2015-02-06 21:23:14 +01:00
|
|
|
$this->app->bind(
|
|
|
|
'navigation', function () {
|
2015-02-11 07:35:10 +01:00
|
|
|
return new Navigation;
|
2015-02-06 21:23:14 +01:00
|
|
|
}
|
|
|
|
);
|
2015-02-07 06:49:24 +01:00
|
|
|
$this->app->bind(
|
|
|
|
'amount', function () {
|
2015-02-11 07:35:10 +01:00
|
|
|
return new Amount;
|
2015-02-07 06:49:24 +01:00
|
|
|
}
|
|
|
|
);
|
2015-02-07 08:23:44 +01:00
|
|
|
|
|
|
|
$this->app->bind(
|
|
|
|
'steam', function () {
|
2015-02-11 07:35:10 +01:00
|
|
|
return new Steam;
|
2015-02-07 08:23:44 +01:00
|
|
|
}
|
|
|
|
);
|
2015-02-08 01:15:15 +01:00
|
|
|
$this->app->bind(
|
|
|
|
'expandedform', function () {
|
2015-02-11 07:35:10 +01:00
|
|
|
return new ExpandedForm;
|
2015-02-08 01:15:15 +01:00
|
|
|
}
|
|
|
|
);
|
2015-02-09 07:23:39 +01:00
|
|
|
|
|
|
|
$this->app->bind('FireflyIII\Repositories\Account\AccountRepositoryInterface', 'FireflyIII\Repositories\Account\AccountRepository');
|
2015-02-22 09:46:21 +01:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Budget\BudgetRepositoryInterface', 'FireflyIII\Repositories\Budget\BudgetRepository');
|
2015-02-22 16:19:32 +01:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Category\CategoryRepositoryInterface', 'FireflyIII\Repositories\Category\CategoryRepository');
|
2015-02-09 07:23:39 +01:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Journal\JournalRepositoryInterface', 'FireflyIII\Repositories\Journal\JournalRepository');
|
2015-02-25 15:19:14 +01:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Bill\BillRepositoryInterface', 'FireflyIII\Repositories\Bill\BillRepository');
|
2015-02-25 19:32:33 +01:00
|
|
|
$this->app->bind('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface', 'FireflyIII\Repositories\PiggyBank\PiggyBankRepository');
|
2015-04-05 20:47:19 +02:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface', 'FireflyIII\Repositories\Currency\CurrencyRepository');
|
2015-04-28 08:58:01 +02:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Tag\TagRepositoryInterface', 'FireflyIII\Repositories\Tag\TagRepository');
|
2015-05-03 09:55:22 +02:00
|
|
|
$this->app->bind('FireflyIII\Repositories\Reminder\ReminderRepositoryInterface', 'FireflyIII\Repositories\Reminder\ReminderRepository');
|
2015-02-27 11:09:23 +01:00
|
|
|
$this->app->bind('FireflyIII\Support\Search\SearchInterface', 'FireflyIII\Support\Search\Search');
|
2015-02-22 16:19:32 +01:00
|
|
|
|
2015-03-07 09:21:06 +01:00
|
|
|
|
2015-04-07 19:58:49 +02:00
|
|
|
$this->app->bind('FireflyIII\Helpers\Help\HelpInterface', 'FireflyIII\Helpers\Help\Help');
|
2015-03-07 09:21:06 +01:00
|
|
|
$this->app->bind('FireflyIII\Helpers\Reminders\ReminderHelperInterface', 'FireflyIII\Helpers\Reminders\ReminderHelper');
|
2015-02-23 20:25:48 +01: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 08:29:41 +02:00
|
|
|
|
2015-02-06 20:43:19 +01:00
|
|
|
}
|
|
|
|
|
2015-03-29 08:14:32 +02:00
|
|
|
}
|