betalabs / engine-api-handler
Package providing relation filtering abilities to API-handler
Installs: 6 018
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=7.3.0 | ^8.0
- betalabs/laravel-api-handler: ^1.0.0|^2.0.0|^3.0.0
- laravel/helpers: ^1.3|^v1.6.0
README
This package allows the search and filtering of related tables data using Marcel Gwerder's API handler. It only requires that you extend the class AbstractIndexHandler, implementing the method buildQuery(), which must return Laravel's \Illuminate\Database\Eloquent\Builder object. Then, to return the query results, you must call the method execute() of that class.
For the correct functioning of the package, you must separate the related tables using "->" in the URL, instead of ".". You must also name the Eloquent methods of each related table using the exact same name of that table in the Database.
You also have to put the file apihandler.php inside the config folder of your laravel project.
Installation
Install the package via composer
$ composer require betalabs/engine-api-handler