I need to know the url of a featured image attached in a blog post with Rainlab blog plugin in October CMS.
The image is saved in a directory something like ".../storage/app/uploads/public/59f/112"
I need to know it in the moment that I save the post because I want to get the url to save it in another table that it can access from another php file or system ( in Android App for example ), but I can't do it.
I try with (in FormController.php) find the post:
$modelP = Post::find($this->controller->vars['formModel']['id']);
$featuredImage = $modelP->featured_image->getPath();
But doesn't work, I get the blog object but it says that featured_image is not a variable.
In the table system_file only I can get the name of the file (disk_name) but not the entire url and I don't know in what directory it is saved.
Can anyone help me?