Laravel-admin: Encore\Admin\Grid::__toString() must not throw an exception, caught Error: Call to a member function select() on null

Created on 11 Sep 2017  ·  2Comments  ·  Source: z-song/laravel-admin

Hey,
I got an error every using select on filter, the error as bellow:
Encore\Admin\Grid::__toString() must not throw an exception, caught Error: Call to a member function select() on null
I have already tried #807 but still got the error

protected function grid()
{
        return Admin::grid(Devices::class, function (Grid $grid) {
          $grid->name()->sortable();

          $grid->filter(function($filter){
            $filter->useModal();
            $filter->disableIdFilter();

            $filter->is('building_id')->select(Building::all()->pluck('building', 'id'));
            $filter->like('name');
          });
        });
}

laravel framework version: 5.5.3
laravel-admin version: 1.5.3

Most helpful comment

In 1.5, $filter->is() renamed to $filter->equal(),and $filter->useModal(); has been removed.

All 2 comments

In 1.5, $filter->is() renamed to $filter->equal(),and $filter->useModal(); has been removed.

Thank you sir, I think I read a wrong version of documentation. cheers..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

greentornado picture greentornado  ·  3Comments

chenyongmin picture chenyongmin  ·  3Comments

benny-sun picture benny-sun  ·  3Comments

vlongen picture vlongen  ·  3Comments

piian picture piian  ·  3Comments