Target Class [cache] does not exist

I don't really know much about the core behaviour and what todo/not todo inside service providers

What i am attempting to create is a simple session based "recently viewed" list of navigation items in the sidebar utilizing \Filament\Navigation\NavigationItem::make() on items visited

See attached image


Any panel requirements of core laravel features doesn't seem to work, like translations ( using a __('text') anywhere in labels doesn't resolve the translation and only results in a "Target Class [translator] does not exist"


use \Illuminate\Support\Facades\Session;

class AppPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        $recently_visited = Session::get('key', []);


results in a Illuminate\Contracts\Container\BindingResolutionException Target class [cache] does not exist.


My providers array looks like this: ( config/app.php )
    'providers' => ServiceProvider::defaultProviders()->merge([
        /*
         * Package Service Providers...
         */

        /*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\SparkServiceProvider::class,
        App\Providers\HorizonServiceProvider::class,
        App\Providers\Filament\AdminPanelProvider::class,
        App\Providers\Filament\AppPanelProvider::class,
        App\Providers\RouteServiceProvider::class,
    ])->toArray(),




Is this intended behaviour of the panel service provider?
Is it bad practice to use dynamic features in this way? not sure where to move the logic to get the same benefits

Next option on my todo list is to move the Navigation items into a Page and use the getNavigationItems method to resolve it (https://filamentphp.com/docs/3.x/panels/navigation#registering-custom-navigation-items-1)
image.png
Was this page helpful?