$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 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 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 The question is, where it can be possible located? In the internet was said that $view must be initialised for getView(), and it is in every view.
Solution:
Strangely, but in my case the error was that, canAccess() was not provided. Therefore, it could not access that resource at all. After providing this: ```php public static function canAccess(): bool {...
Jump to solution
1 Reply
Solution
_SpelleR_
_SpelleR_3mo ago
Strangely, but in my case the error was that, 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() is deafult, not rewritten in resource itself.

Did you find this page helpful?