prettus/laravel-fiql-parser

dev-main 2021-10-14 22:03 UTC

This package is auto-updated.

Last update: 2024-10-15 04:42:56 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License Maintainability Test Coverage

Installation

composer require prettus/laravel-fiql-parser:dev-main

Features

Using Query Builder

use Illuminate\Support\Facades\DB;

$query = DB::table('users')->filter('last_name==foo');
print_r($query->toSql());
// select * from `users` where `last_name` = ?

Using Eloquent model

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    protected $table = 'users';
}
$query = User::query()->filter('last_name==foo');
print_r($query->toSql());
// select * from `users` where `last_name` = ?