ldc-com-app-bo/app/Providers/ViewServiceProvider.php

28 lines
700 B
PHP
Raw Permalink Normal View History

2023-03-27 12:17:31 +02:00
<?php
namespace App\Providers;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\ServiceProvider;
class ViewServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
if (!app()->runningInConsole()) {
// * FORCE BOOTSTRAP PAGINATOR (or custom if in front)
// Early boot, request wont be filled as expected.
if (collect(explode('/', \request()->getPathInfo()))->get(1) === 'bo') {
Paginator::defaultview('bo.modules.pagination');
} else {
Paginator::useBootstrap();
}
}
}
}