hromby's avatar

app_path() in a package

Hello! I am developing a small package which will need to write a file to the base directory of the laravel installation, in the same spot as the composer.json file, phpunit.xml and so on lives.

How can I reference that path from within the package code? Is there a guaranteed way of referencing the same spot as the composer.json is in?

0 likes
3 replies
EventFellows's avatar

I think there is a base_path() that is also used in variois config files. you could use that.

hromby's avatar

Thanks for the answer! Which illuminate package is that function part of?

junaidqadir's avatar

It's a helper function which is an alias for app()->basePath(). helpers.php can be found in Illuminate/Foundation

Please or to participate in this conversation.