podcastartgenerator/site/app/Providers/AppServiceProvider.php

30 lines
644 B
PHP
Raw Normal View History

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\View;
use App\Models\Podcast;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Paginator::useBootstrapFive();
$publishedPodcasts = Podcast::where('published', true)->select(['name', 'slug'])->get();
View::share(['navPodcasts' => $publishedPodcasts]);
}
}