Capsule Navigation in admin

I have installed a capsule for homepage, However I am not able to make it appear on my admin via the navigation in my "AppServiceProvider.php" below is what I currently have;
<?php

namespace App\Providers;

use A17\Twill\View\Components\Navigation\Link;
use A17\Twill\Facades\TwillNavigation;
use A17\Twill\View\Components\Navigation\NavigationLink;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}

/**
* Bootstrap any application services.
*/
public function boot(): void
{
TwillNavigation::addLink(
NavigationLink::make()->forModule('articles')
);

TwillNavigation::addLink(
NavigationLink::make()->forModule('services')
);

//trying to get my capsule to appear at admin
$link = NavigationLink::make()->title('Homepage')->route('admin.homepages.landing')->icon('home');
TwillNavigation::addLink($link);
}
}
<?php

namespace App\Providers;

use A17\Twill\View\Components\Navigation\Link;
use A17\Twill\Facades\TwillNavigation;
use A17\Twill\View\Components\Navigation\NavigationLink;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}

/**
* Bootstrap any application services.
*/
public function boot(): void
{
TwillNavigation::addLink(
NavigationLink::make()->forModule('articles')
);

TwillNavigation::addLink(
NavigationLink::make()->forModule('services')
);

//trying to get my capsule to appear at admin
$link = NavigationLink::make()->title('Homepage')->route('admin.homepages.landing')->icon('home');
TwillNavigation::addLink($link);
}
}
Kindly assist.
1 Reply
ifox
ifox2y ago
forSingleton might be what you're looking for. Otherwise the issue is that you're using the admin. route prefix but twill now uses twill.
Want results from more Discord servers?
Add your server