This may look like a trivial question, but it isn't.

Being new to composer, I find myself wondering about how to pick a decent package for a common feature on its main repo packagist.

Say I am using Laravel 4 for a recent project and would like to add mongodb support for document storages and indexing. A simple search for mongodb on packagist will yield 8 pages of results, searching for mongodb laravel yield 24 pages.

But here comes my question: most packages have their target framework, should I pick the ones that are less popular but designed for Laravel, or should I go with the popular package in hope of future maintenance?

My assumption is that: composer, along with PHP-FIG standards, are attempting to reduce repeat development of common features across frameworks. So eventually there maybe only a handful of popular package left active for a certain common tasks.

But for now, how to choose the right package on packagist for framework X? Should we just search on github instead?

(I should note that Laravel already use a handful of Symfony/doctrine packages in core, but there are no guarantee that doctrine/mongodb will also work in Laravel without modification right?)

有帮助吗?

解决方案

When I'm searching on Packagist, I try to avoid packages that depend on frameworks that are not Laravel or sometimes Symphony. Of course, no framework dependencies is okay.

When L4 was still in alpha, I wanted to play around with image manipulation. After some investigation, I chose sybio/image-workshop. At the time, there were no packages that interfaced with Laravel perfectly. After created a service provider and facade, all was good.

On packagist.org, try the search terms "mongodb AND laravel" without quotes. This narrows the search to one page, in this case.

Chris Fidao (@fideloper) tweeted on May 2nd about the following MongoDB package for Laravel. It looks interesting as it uses Eloquent.

https://github.com/jenssegers/Laravel-MongoDB

其他提示

For package specific for laravel framework, please check packalyst. Packalyst is a directory of Packages for Laravel projects, It pulls package names from Packagist that have a "laravel" tag (composer package that have 'laravel' in the keyword array in composer.json).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top