Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use helper functions in Lumen?

Tags:

laravel

lumen

    $credentials = app_path();

Results in:

[Symfony\Component\Debug\Exception\FatalThrowableError] Call to undefined function App\LtClasses\app_path()

But it's listed as a helper here: https://laravel.com/docs/5.3/helpers#method-app-path

like image 245
daninthemix Avatar asked Dec 12 '16 12:12

daninthemix


1 Answers

Those are the Laravel docs, you don't have the same helpers available on Lumen, you can have a look at the helpers that the Lumen framework comes with at

/vendor/laravel/lumen-framework/src/helpers.php

Workarounds to achive what you need here could be

app()->path();

app('path');

base_path('app');
like image 160
Carlos Fdev Avatar answered Sep 30 '22 19:09

Carlos Fdev