Ive been reading a few articles on the net about package development but cant quite wrap my head around the basic setup. Ive written jQuery plugins with releases and published to Bower in the passed so maybe im just not understanding the difference with Laravel.
With jQuery plugin dev I would just exclude my dev required dependancies through bower.json to prevent a person pulling in my dependancies. It seems that with Laravel u create an un-tracked Laravel framework folder and put your package into the vendor folder and track only that with Git? So basically the Laravel project sitting outside of my vendor package is just some files on my PC? Surely I would want to track which version of Laravel the package was developed on?
OR should I create a "base" Laravel repository and create another repository inside the vendor folder so make sure I know which Laravel the package was built on?
Documentation and tutorials are very vague...
Your question looks a little bit confuse. I develop packages for Laravel and the following is a regular way:
- Laravel manage its dependencias via composer, take a look into
composer.json
to get a clue how similiar is with bower
.
- In order to get yout package compatible with laravel's core you need to implement some interfaces in your package. This package also can manage dependencies via composer.
- A package can be created as a repository in different version controls, like Github, BitBucket, Packagist, Cartalyst, private packages repositories, etc. By default laravel pull packages from Packagist, but into composer.json file you can specify another reposository as needed.
- When you trigger
composer update
(this is an equivalent as bower update
), this dependencies manager will pull all the packages and download them automatically in vendor/
directory.
How to code your package while testing with laravel? some people do the following, including me:
- Install a laravel instance just for package development purpose.
- Create a new project (your package project) inside of
vendor/project-name
following lavavel's package requirements.
- Keep working your package from this project location. By this way the changes are reflecting instantly in laravel installation.
- Don't forget to commit and push