Answer the question
In order to leave comments, you need to log in
How to get the value of a model method as a result of an ActiveRecord fetch?
In order to get the data of the associated table as a result of the selection, you need to use with(), but how to get the value of a regular method, for example, this one:
public function getExample(){
return 'что-то';
}
Answer the question
In order to leave comments, you need to log in
In order to get the data of the associated table as a result of the selection, you need to use with()
$myModel->relationName->example;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question