This is a input form filler example. It provide functionality to fill values for select element. In this example I define values for category.

	$categoryList= $this->getCategoryList();
	$Scaffolding= new Scaffolding("posts");
	$Scaffolding->join('categories', 'categories.id', '=', 'posts.category', 'INNER');
	// Define form input filler for category
	$Scaffolding->setFormInputFiller("category", $categoryList);
	// Set columns properties
	$parameters= array(
	    array(
	    	'name'=>'no',
	    	'width'=>'1%',
	    ),
	    array(
	    	'name'=>'categories.name',
	    	'label'=>'Category',
	    	'width'=>'30%',
	    ),
	    array(
	    	'name'=>'title',
	    	'width'=>'49%',
	    ),
	    array(
	    	'name'=>'actions',
	    	'width'=>'20%',
	    ),
	);
	$Scaffolding->setColumnProperties($parameters);
	$content= $Scaffolding->render();
	$parameters= array(
		'scaffolding'=>$content
	);
	return view('demo', $parameters);
	

This is callback for get category values.

    /**
     * Get category list
     *
     * @return  Illuminate\View\View
     */
    public function getCategoryList()
    {
    	$Categories= new \App\Models\Categories;
    	$categoryList= array(""=>"-- Select --");
    	$result= $Categories->get()->pluck("name", "id")->all();
    	$categoryList= $categoryList + $result;
    	return $categoryList;
    }
	
Cancel