Level 73
Why static?
You can access it as a static property then: ResourceName::$model
ResourceName should be the name of the class.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
/**
* The model the resource corresponds to.
*
* @var string
*/
public static $model = \App\Models\User::class;
How can we access this parameter in the Resource class? I try this, but doesnt work...
dd($this->model);
If you need the underlying model instance you should use $this->resource
Please or to participate in this conversation.