This is a Laravel package that will allow you to create query scopes that can be applied to an API's Endpoint dynamically via Query Strings.

dev-master 2020-07-17 16:51 UTC

This package is auto-updated.

Last update: 2024-04-10 07:43:41 UTC


README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This is a Laravel package that will allow you to create query scopes that can be applied to an API's Endpoint dynamically via Query Strings.

In short, you can apply filters to your API endpoints like so

/posts?include=comments&author=2&sort=created_at,asc

This would return all posts for the author of ID 2, all comment relationships and sorted by created_at date (note: some assembly required)

Installation - WIP

You can install the package via composer:

composer require jeffbeltran/bob

You can publish and run the migrations with:

php artisan vendor:publish --provider="Jeffbeltran\Bob\BobServiceProvider" --tag="migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --provider="Jeffbeltran\Bob\BobServiceProvider" --tag="config"

This is the contents of the published config file:

return [
];

Usage - WIP

$bob = new Jeffbeltran\Bob();
echo $bob->echoPhrase('Hello, Jeffbeltran!');

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email jeffbeltran@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.