31 lines
801 B
PHP
31 lines
801 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.
|
||
|
|
switch (collect(explode('/', \request()->getPathInfo()))->get(1)) {
|
||
|
|
case 'bo':
|
||
|
|
Paginator::defaultView('bo.modules.pagination');
|
||
|
|
break;
|
||
|
|
default:
|
||
|
|
Paginator::useBootstrapFive();
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
} //end if
|
||
|
|
}
|
||
|
|
}
|