How to call app_path() function or to make a Helper for app_path() function in Laravel lumen? I need it because i got this error,.. "Call to undefined function app_path()" It has a package here for that,.. but is not supported for Laravel Lumen version 7 Anyone knows hot to make it?
thanks,.. sorry for my english,.
I fixed the error now,.
i added this to my app/Helpers/helpers.php
file.
<?php
if (!function_exists('app_path')) {
/**
* Get the path to the application folder.
*
* @param string $path
* @return string
*/
function app_path($path = '')
{
return app('path') . ($path ? DIRECTORY_SEPARATOR . $path : $path);
}
}
for the other config.
dont forget to add this in composer.json
file:
"autoload": {
"files": [
"app/Helpers/helpers.php"
]
},
and run this command: composer dump-autoload
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With