$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:
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:Jump to 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
{...1 Reply
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:
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.