Make your Laravel's Query Filter with the cleanest code!
Fouladgar.dev shows us how to use Eloquent-Builder to build useful eloquent queries in Laravel 5.
Make your Laravel's query filter with the cleanest code!
Quick Usage
<?php
namespace App\Http\Controllers;
use App\User;
use EloquentBuilder;
use Illuminate\Http\Request;
class UserController extends Controller
{
public function index(Request $request)
{
$users = EloquentBuilder::to(User::class, $request->all());
return $users->get();
}
}
Link:
This post is submitted by our members. Submit a new post.
Tags: Tutorials Laravel 5.7 Laravel 5.6 Laravel 5.5 Laravel 5.4 Laravel 5.3 Laravel 5 Advanced