adamtorok96/bootstrap-table-ajax
Bootstrap Table Ajax for Laravel 5
Links
Bootstrap (data) tables Laravel
Install
composer require composer require adamtorok96/bootstrap-table-ajax
Into config/app.php put this under providers:
AdamTorok96\BootstrapTableAjax\BootstrapTableAjaxServiceProvider::class,
Into config/app.php put this under aliases:
'AjaxResponse' => AdamTorok96\BootstrapTableAjax\Facades\AjaxResponse::class,
Usage
Example #1
use AdamTorok96\BootstrapTableAjax\AjaxResponse;
class UsersController extends Controller
{
public function index(Request $request)
{
return AjaxResponse::base(User::query(), $request)
->search([
'name',
'email'
])
->orderBy('name')
->get()
;
}
}
Example #2
use AdamTorok96\BootstrapTableAjax\AjaxResponse;
class NewsController extends Controller
{
public function index(Ajax $request)
{
return AjaxResponse::base(News::query(), $request)
->search([
'title',
'author.name'
])
->orderBy('title')
->with([
'author'
])
->withCount([
'comments'
])
->get()
;
}
}
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
631,580,251
9,707
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
404,034,618
608
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
384,821,166
4,658