FilamentF
Filament17mo ago
padioca

Accessing Model /ResourceIn Widget

I know this has been asked a lot, and I have done a lot of searching trying to figure this out but for some reason I cannot access the Model when I am on a View Page. I have tried:
use Illuminate\Database\Eloquent\Model;
 
public ?Model $record = null;

to no avail. It always responds with an error saying 'Attempt to read property "name" on null'. If I remove the = null portion I get an error saying I can't access the variable before it is initialized. I have created a very basic widget using the CLI and run into the same issues even when starting from scratch.
Could really use some help here, I am stumped at this point.
Was this page helpful?