Giter VIP home page Giter VIP logo

menu's People

Contributors

fulopattila122 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

menu's Issues

Issue in creating new sidebar menu from sidebar

Hi,
I installed your extension in my laravel9, I created service provide and registered it in app.php file, When I am trying to access the sidebar in my blade file its showing be error like

image

Below is the code of my service provider.

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use View;
//use Konekt\Menu;
class SidebarnavServiceProvider extends ServiceProvider
{
    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {

       View::composer('*', function($view)

       {

            $navbars=  \Menu::create('sidebar_left'); // will be $mainMenu in views
            $navbars->addItem('Home',  '/');
            $navbars->addItem('About', 'about');
            $view->with('navbars', $navbars);

       });


    }
}

AND in my blade file I use the below code.

{{-- Render with the built in 'ul' renderer --}}
                {!! $navbars->render('ul') !!}

                {{--Or render items manually--}}
                <nav>
                    @foreach($navbars->items as $item)
                        <div class="nav-link><a href="{{ $item->url }}">{{ $item->title }}</a></div>
                    @endforeach
                </nav>

Can you please check and tell me where I am making the mistake?

Thanks,
Jarnail

Making a section item

I don't want to use links in some items. How can I do that?

$menu = Menu::create('main');

$menu->addItem('home', 'Home', '/');
$menu->addItem('section', 'Section Title',  ['url' => false, 'class' => 'menu-section']); // example: [url => false]
$menu->addItem('about', 'About', '/about');
<ul>
  <li class="active"><a href="http://yourdomain.com">Home</a></li>
  <li class="menu-section">
      <h4 class="menu-text">Section Title</h4>
  </li>
  <li><a href="http://yourdomain.com/about">About</a></li>
</ul>

Laravel 9 Support

Hi there!

Are there any plan to update to Laravel 9? Its the only package which is left on our system to update to Laravel 9.

Cheers,
Tobias

Merging Attr to links

I trying to merge some attr to links when is active, but don't work. How is possible make that.

        $backendSideBarMenu = Menu::create('backendSideBarMenu', [
            'auto_activate' => true,
            'active_class' => 'shadow-soft-xl rounded-lg bg-white font-semibold text-slate-700',
            'active_element' => 'link',
        ]);
        $backendSideBarMenu->attr('class', 'flex flex-col pl-0 mb-0');
        $backendSideBarMenu->addItem('dashboard', __('Dashboard'), '/dashboard')->activateOnUrls('dashboard');
        $backendSideBarMenu->addItem('management', __('Management'), '/management')->activateOnUrls('management/*');
        $backendSideBarMenu->items->roots()->attr('class', 'mt-0.5 w-full');
        foreach ($backendSideBarMenu->items->roots() as $item) {
            $item->link->attr('class', 'py-2.7 text-size-sm ease-nav-brand my-0 mx-4 flex items-center whitespace-nowrap px-4 transition-colors');
        }

The active link only have the normal class py-2.7 ... when have to by shadow-soft-... py-2.7 ...

Best Regards.

Yoinier.

Laravel 10 support

Hi there!

Are there any plan to update to Laravel 10? Its the only package which is left on our system to update to Laravel 10.

Cheers,
Tobias

attributes:protected

hi
How do I access attributes:protected?

[attributes:protected] => Array
 (
      [icon] => bi bi-grid-fill
      [class] => has-sub
 )
$sidebar = Menu::create('sidebar', ['share' => 'sidebar']);
$sidebar->addItem('Login', 'Login',['url' => 'login', 'icon' => 'bi bi-grid-fill','class' => 'has-sub']);


@foreach($sidebar->items as $item)
                    <li class="sidebar-item ">
                        <a href="{{ $item->url }}" class='sidebar-link {{ $item->class }}'>
                            <i class="{{ $item->icon }}"></i>
                            <span>{{ $item->title }}</span>
                        </a>
                    </li>
                @endforeach

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.