public function getFilter() { //\Debugbar::disable(); $filter = DataFilter::source(Article::with('author', 'categories')); $filter->attributes(array('class' => 'capocchie')); //$filter->add('categories.name','Categories','checkboxgroup'); $filter->add('categories', 'Categories', 'checkboxgroup')->options(Category::lists('name', 'id')); $filter->add('title', 'Title', 'text'); $filter->submit('search'); $filter->reset('reset'); //$filter->build(); $grid = DataGrid::source($filter); $grid->attributes(array("class" => "table table-striped")); $grid->add('id', 'ID', true)->style("width:70px"); $grid->add('title', 'Title', true); $grid->add('{{ $row->author->fullname }}', 'Author'); $grid->add('{{ implode(", ", $categories->lists("name")) }}', 'Categories'); $grid->add('{{ date("d/m/Y",strtotime($publication_date)) }}', 'Date', 'publication_date'); $grid->add('body', 'Body'); $grid->edit('/rapyd-demo/edit', 'Edit', 'modify|delete'); $grid->paginate(10); return View::make('rapyd::demo.filtergrid', compact('filter', 'grid')); }
public function getCustomfilter() { $filter = DataFilter::source(Article::with('author', 'categories')); $filter->text('src', 'Search')->scope('freesearch'); $filter->build(); $set = DataSet::source($filter); $set->paginate(9); $set->build(); return View::make('rapyd::demo.customfilter', compact('filter', 'set')); }
public function getFilter() { $filter = DataFilter::source(Article::with('author')); $filter->add('title', 'Title', 'text'); $filter->add('author_id', 'Author', 'select')->option("", "")->options(Author::lists("firstname", "user_id")); $filter->submit('search'); $filter->reset('reset'); $grid = DataGrid::source($filter); $grid->attributes(array("class" => "table table-striped")); $grid->add('article_id', 'ID', true)->style("width:70px"); $grid->add('title', 'Title', true); $grid->add('{{ $row->author->firstname }}', 'Author'); $grid->add('body', 'Body'); $grid->edit('/rapyd-demo/edit', 'Edit', 'modify'); $grid->paginate(10); return View::make('rapyd::demo.filtergrid', compact('filter', 'grid')); }