However, the cartalyst data grid requires a tri-monthly paid subscription. Therefore, the one I’m leaning toward is mesour. the data grid will be used throughout the admin of an application I’m building. the application is being built with Laravel and uses doctrine instead of Eloquent.
Does anyone have experience with these packages or others that might be more suitable considering the framework and persistence mechanism I’m using?
I’ve hooked up Mesour Data Grid with my application. It seems like a good solution. If anyone else want to use it you just need to make the application component available. I just added it as a binding in my service provider.
Also instead of having the data grid logic in my controllers I’m using ViewComposers as a data grids. Example below.
<?php namespace Modules\Core\Http\ViewComposers\Admin\User;
use Illuminate\View\View;
use Modules\Core\Repositories\UserRepository;
use Mesour\DataGrid\Sources\DoctrineGridSource;
use Mesour\UI\DataGrid;
use Mesour\Components\Application\IApplication;
class DataGridComposer {
protected $userRepository;
protected $uiApp;
public function __construct(UserRepository $userRepository,IApplication $uiApp) {
$this->userRepository = $userRepository;
$this->uiApp = $uiApp;
}
public function compose(View $view) {
$qb = $this->userRepository->createQueryBuilderForAdminDataGrid();
$source = new DoctrineGridSource($qb);
$source->setPrimaryKey('id');
$grid = new DataGrid('users',$this->uiApp);
$grid->setSource($source);
$grid->addText('id','ID');
$grid->addText('email','Email');
$grid->addDate('createdAt','Created');
$view->with('grid',$grid);
}
}
I’m using doctrine and the grid package has a doctrine source which is nice. However, if you’re using eloquant you will need to write a source as the mesour package does not include one.