1. Go to this page and download the library: Download tes/laravel-relafilter library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tes / laravel-relafilter example snippets
use App\Models\Employee;
class EmployeeList extends Component
{
public array $search = [];
public function render()
{
$employees = Employee::filter($this->search)->get();
return view('livewire.employee-list', compact('employees'));
}
}
use App\Models\Employee;
use Illuminate\Http\Request;
public function index(Request $request)
{
$employees = Employee::filter($request->input())->get();
return view('employees.index', compact('employees'));
}