Including laravel 5 packages in lumen

2.9k views Asked by At

Im currently trying to include illuminate/filesystem into lumen

So far I have managed to install the package running the following command:

composer require Illuminate/Filesystem

However I have no idea how to register the static class inside the application, I can't seem to find anything on the internet which talks about how to implement laravel 5 packages into lumen.

I have tried adding a class alias to the core of lumen, but this seems wrong to me.

1

There are 1 answers

4
Bogdan On BEST ANSWER

There's nothing wrong with registering a class alias for the File facade, just don't do it in the framework source files (within the vendor directory). A good place to put that is inside the bootstrap/app.php file. Just add this and you're good to go:

class_alias('Illuminate\Support\Facades\File', 'File');

No additional packages need to be installed for this to work because Illuminate/Filesystem already comes with Lumen.