<?php


namespace App\Support;


class Helper
{
    public static function generateMenu() {
        $labels = [
            [
                'label' => 'Produk',
                'menus' => [
                    [
                        'name' => 'Produk',
                        'icon' => 'fas fa-apple-alt',
                        'sub_menus' => [
                            /*[
                                'name' => 'Produk',
                                'url' => '#'
                            ],*/
                            [
                                'name' => 'Kategori',
                                'url' => route('dashboard.product-categories.index')
                            ],
                            /*[
                                'name' => 'Opsi Tambahan',
                                'url' => '#'
                            ],*/
                        ]
                    ],
                    /*[
                        'name' => 'Inventori',
                        'icon' => 'fas fa-archive',
                        'sub_menus' => [
                            [
                                'name' => 'Kartu Stok',
                                'url' => '#'
                            ],
                            [
                                'name' => 'Stok Masuk',
                                'url' => '#'
                            ],
                            [
                                'name' => 'Stok Keluar',
                                'url' => '#'
                            ],
                        ]
                    ]*/
                ]
            ],
            [
                'label' => 'Bisnis',
                'menus' => [
                    [
                        'name' => 'Outlet',
                        'icon' => 'fas fa-store',
                        'url' => route('dashboard.outlets.index')
                    ],
                    /*[
                        'name' => 'Karyawan',
                        'icon' => 'fas fa-user-tie',
                        'url' => '#'
                    ]*/
                ]
            ],
            [
                'label' => 'Promo',
                'menus' => [
                    [
                        'name' => 'Voucher',
                        'icon' => 'fas fa-percentage',
                        'url' => route('dashboard.vouchers.index')
                    ]
                ]
            ],
            [
                'label' => 'Data',
                'menus' => [
                    [
                        'name' => 'User',
                        'icon' => 'fas fa-user-alt',
                        'url' => route('dashboard.users.index')
                    ],
                    [
                        'name' => 'Customer',
                        'icon' => 'fas fa-user-friends',
                        'url' => route('dashboard.customers.index')
                    ]
                ]
            ]
        ];

        $html = '';
        foreach ($labels as $label) {
            $html .= view('dashboard.layout.partials.each_menu', compact(['label']));
        }

        return $html;
    }
}
