2022-09-27 09:48:05 +08:00
|
|
|
<?php
|
|
|
|
|
2023-05-18 00:56:55 +08:00
|
|
|
namespace BookStack\App\Providers;
|
2022-09-27 09:48:05 +08:00
|
|
|
|
|
|
|
use BookStack\Entities\BreadcrumbsViewComposer;
|
|
|
|
use Illuminate\Pagination\Paginator;
|
|
|
|
use Illuminate\Support\Facades\Blade;
|
|
|
|
use Illuminate\Support\Facades\View;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
class ViewTweaksServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
// Set paginator to use bootstrap-style pagination
|
|
|
|
Paginator::useBootstrap();
|
|
|
|
|
|
|
|
// View Composers
|
|
|
|
View::composer('entities.breadcrumbs', BreadcrumbsViewComposer::class);
|
|
|
|
|
|
|
|
// Custom blade view directives
|
|
|
|
Blade::directive('icon', function ($expression) {
|
2023-09-17 01:25:08 +08:00
|
|
|
return "<?php echo (new \BookStack\Util\SvgIcon($expression))->toHtml(); ?>";
|
2022-09-27 09:48:05 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|