© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
WebKenth

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()
\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')
__('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', []);
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
Illuminate\Contracts\Container\BindingResolutionException
Target class [cache] does not exist.


My providers array looks like this: (
config/app.php
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(),
    '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
getNavigationItems
method to resolve it (https://filamentphp.com/docs/3.x/panels/navigation#registering-custom-navigation-items-1)
image.png
Navigation - Panel Builder - Filament
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Target class [cache] does not exist.
FilamentFFilament / ❓┊help
3y ago
Target Class Does Not Exist
FilamentFFilament / ❓┊help
3y ago
Target class [livewire] does not exist.
FilamentFFilament / ❓┊help
11mo ago
Target class [filament] does not exist. ?
FilamentFFilament / ❓┊help
2y ago