This is a custom search example. It provide functionality to create custom search functionality using Hook Filter listModifySearch and Hook Action listFormStart. In this example I create custom search to provide search functionality with operators.

	$Scaffolding= new Scaffolding("categories");
	// Set columns properties
	$parameters= array(
	    array(
	    	'name'=>'no',
	    	'width'=>'1%',
	    ),
	    array(
	    	'name'=>'name',
	    	'width'=>'79%',
	    ),
	    array(
	    	'name'=>'actions',
	    	'width'=>'20%',
	    ),
	);
	$Scaffolding->setColumnProperties($parameters);
	$visibility= array(
		'multi_search'=>FALSE,
		'single_search'=>FALSE,
		'submit_button'=>FALSE,
	);
	$Scaffolding->setVisibilityListElements($visibility);
	$Scaffolding->addHooks("listModifySearch", array($this, "processCustomSearch"));
	$Scaffolding->addHooks("listFormStart", array($this, "getCustomCategoriesSearch"));
	$content= $Scaffolding->render();
	$parameters= array(
		'scaffolding'=>$content
	);
	return view('demo', $parameters);
	

This is callback for process and get search Form.

    /**
     * Process custom search
     *
     * @return  \App\Libraries\Scaffolding\Model
     */
    public function processCustomSearch($Model)
    {
    	$Request= request();
    	$operator= '=';
    	$value= $Request['xsearch']['value'];
    	$operator= $Request['xsearch']['operator'];
    	if( $value && $operator ){
	    	switch($Request['xsearch']['operator']){
				case "eq":
					$operator= "=";
					break;
				case "ne":
					$operator= "!=";
					break;
				case "lt":
					$operator= "<";
					break;
				case "le":
					$operator= "<=";
					break;
				case "gt":
					$operator= ">";
					break;
				case "ge":
					$operator= ">=";
					break;
				case "ct":
					$operator= "LIKE";
					$value= '%'.$value.'%';
					break;
			}
			$Model= $Model->where('categories.name', $operator, $value);			
		}
		return $Model;
    }
    
    /**
     * Get custom categories search
     *
     * @return  string
     */
    public function getCustomCategoriesSearch($Scaffolding)
    {
    	echo view("categories.search")->render();
    }
	
No
Name
Actions
1 Teste
2 Test111
3 test
4 sasasdsadaaa
5 Sarel
6 sadasd
7 rfvddwfw
8 raja
9 qqq
10 Prova
Showing 1 to 10 of 70 entries