. */ declare(strict_types=1); namespace FireflyIII\Support\Events; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Bill\BillRepositoryInterface; /** * Class BillScanner. */ class BillScanner { /** * @param TransactionJournal $journal */ public static function scan(TransactionJournal $journal) { /** @var BillRepositoryInterface $repository */ $repository = app(BillRepositoryInterface::class); $list = $journal->user->bills()->where('active', 1)->where('automatch', 1)->get(); /** @var \FireflyIII\Models\Bill $bill */ foreach ($list as $bill) { $repository->scan($bill, $journal); } } }