{"repo":"Laragear/Refine","free":true,"listed":false,"github":"https://github.com/Laragear/Refine","clone":"git clone https://github.com/Laragear/Refine.git","description":"Filter a database query using the request query keys and matching methods.","language":"PHP","stars":10,"topics":["composer","database","http","laravel","package","php","query","request"],"license":"MIT","category":"databases-storage","readme_excerpt":"Refiner Filter a database query using the request query keys and matching methods. Become a sponsor Your support allows me to keep this package free, up-to-date and maintainable. Alternatively, you can spread the word on social media! . Requirements PHP 8.3 or later Laravel 12 or later Installation Require this package into your project using Composer: Usage This package solves the problem of refining a database query using the URL parameters by moving that logic out of the controller. For example, imagine you want to show all the Posts made by a given Author ID. Normally, you would check that on the controller and modify the query inside. While this looks inoffensive for a couple of URL parameters, it will add up as more refinements are needed: published at a given time, with a given set of tags, ordering by a given column, etc. Eventually it will clutter your controller action. Instead, Laragear Refine moves that logic to its own \"Refiner\" object, which is handled by only issuing the refiner class name to the refineBy() method of the query builder. The magic is simple: each refiner method will be executed as long the corresponding URL parameter key is present in the incoming request. Keys are automatically normalized to camelCase to match the method, so the author id key will execute authorId() with its value. Creating a Refiner Call the make:refiner with the name of the Refiner you want to create. You will receive the refiner in the app\\Http\\Refiners directory. As you can ","default_branch":null,"files":null,"tree":[],"storefront":"/r/Laragear","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Laragear/Refine/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}