TopGit tracks ziadoz/silex-capsule on GitHub as part of the Backend family. The project has 15 stars. A Laravel Eloquent ORM/Capsule service provider for Silex
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
For more information about the available options you should refer to the Capsule documentation.
Once you've registered the service provider a Capsule object will be created and Eloquent booted up before any of your route controllers are called. If you're interested in the technical aspects, Capsule is registered as before middleware with Silex using Application::EARLY_EVENT, so it'll only ever be made available once your application is run and before anything else happens.
If you need Capsule and Eloquent to be booted up before your application is run ($app->run()), for example in a Symfony Console command, you just need to access its array element within the dependency injection container:
$app['capsule'];
Capsule will be made available globally by default, allowing you to write queries directly in your controllers should you wish:
use Illuminate\Database\Capsule\Manager as Capsule;
$app->get('/book/{id}', function(Application $app, $id) {
$book = Capsule::table('books')->where('id', $id)->get();
return $app->json($book);
});
If you don't want Capsule to be booted then set the capsule.global setting to false. If you don't plan to use Eloquent to build models then you can also prevent it from being booted by setting capsule.eloquent to false.
Creating Eloquent models is identical to how you would create them in Laravel:
use Illuminate\Database\Eloquent\Model;
class Book extends Model
{
protected $table = 'books';
protected $fillable = [
'title',
'author',
];
protected $casts = [
'title' => 'string',
'author' => 'string',
];
// The rest of your model code...
}
Then you can use it, and all of its features, in your controllers just like you would in Laravel:
There are some basic tests to ensure that the Capsule object is correctly registered with Silex. You can run them using PHPUnit, and you'll also need SQLite as the tests use a simple in-memory database.
If you make a pull request please ensure you add the accompanying tests.
How active is development on ziadoz/silex-capsule?
The most recent commit recorded on ziadoz/silex-capsule was 6.9 years ago, based on the GitHub push timestamp. The repository has 7 forks — one of the better signals of community interest.
How many stars does ziadoz/silex-capsule have?
ziadoz/silex-capsule has 15 GitHub stars — refresh the page for the live number, or check github.com/ziadoz/silex-capsule. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What else is in the Backend space?
ziadoz/silex-capsule is tracked by TopGit under the Backend category, alongside 5 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What language is ziadoz/silex-capsule written in?
ziadoz/silex-capsule is written primarily in PHP. GitHub's language field is based on the largest share of bytes in the default branch.
What topics is ziadoz/silex-capsule associated with?
GitHub's repository topics for ziadoz/silex-capsule: "capsule", "eloquent", "laravel", "php", "silex". TopGit's editorial category is Backend.
Where do I read more about ziadoz/silex-capsule?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/ziadoz/silex-capsule is the definitive source.
Why is ziadoz/silex-capsule categorized under Backend?
TopGit places ziadoz/silex-capsule in the Backend category based on its GitHub topics and description (tagged: "capsule", "eloquent", "laravel"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Want a second opinion on silex-capsule?
Ask an AI that can read this page — one click and you get its take on silex-capsule.