Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Non-static method Chumper\Datatable\Datatable::collection() should not be called statically, assuming $this from incompatible context #327

Open
minedun6 opened this issue Aug 11, 2015 · 0 comments

Comments

@minedun6
Copy link

I don't know why it isn't working.
this is my master page.

{!! HTML::script('//code.jquery.com/jquery-1.11.3.min.js') !!} {!! HTML::style('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css') !!} {!! HTML::style('https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.5/flatly/bootstrap.min.css') !!} {!! HTML::style('https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css') !!} {!! HTML::style('//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css') !!} {!! HTML::style('//cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css') !!} {!! HTML::style('css/app.css') !!} {!! HTML::style('css/card.css') !!} <title>LaraBook</title>

@include('partials.navbar')

@include ('flash::message') @yield('content')

{!! HTML::script('//code.jquery.com/jquery-migrate-1.2.1.min.js') !!}
{!! HTML::script('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js') !!}
{!! HTML::script('https://twitter.github.io/typeahead.js/releases/latest/typeahead.bundle.js') !!}
{!! HTML::script('https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.3/handlebars.min.js') !!}
{!! HTML::script('https://cdnjs.cloudflare.com/ajax/libs/jQuery-slimScroll/1.3.6/jquery.slimscroll.js') !!}
{!! HTML::script('//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js') !!}
{!! HTML::script('//cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.js') !!}
{!! HTML::script('js/app.js') !!}

and this where my controller

public function members($name, $team)
{
return Datatable::collection(User::all(array('id','name')))
->showColumns('id', 'name')
->searchColumns('name')
->orderColumns('id','name')
->make();
}

and this is the call in the view

{!! Datatable::table()->addColumn('id','Name')->setUrl(route('team_members'))->render() !!}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant