Normally in Laravel I call a model by creating something like this:
class Config extends Eloquent {
protected function getBaseUri() {
return sprintf(
"%s://%s%s", isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', $_SERVER['HTTP_HOST'], '/project/public/assets/'
);
}
public static function getBaseImagePath() {
return $this->getBaseUri() . 'image/';
}
}
and call it somewhere in php files like this:
echo Config::getBaseImagePath();
Now, I'm migrating into .blade.php and I need to call the same function from the model, so I did this somewhere in the blade:
{{ Config::getBaseImagePath() }}
And it's not working (weird enough, since what I know is all blade doing is convert {{ }} tags to php tags). Can anyone explain how to make this work? Thanks.
Error I'm getting is:
Call to undefined method Illuminate\Config\Repository::getBaseImagePath()