Ejemplo n.º 1
0
    /**
     * Display a listing of the resource.
     * GET /admcontinentes
     *
     * @return Response
     */
    public function index()
    {
        $filter = DataFilter::source(new Continente());
        $filter->add('name_pt', 'Nome - PT', 'text');
        $filter->submit('Filtrar');
        $filter->reset('Limpar Filtro');
        $filter->build();
        $grid = DataGrid::source($filter);
        //same source types of DataSet
        $grid->attributes(array("class" => "table table-striped table-hover"));
        $grid->add('name_pt', 'Nome PT', true);
        //field name, label, sortable
        $grid->add('
					<a class="" title="Modificar" href="admin/continente/{{$code}}/edit"><span class="glyphicon glyphicon-edit"> </span></a>
					', 'Ações');
        //$grid->edit('admin/hotel/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions
        $grid->orderBy('name_pt', 'desc');
        //default orderby
        $grid->paginate(10);
        //pagination
        $grid->attributes(array('class' => 'table table-striped table-hover'));
        // $hotel = Hotel::find(1);
        // echo $hotel->destino->{'nome_br'};
        // dd();
        return View::make('admin.continente.index', compact('filter', 'grid'));
    }
Ejemplo n.º 2
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Pessoas());
     $this->filter->add('nome', 'Nome', 'text');
     $this->filter->add('id_grupo', 'Grupo', 'text');
     $this->filter->add('id_programa', 'Programa', 'text');
     $this->filter->submit('buscar');
     $this->filter->reset('resetar');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('nome', 'Nome');
     $this->grid->add('sexo', 'Sexo');
     $this->grid->add('nascimento', 'nascimento');
     $this->grid->add('responsavel', 'Responsável');
     $this->grid->add('email', 'Email');
     $this->grid->add('tel-fixo', 'Telefone Fixo');
     $this->grid->add('rua', 'Logradouro');
     $this->grid->add('numero', 'Numero');
     $this->grid->add('bairro', 'bairro');
     $this->grid->add('id_grupo', 'Grupo');
     $this->grid->add('id_programa', 'Programa');
     $this->addStylesToGrid();
     return $this->returnView();
 }
    /**
     * Display a listing of the resource.
     * GET /admpedido
     *
     * @return Response
     */
    public function index()
    {
        $filter = DataFilter::source(new User());
        $filter->add('nome', 'Nome do Cliente', 'text');
        $filter->add('email', 'Email do Cliente', 'text');
        $filter->submit('Filtrar');
        $filter->reset('Limpar Filtro');
        $filter->build();
        $grid = DataGrid::source($filter);
        //same source types of DataSet
        $grid->attributes(array("class" => "table table-striped table-hover"));
        $grid->add('id', 'Id Cliente', true);
        //field name, label, sortable
        $grid->add('nome', 'Nome do Cliente', true);
        //field name, label, sortable
        $grid->add('email', 'Email do Cliente');
        //relation.fieldname
        $grid->add('					
					<a class="" title="Criar Produtos" href="admin/produto-personalizado/{{$id}}/edit"><span class="glyphicon glyphicon-edit"> </span></a>					
					', 'Ações');
        //$grid->edit('admin/serviconoturno/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions
        $grid->orderBy('id', 'desc');
        //default orderby
        $grid->paginate(10);
        //pagination
        $grid->attributes(array('class' => 'table table-striped table-hover'));
        return View::make('admin.produtopersonalizado.index', compact('filter', 'grid'));
    }
Ejemplo n.º 4
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $filter = \DataFilter::source(User::with('faction'));
     $filter->add('name', 'Name', 'text');
     $filter->add('faction.name', 'Faction', 'autocomplete');
     $filter->add('updated_at', 'Last change', 'daterange')->format('m/d/Y', 'en');
     $filter->submit('search');
     $filter->reset('reset');
     $filter->build();
     $grid = \DataGrid::source($filter)->attributes(['class' => 'table table-hover table-striped']);
     $grid->add('id', 'ID', true)->cell(function ($value) {
         return link_to(action('Admin\\UserController@edit') . '?show=' . $value, $value);
     });
     $grid->add('status', 'Status', true);
     $grid->add('name', 'Name', true);
     $grid->add('faction.name', 'Faction', true);
     $grid->add('reputation', 'Reputation', true);
     $grid->add('alignment', 'Alignment', true);
     $grid->add('affiliation', 'Affiliation', true);
     $grid->add('created_at', 'Created', true);
     $grid->add('updated_at', 'Last change', true);
     $grid->add('email', 'Email address');
     $grid->edit(action('Admin\\UserController@edit'), 'Edit', 'modify|delete');
     return view('admin.user.index', compact('filter', 'grid'));
 }
Ejemplo n.º 5
0
 /**
  * Display a listing of destinos
  *
  * @return Response
  */
 public function getIndex()
 {
     $grid = DataGrid::source(new Destino());
     //same source types of DataSet
     $grid->add('nome_br', 'Nome PT', true);
     //field name, label, sortable
     $grid->add('nome_en', 'Nome EN');
     //relation.fieldname
     $grid->add('publicado', 'Publicado');
     $grid->edit('admin/destino/crud', 'Ações', 'show|modify|delete');
     //shortcut to link DataEdit actions
     $grid->link('admin/destino/crud', "Adicionar Novo", "TR");
     //add button
     $grid->orderBy('id', 'desc');
     //default orderby
     $grid->paginate(10);
     //pagination
     $grid->attributes(array('class' => 'table table-striped table-hover'));
     //Transforma TinyInteger de Publicado em Sim ou Não ao invez de 1 ou 0
     $grid->row(function ($row) {
         if ($row->cell('publicado')->value == 1) {
             $row->cell('publicado')->value = '<span class="label label-success"> Sim </span>';
         } else {
             $row->cell('publicado')->value = '<span class="label label-danger"> Não </span>';
         }
     });
     return View::make('admin.destino.index', compact('grid'));
 }
Ejemplo n.º 6
0
    /**
     * Display a listing of mailings
     *
     * @return Response
     */
    public function index()
    {
        $filter = DataFilter::source(new Mailing());
        $filter->add('email', 'Email', 'text');
        $filter->add('nome', 'Nome', 'text');
        $filter->add('phone', 'Telefone', 'text');
        $filter->submit('Filtrar');
        $filter->reset('Limpar Filtro');
        $filter->build();
        $grid = DataGrid::source($filter);
        //same source types of DataSet
        $grid->attributes(array("class" => "table table-striped table-hover"));
        $grid->add('email', 'Email', true);
        //field name, label, sortable
        $grid->add('nome', 'Nome', true);
        //field name, label, sortable
        $grid->add('phone', 'Telefone', true);
        //field name, label, sortable
        $grid->add('
					<a class="text-danger" title="Deletar" href="admin/mailing/delete/{{$id}}"><span class="glyphicon glyphicon-trash"> </span></a>
					', 'Ações');
        //$grid->edit('admin/mailing/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions
        $grid->orderBy('email', 'asc');
        //default orderby
        $grid->paginate(10);
        //pagination
        $grid->attributes(array('class' => 'table table-striped table-hover'));
        // $mailing = Mailing::find(1);
        // echo $mailing->destino->{'nome_br'};
        // dd();
        return View::make('admin.mailing.index', compact('filter', 'grid'));
    }
Ejemplo n.º 7
0
    /**
     * Display a listing of the resource.
     * GET /admpedido
     *
     * @return Response
     */
    public function index()
    {
        $filter = DataFilter::source(Pedido::with('cliente', 'status'));
        $filter->add('nome', 'Nome do Cliente', 'text');
        $filter->add('email', 'Email do Cliente', 'text');
        $filter->add('status.nome', 'Status do pedido', 'select')->options(PedidoStatus::lists("nome_br", "id"));
        $filter->submit('Filtrar');
        $filter->reset('Limpar Filtro');
        $filter->build();
        $grid = DataGrid::source($filter);
        //same source types of DataSet
        $grid->attributes(array("class" => "table table-striped table-hover"));
        $grid->add('id', 'Id Pedido', true);
        //field name, label, sortable
        $grid->add('nome', 'Nome do Cliente', true);
        //field name, label, sortable
        $grid->add('email', 'Email do Cliente');
        //relation.fieldname
        $grid->add('status.nome_br', 'Status do Pedido');
        //relation.fieldname
        $grid->add('total', 'Valor do Pedido');
        $grid->add('created_at', 'Data do Pedido', true);
        $grid->add('
					<a class="" title="Modificar" href="admin/pedido/{{$id}}/edit"><span class="glyphicon glyphicon-edit"> </span></a>
					<a class="text-danger" title="Deletar" href="admin/pedido/delete/{{$id}}"><span class="glyphicon glyphicon-trash"> </span></a>
					', 'Ações');
        //$grid->edit('admin/serviconoturno/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions
        $grid->orderBy('id', 'desc');
        //default orderby
        $grid->paginate(10);
        //pagination
        $grid->attributes(array('class' => 'table table-striped table-hover'));
        return View::make('admin.pedido.index', compact('filter', 'grid'));
    }
 public function view()
 {
     $grid = DataGrid::source('categories');
     //same source types of DataSet
     $grid->add('name', 'Name', true);
     $grid->edit(route('adminCategoriesAddEdit'), 'Actions', 'modify|delete');
     return View::make('admin.categories', compact('grid'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $grid = \DataGrid::source('api_keys');
     $grid->add('id', 'ID', true)->style('width:100px');
     $grid->add('name', 'Name', true);
     $grid->add('value', 'Value', true);
     $grid->add('<a href="' . route('apiKeys.index') . '/{{$id}}">View</a>', 'View');
     $grid->paginate(10);
     return view('apiKeys.index', compact('grid'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $entities = Entity::all();
     $grid = \DataGrid::source('entities');
     $grid->add('id', 'ID', true)->style('width:100px');
     $grid->add('name', 'Name', true);
     $grid->add('<a href="' . route('entities.index') . '/{{$id}}">View</a>', 'View');
     $grid->add('<a href="' . route('entities.index') . '/{{$id}}/edit">Edit</a>', 'Edit');
     $grid->paginate(10);
     return view('entities.index', compact('grid'));
 }
Ejemplo n.º 11
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $grid = \DataGrid::source(new Product());
     $grid->add('id', 'ID', true)->style("width:100px");
     $grid->add('name', trans('main.name'), true);
     $grid->add('price', trans('main.price'), true);
     $grid->edit('products/edit', trans('main.edit'), 'show|modify|delete');
     $grid->link('dashboard/products/create', trans('main.new'), "TR");
     $grid->orderBy('id', 'desc');
     $grid->paginate(10);
     return view('dashboard.index', compact('grid'));
 }
Ejemplo n.º 12
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Grupo());
     $this->filter->add('nome', 'Name', 'text');
     $this->filter->submit('search');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('nome', 'Name');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 13
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Area());
     $this->filter->add('nombre', 'Nombre', 'text');
     $this->filter->submit('Buscar');
     $this->filter->reset('Limpiar');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('nombre', 'Nombre');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 14
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Categoria());
     $this->filter->add('name', 'Nome', 'text');
     $this->filter->submit('buscar');
     $this->filter->reset('resetar');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('id', 'ID');
     $this->grid->add('name', 'Nome');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 15
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Admins());
     $this->filter->add('first_name', 'Nome', 'text');
     $this->filter->submit('buscar');
     $this->filter->reset('resetar');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('first_name', 'Name');
     $this->grid->add('email', 'Email');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 16
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Video());
     $this->filter->add('Nome', 'Nome', 'text');
     $this->filter->submit('Buscar');
     $this->filter->reset('Resetar');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('nome', 'Nome');
     $this->grid->add('url', 'url');
     $this->grid->add('description', 'Descrição');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 17
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(\App\Movement::with('person', 'category', 'group'));
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('fecha', 'Fecha', 'date');
     $this->grid->add('tipo', 'Tipo');
     $this->grid->add('monto', 'Monto');
     $this->grid->add('{{ $category->nombre }}', 'Categoría', 'category_id');
     $this->grid->add('{{ $person->nombre }}', 'Persona', 'person_id');
     $this->grid->add('{{ $group->nombre }}', 'Grupo', 'group_id');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 18
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new Admin());
     $this->filter->add('id', 'ID', 'text');
     $this->filter->add('name', 'Name', 'text');
     $this->filter->submit('search');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('id', 'ID', true)->style("width:100px");
     $this->grid->add('first_name', 'first name');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 19
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Newsletter());
     $this->filter->add('name', 'Nome', 'text');
     $this->filter->submit('Buscar');
     $this->filter->reset('resetar');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('name', 'Nome');
     $this->grid->add('email', 'Email');
     $this->grid->add('bairro', 'Bairro');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 20
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Posts());
     $this->filter->add('name', 'Nome', 'text');
     $this->filter->submit('buscar');
     $this->filter->reset('limpar');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('id', 'id');
     $this->grid->add('name', 'Nome');
     $this->grid->add('description', 'Descrição');
     $this->grid->add('date_old', 'Data');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 21
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new Permission());
     $this->filter->add('id', 'ID', 'text');
     $this->filter->add('name', 'Name', 'text');
     $this->filter->submit('search');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('id', 'ID', true)->style("width:100px");
     $this->grid->add('name', 'Url')->style('width:100px');
     $this->grid->add('label', 'Description');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 22
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Mark());
     $this->filter->add('name', 'Nome', 'text');
     $this->filter->submit('buscar');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('address', 'Endereço');
     $this->grid->add('description', 'Descrição');
     $this->grid->add('name', 'Nome');
     $this->grid->add('email', 'E-mail');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 23
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Blog());
     $this->filter->add('id', 'ID', 'text');
     $this->filter->add('title', 'Title', 'text');
     $this->filter->submit('search');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('id', 'ID', true)->style("width:100px");
     $this->grid->add('title', 'title');
     $this->grid->add('socialPoint', 'social Point');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 24
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new Link());
     $this->filter->add('id', 'ID', 'text');
     $this->filter->add('name', 'Name', 'text');
     $this->filter->submit('search');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('id', 'ID', true)->style("width:100px");
     $this->grid->add('display', 'Disasfasfasfasplay');
     $this->grid->add('url', 'Masfasfasfodel');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 25
0
    /**
     * Display a listing of hotels
     *
     * @return Response
     */
    public function index()
    {
        $filter = DataFilter::source(Hotel::with('pais'));
        $filter->add('nome_br', 'Nome - PT', 'text');
        $filter->add('pais.name', 'Paises', 'text');
        $filter->add('estrelas', 'Tipo (Estrelas)', 'select')->options(array('' => 'Tipo (Estrelas)', 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5));
        $filter->submit('Filtrar');
        $filter->reset('Limpar Filtro');
        $filter->build();
        $grid = DataGrid::source($filter);
        //same source types of DataSet
        $grid->attributes(array("class" => "table table-striped table-hover"));
        $grid->add('nome_br', 'Nome PT', true);
        //field name, label, sortable
        $grid->add('nome_en', 'Nome EN');
        //relation.fieldname
        $grid->add('publicado', 'Publicado', true);
        $grid->add('pais.name', 'Pais');
        $grid->add('<div title="" class="five-stars-container" data-toggle="tooltip" data-placement="bottom" data-original-title="{{$estrelas or 0}} Estrelas">
					   		<span class="five-stars" style="width: {{$estrelas * 20}}%;"></span>
					</div>', 'Estrelas');
        $grid->add('
					<a class="" title="Visualizar" href="admin/hotel/{{$id}}"><span class="glyphicon glyphicon-eye-open"> </span></a>
					<a class="" title="Modificar" href="admin/hotel/{{$id}}/edit"><span class="glyphicon glyphicon-edit"> </span></a>
					<a class="text-danger" title="Deletar" href="admin/hotel/delete/{{$id}}"><span class="glyphicon glyphicon-trash"> </span></a>
					', 'Ações');
        //$grid->edit('admin/hotel/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions
        $grid->link('admin/hotel/create', "Adicionar Novo", "TR");
        //add button
        $grid->orderBy('id', 'desc');
        //default orderby
        $grid->paginate(10);
        //pagination
        $grid->attributes(array('class' => 'table table-striped table-hover'));
        //Transforma TinyInteger de Publicado em Sim ou Não ao invez de 1 ou 0
        $grid->row(function ($row) {
            if ($row->cell('publicado')->value == 1) {
                $row->cell('publicado')->value = '<span class="label label-success"> Sim </span>';
            } else {
                $row->cell('publicado')->value = '<span class="label label-danger"> Não </span>';
            }
        });
        // $hotel = Hotel::find(1);
        // echo $hotel->destino->{'nome_br'};
        // dd();
        return View::make('admin.hotel.index', compact('filter', 'grid'));
    }
Ejemplo n.º 26
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\People());
     $this->filter->add('name', 'Nombre', 'text');
     $this->filter->submit('search');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('nombre', 'Nombre');
     $this->grid->add('{{ $area->nombre }}', 'Area', 'area_id');
     $this->grid->add('sueldo', 'Sueldo');
     $this->grid->add('aporte', 'Aporte');
     $this->grid->add('egresos', 'Gastos');
     $this->addStylesToGrid();
     return $this->returnView();
 }
Ejemplo n.º 27
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Slider());
     $this->filter->add('active', 'Active', 'select')->options(\App\Slider::lists("Active", "active")->all());
     $this->filter->add('weight', 'Weight', 'text');
     $this->filter->add('img_url', 'Image', 'text');
     $this->filter->submit('search');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('active', 'Active', 'active');
     $this->grid->add('weight', 'Weight', 'weight');
     $this->grid->add('img_url', 'Image');
     $this->addStylesToGrid();
     return $this->returnView();
 }
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\OpinionFinderSentiments());
     $this->filter->add('opinionfinder', 'OpinionFinder', 'text');
     $this->filter->submit('search');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('id', 'ID', true);
     $this->grid->add('date', 'Date', true);
     $this->grid->add('symbol_id', 'Symbol ID', true);
     $this->grid->add('polarity', 'Polarity', true);
     $this->grid->add('created_at', 'Created At', true);
     $this->grid->add('updated_at', 'Updated At', true);
     return $this->returnView();
 }
Ejemplo n.º 29
0
 /**
  * Display a listing of users
  *
  * @return Response
  */
 public function getIndex()
 {
     $filter = DataFilter::source(new User());
     $filter->add('nome', 'Nome completo', 'text');
     $filter->add('username', 'Login', 'text');
     $filter->add('email', 'E-mail', 'text');
     $filter->add('is_admin', 'Administrador', 'select')->options(array('' => 'Todos', 0 => 'Clientes', 1 => 'Administradores'));
     $filter->submit('Filtrar');
     $filter->reset('Limpar Filtro');
     $filter->build();
     $grid = DataGrid::source($filter);
     //same source types of DataSet
     $grid->attributes(array("class" => "table table-striped table-hover"));
     $grid->add('nome', 'Nome completo', true);
     //field name, label, sortable
     $grid->add('email', 'E-mail', true);
     //relation.fieldname
     $grid->add('publicado', 'Habilitado', true);
     $grid->add('confirmed', 'Confirmado', true);
     $grid->edit('admin/usuario/crud', 'Ações', 'show|modify|delete');
     //shortcut to link DataEdit actions
     $grid->link('admin/usuario/crud', "Adicionar Novo", "TR");
     //add button
     $grid->orderBy('id', 'desc');
     //default orderby
     $grid->paginate(10);
     //pagination
     $grid->attributes(array('class' => 'table table-striped table-hover'));
     //Transforma TinyInteger de Publicado em Sim ou Não ao invez de 1 ou 0
     $grid->row(function ($row) {
         if ($row->cell('publicado')->value == 1) {
             $row->cell('publicado')->value = '<span class="label label-success"> Sim </span>';
         } else {
             $row->cell('publicado')->value = '<span class="label label-danger"> Não </span>';
         }
         if ($row->cell('confirmed')->value == 1) {
             $row->cell('confirmed')->value = '<span class="label label-success"> Confirmado </span>';
         } else {
             $row->cell('confirmed')->value = '<span class="label label-danger"> Não Confirmado </span>';
         }
     });
     // $user = user::find(1);
     // echo $user->destino->{'nome_br'};
     // dd();
     return View::make('admin.user.index', compact('filter', 'grid'));
 }
Ejemplo n.º 30
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(Role::with('permissions'));
     $this->filter->add('id', 'ID', 'text');
     $this->filter->add('name', 'Name', 'text');
     $this->filter->submit('search');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('id', 'ID', true)->style("width:100px");
     $this->grid->add('name', 'Name')->style('width:100px');
     $this->grid->add('label', 'Description');
     $this->grid->add('{{ implode(", ", $permissions->lists("name")->all()) }}', 'name');
     $this->addStylesToGrid();
     return $this->returnView();
 }