-
Notifications
You must be signed in to change notification settings - Fork 1
Create a Controller
Patrick Samson edited this page Feb 19, 2016
·
4 revisions
Add this in your routes.php
file
Route::controller('/datagrid', 'DatagridController');
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Lykegenes\DatagridBuilder\DatagridBuilder;
class DatagridController extends Controller
{
public function getIndex(DatagridBuilder $builder)
{
$datagrid = $builder->create('App\Datagrids\UsersDatagrid')
->setUrl('/datagrid/api-response');
return view('demo-datagrid', compact('datagrid'));
}
public function getApiResponse()
{
// Return some JSON here.
// We will add it later in this tutorial.
}
}