ldc-com-app-bo/app/Providers/ViewServiceProvider.php
2023-03-31 15:14:48 +02:00

27 lines
700 B
PHP

<?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();
}
}
}
}