mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Implement first version of the new rule engine.
This commit is contained in:
@@ -63,6 +63,8 @@ use FireflyIII\Support\Navigation;
|
||||
use FireflyIII\Support\Preferences;
|
||||
use FireflyIII\Support\Steam;
|
||||
use FireflyIII\Support\Telemetry;
|
||||
use FireflyIII\TransactionRules\Engine\RuleEngineInterface;
|
||||
use FireflyIII\TransactionRules\Engine\SearchRuleEngine;
|
||||
use FireflyIII\Validation\FireflyValidator;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
@@ -192,6 +194,19 @@ class FireflyServiceProvider extends ServiceProvider
|
||||
}
|
||||
);
|
||||
|
||||
$this->app->bind(
|
||||
RuleEngineInterface::class,
|
||||
static function (Application $app) {
|
||||
/** @var SearchRuleEngine $engine */
|
||||
$engine = app(SearchRuleEngine::class);
|
||||
if ($app->auth->check()) {
|
||||
$engine->setUser(auth()->user());
|
||||
}
|
||||
|
||||
return $engine;
|
||||
}
|
||||
);
|
||||
|
||||
// more generators:
|
||||
$this->app->bind(PopupReportInterface::class, PopupReport::class);
|
||||
$this->app->bind(HelpInterface::class, Help::class);
|
||||
|
Reference in New Issue
Block a user