Millard
Millard

Reputation: 1157

Including laravel 5 packages in lumen

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.

Upvotes: 1

Views: 2927

Answers (1)

Bogdan
Bogdan

Reputation: 44586

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.

Upvotes: 2

Related Questions