"Ready-to-eat" and framework-agnostic CRUD controllers.
Install Dexterity
via Composer:
$ composer require rougin/dexterity
use Acme\Common\Models\PatientModel;
use Acme\Repositories\OrmRepository;
use Acme\Http\Message\ServerRequest;
use Rougin\Dexterity\Controller\CrudController;
$repository = new OrmRepository;
$request = new ServerRequest;
$controller = new CrudController($repository, $request);
$controller->model(PatientModel::class);
// Returns an array of PatientModel objects
$patients = $controller->index();
// Returns a specific PatientModel object
$patient = $controller->find(10);
Please see CHANGELOG for more information what has changed recently.
$ vendor/bin/phpunit
The MIT License (MIT). Please see LICENSE for more information.