32 lines
632 B
PHP
32 lines
632 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\View;
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
// Share authenticated user with the 'layouts.app' view
|
|
View::composer('layouts.app', function ($view) {
|
|
$user = Auth::user();
|
|
$view->with('user', $user);
|
|
});
|
|
}
|
|
}
|