Feat: Updating routes and controllers to use the updated Services coming from boboko/core

This commit is contained in:
2026-08-29 00:17:34 +03:00
parent defe1dab12
commit c7cd1138fe
9 changed files with 48 additions and 22 deletions
+16
View File
@@ -6,9 +6,14 @@
use App\Models\Staff;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\View as ViewInstance;
use Lunar\Facades\ModelManifest;
use Lunar\Facades\Telemetry;
use Modules\Core\Catalog\DTOs\CollectionFilters;
use Modules\Core\Catalog\Enums\CollectionSort;
use Modules\Core\Catalog\Services\CollectionService;
class AppServiceProvider extends ServiceProvider
{
@@ -16,6 +21,17 @@ public function boot(): void
{
Telemetry::optOut();
// header.blade.php's category dropdown — root collections only, resolved
// per-request so the composer runs after `locale` middleware has already
// set App::getLocale(), which CollectionService's name resolution depends on.
View::composer('components.header', function (ViewInstance $view) {
$view->with('categories', app(CollectionService::class)->list(
filters: new CollectionFilters(rootOnly: true),
perPage: 100,
sort: CollectionSort::Position,
)->items());
});
if ($this->app->environment('production')) {
URL::forceScheme('https');
}