© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•7mo ago•
3 replies
_SpelleR_

$view must not be accessed before initialization

What I am trying to do:
To go to the resource that is located inside a cluster. There I have custom index page for route('/').

What I did:
In every page
Filament\Resources\Pages\Page
Filament\Resources\Pages\Page
inside that cluster for that resource I have this with corresponding blade file:
protected static string $view
protected static string $view

Have tried to comment whole resource or pages for that resource, but the error persisted.
The only thing was when I have commented page for index route, it said:
Class "App\Filament\Clusters\CustomsCluster\CustomResource\Pages\CustomList" not found
Class "App\Filament\Clusters\CustomsCluster\CustomResource\Pages\CustomList" not found


My issue/the error:
The error can be seen in the screenshot.
Typed static property Filament\Pages\BasePage::$view must not be accessed before initialization
Typed static property Filament\Pages\BasePage::$view must not be accessed before initialization


The question is, where it can be possible located?
In the internet was said that
$view
$view
must be initialised for
getView()
getView()
, and it is in every view.
Solution
Strangely, but in my case the error was that,
canAccess()
canAccess()
was not provided. Therefore, it could not access that resource at all.
After providing this:
public static function canAccess(): bool
    {
        return true;
    }
public static function canAccess(): bool
    {
        return true;
    }

It it working fine. Still don't understand why it is the case, since in other cluster resources
canAccess()
canAccess()
is deafult, not rewritten in resource itself.
Jump to solution
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

Must not be accessed before initialization
FilamentFFilament / ❓┊help
2y ago
Table must not be accessed before initialization
FilamentFFilament / ❓┊help
14mo ago
$container must not be accessed before initialization
FilamentFFilament / ❓┊help
3y ago
$dataChecksum must not be accessed before initialization
FilamentFFilament / ❓┊help
3y ago