PHP code example of j-dexx / eloquent-ransack

1. Go to this page and download the library: Download j-dexx/eloquent-ransack 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/ */

    

j-dexx / eloquent-ransack example snippets


use Jdexx\EloquentRansack\Ransackable;

class Post
{
  use Ransackable;
}

class PostsController
{
  public function index(Request $request)
  {
    $params = $request->all();
    $posts = Post::ransack($params)->get();
  }
}