LaravelPackages.net
Acme Inc.
Toggle sidebar
ericli1018/laravel-kendo-ui-datasource

Kendo UI datasource for Laravel

138
0
1.0.13
About ericli1018/laravel-kendo-ui-datasource

ericli1018/laravel-kendo-ui-datasource is a Laravel package for kendo ui datasource for laravel. It currently has 0 GitHub stars and 138 downloads on Packagist (latest version 1.0.13). Install it with composer require ericli1018/laravel-kendo-ui-datasource. Discover more Laravel packages by ericli1018 or browse all Laravel packages to compare alternatives.

Last updated

Laravel Kendo UI DataSource

ESSENTIALLY ALL WORK ON THIS PROJECT WAS ORIGINALLY DONE BY USER meowcakes. I HAVE FORKED THIS FROM ChemProf MERELY TO GIVE MYSELF CONTROL OVER THE DEPENDENCY VERSIONS. I TAKE NO CREDIT OR RESPONSIBILITY FOR THE ORIGINAL SCRIPTS, OTHER THAN THE TRIVIAL ADJUSTMENTS I HAVE MADE.

Server side Kendo UI DataSource implementation for Laravel

Version

Laravel 7 | Laravel 8 | Laravel 9 --------- | --------- | ----------- v1.* | v1.* | v1.*

Installation

Start by installing Laravel Kendo UI Datasoure if you have not done so already:

composer require ericli1018/laravel-kendo-ui-datasource

To get the latest version simply require it in your composer.json file.

"ericli1018/laravel-kendo-ui-datasource": "dev-main"

(Optional) You can register the facade in the aliases key of your app/config/app.php file. Default alias is "KendoDataSource".

'aliases' => array(
    'KendoDataSource' => 'Ericli1018\LaravelKendoUiDatasource\Facade',
)

Basic Example

$kendoUIDS = KendoDataSource::make(
	$request->all(),
	[
		// (Optional) specifying table, join table or table alias for query.
		// 'email' => ['string', 'join_table_name'],
		'id' => 'number',
		'name' => 'string',
		'created_at' => 'date',
		'fully_registered' => 'boolean',
	],
	// Option main table name for query
	// 'main_table_name'
);
$query = (new App\Models\User())->newQuery();
$count = $kendoUIDS->execute($query);
// Option column name for count
// $count = $kendoUIDS->execute($query, 'column name');
return ['data' => $query->get()->toArray(), 'total' => $count];

Example with Table Alias

$kendoUIDS = KendoDataSource::make(
	$request->all(),
	[
		'id' => ['number', 'm'],
		'email' => ['string'],
		'name' => 'string',
	],
	'm'
);
$query = (new App\Models\User())->newQuery()->from('users as m');
$count = $kendoUIDS->execute($query, '`m`.`id`');
return ['data' => $query->get()->toArray(), 'total' => $count];
Comments