0
votes

As a Laravel starter I am stuck with the following problem: "Framework calls are giving a Undefined Call error".

running version: 5.2.14

https://laravel.com/docs/5.0/helpers#paths

  • base_path Get the fully qualified path to the root of the application install.

  • config_path Get the fully qualified path to the config directory.

  • public_path Get the fully qualified path to the public directory.

  • storage_path Get the fully qualified path to the storage directory.

It seems my intellisense is seeing these methodes. But when I do call them it is giving me a hard time with undefined methode errors. My home.blade.php file:

<?php
$storage_path = storage_path();
echo $storage_path ?>

Will result in: Fatal error: Call to undefined function storage_path()

2

2 Answers

0
votes

try this in blade file

{{storage_path()}}

0
votes

I did a clean install of laravel and homestead and added <?php $storage_path = storage_path(); echo $storage_path; ?> to welcome.blade.php and it works.

the storage_path function is in /vendor/laravel/framework/src/Illuminate/Foundation/helpers.php and should be included in /vendor/laravel/framework/src/Illuminate/Support/composer.json.

I would suggest that you verify that the helpers.php file exists and that the Support package is being loaded. and that helpers.php has not been modified (the function public_path exists in the same file)