FEATURE: add registering for new search engines.
This commit is contained in:
@@ -2,9 +2,12 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Handlers\Registrators\SearchEngineRegistrator;
|
||||
use App\Handlers\Registrators\SettingsExtensionRegistrator;
|
||||
use App\Handlers\Registrators\TemplateRegistrator;
|
||||
use App\Handlers\Registrators\WidgetRegistrator;
|
||||
use App\Handlers\Search\Content;
|
||||
use App\Handlers\Search\Presenters\Content as ContentPresenter;
|
||||
use App\Widgets\HtmlCode\HtmlCode;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -20,6 +23,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
$this->registerWidgets();
|
||||
$this->registerTemplates();
|
||||
$this->registerSettings();
|
||||
$this->registerSearch();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,6 +55,10 @@ class AppServiceProvider extends ServiceProvider
|
||||
$this->app->singleton('registerSettingsExtension', function ($app) {
|
||||
return new SettingsExtensionRegistrator($app);
|
||||
});
|
||||
|
||||
$this->app->singleton('registerSearchEngine', function ($app) {
|
||||
return new SearchEngineRegistrator($app);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,4 +99,14 @@ class AppServiceProvider extends ServiceProvider
|
||||
$registrator->register('basic', 'admin/settings.basic', 'admin.settings.parts.basic');
|
||||
$registrator->register('meta', 'admin/settings.meta', 'admin.settings.parts.meta');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register callbacks used for searching
|
||||
*/
|
||||
private function registerSearch()
|
||||
{
|
||||
$registrator = $this->app->make('registerSearchEngine');
|
||||
|
||||
$registrator->register(new Content(), new ContentPresenter());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user