Hi all,
I have 2 models, \App\Request and \App\Media. \App\Request has many \App\Media references. If \App\Media wasn't namespaced, I could simply call
<?PHP
$this->nameofAppRequestObject->getMedia('condition string');
But since it is namespaced that would change to:
<?PHP
$this->nameofAppRequestObject->getApp\Media('condition string');
which is obviously messed up.
As the docs suggest is possible, I manually wrote a getMedia() function that calls getRelated('\App\Media'), but that's not quite working either.
My question is: Is manually writing a function like I have done the recommended way of doing this?