22
33namespace NotFound \Framework ;
44
5+ use Illuminate \Console \Command ;
56use Illuminate \Notifications \Messages \MailMessage ;
67use Illuminate \Support \Facades \App ;
8+ use Illuminate \Support \Facades \Artisan ;
79use Illuminate \Support \Facades \Blade ;
810use Illuminate \Support \ServiceProvider ;
911use NotFound \Framework \Auth \Notifications \VerifyEmail ;
1012use NotFound \Framework \Models \Lang ;
13+ use NotFound \Framework \Services \CmsExchange \ExchangeConsoleService ;
14+ use NotFound \Framework \Services \Indexer \IndexBuilderService ;
1115use NotFound \Framework \View \Components \ConfigurationCheck ;
1216use NotFound \Framework \View \Components \Forms \Form ;
1317
@@ -17,7 +21,21 @@ public function boot(): void
1721 {
1822 $ this ->loadMigrationsFrom (__DIR__ .'/../database/migrations ' );
1923 $ this ->loadRoutesFrom (__DIR__ .'/../routes/api.php ' );
20- $ this ->loadRoutesFrom (__DIR__ .'/../routes/console.php ' );
24+ $ this ->commands ([
25+ Artisan::command ('siteboss:index-site {--debug : Display debug messages} {--fresh : Empty local search table} ' , function ($ debug , $ fresh ) {
26+ $ indexer = new IndexBuilderService ($ debug , $ fresh );
27+ $ indexer ->run ();
28+
29+ return Command::SUCCESS ;
30+ })->purpose ('Index site for local search ' ),
31+
32+ Artisan::command ('siteboss:cms-import {--debug : Display debug messages} {--dry : Dry Run} ' , function ($ debug , $ dry ) {
33+ $ exchanger = new ExchangeConsoleService ($ debug , $ dry );
34+ $ exchanger ->import ();
35+
36+ return Command::SUCCESS ;
37+ })->purpose ('Import CMS changes to the database ' ),
38+ ]);
2139 $ this ->loadViewsFrom (__DIR__ .'/../resources/views ' , 'siteboss ' );
2240 $ this ->loadTranslationsFrom (__DIR__ .'/../lang ' , 'siteboss ' );
2341
0 commit comments