CasperSecurity
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Auth;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
if ($this->app->environment('local')) {
// $this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
// $this->app->register(TelescopeServiceProvider::class);
}
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
View::share('notifications', Auth::check() ? Auth::user()->unreadNotifications : collect());
}
}