@larissa
In Laravel, you can access a variable in a model by using the $this keyword.
For example, if you have a variable named $name in your model, you can access it like this:
1
|
$this->name; |
You can also use the magic __get() method to access the variable directly like this:
1
|
$name = $this->name; |
Make sure that the variable you are trying to access is defined in the model class.