41 lines
875 B
PHP
41 lines
875 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\Menu;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Illuminate\Support\Facades\View;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
Carbon::setLocale('id');
|
|
View::composer(['layouts.partials.sidebarMenu', 'dashboard', 'dealer_recap', 'back.*', 'warehouse_management.*'], function ($view) {
|
|
$menuQuery = Menu::all();
|
|
$menus = [];
|
|
foreach($menuQuery as $menu) {
|
|
$menus[$menu->link] = $menu;
|
|
}
|
|
|
|
$view->with('menus', $menus);
|
|
});
|
|
}
|
|
}
|