Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

sehrgutesoftware/eloquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eloquery

Build Status Test Coverage Maintainability Latest Stable Version

Table of Contents

Usage

Example usage directly in Controller

use App\Models\Book;
use Illuminate\Routing\Controller;
use SehrGut\Eloquery\Facades\Eloquery;

class BooksController extends Controller
{
    /**
     * List all records of type `Book`.
     */
    public function index()
    {
        $builder = Book::query();
        Eloquery::apply($builder);

        return $builder->get();
    }
}

API Documentation

https://sehrgutesoftware.github.io/eloquery/api/v0.8.1/

Changelog

Please refer to CHANGELOG.md.

Todo

  • Refactor: Throw custom exception when parameters are invalid / insufficient
  • Implement "include" grammar & operation
  • Refactor: Query param names should be customizable
  • Document query params syntax/usage

Compatibility

Tested with PHP 7.2, 7.3 and 7.4

Testing

composer install
composer test

Generate API Docs

composer docs

Alternatives

License

This software is licensed under the MIT License. See LICENSE.txt for details.

About

Apply query parameters (filter, sort, paginate, eager-load, search) to a Laravel Eloquent query builder

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages