Package Data | |
---|---|
Maintainer Username: | JeroenNoten |
Maintainer Contact: | jeroennoten@me.com (Jeroen Noten) |
Package Create Date: | 2015-10-12 |
Package Last Update: | 2016-06-27 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 15:19:04 |
Package Statistics | |
---|---|
Total Downloads: | 36 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 7 |
Total Watchers: | 4 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Developing packages in Laravel 5 is easy: just create a subdirectory for your package in a directory packages
, add the necessary autoload details in your composer.json
file and you're good to go.
Unless... your package has dependencies on other packages. Then you need to require_once
the vendor/autoload.php
file of each package. That is exactly what this package does. Of course, you can also use more heavy Laravel package development tools, such as Studio or Laravel Packager,
but if you (like me) don't really need all that additional stuff, you can use this package.
Require the package using composer:
composer require jeroennoten/laravel-psp
Add the service provider to the providers
in config/app.php
:
JeroenNoten\LaravelPsp\ServiceProvider::class,
Create an empty packages
directory in the root of your project.
Now you're ready to create your awesome packages.
In the packages
directory, create a subdirectory for your new package, e.g. packages/your-package
.
In your composer.json
file, define the autoloading properties for your package like so (assuming that you use PSR-4 autoloading from the src
subdirectory in your package directory):
"autoload": {
"psr-4": {
"YourVendorNamespace\\YourPackageNameSpace\\": "packages/your-package/src"
}
},
Done! You're now ready to develop your package.
Note that this package assumes that your packages reside in a directory called
packages
. This is not (yet) configurable.