From 114d0f4f39c4d1f5f581d186d41050ca59e09f35 Mon Sep 17 00:00:00 2001 From: Yogesh Sharma Date: Thu, 7 Nov 2019 11:33:10 +0530 Subject: [PATCH] code refactoring --- composer.json | 2 +- src/Datatable.php | 4 ++-- src/DatatableServiceProvider.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 4efc640..0138cbc 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "iyogesharma/datatable-laravel", "description": "package to help in handling both server and client side datatable.js operations", "type": "helper", - "version": "1.0.3-dev", + "version": "1.0.3", "license": "MIT", "authors": [ { diff --git a/src/Datatable.php b/src/Datatable.php index 8b978a4..570e8ea 100644 --- a/src/Datatable.php +++ b/src/Datatable.php @@ -112,7 +112,7 @@ public function of($source) if ($this->valid($source)) { return $this; } - throw new \Exception("Data source must be instance of" . "\Illuminate\Database\Eloquent\Builder"); + throw new \Exception("Data source not recognize please check query and try again"); } /** @@ -128,7 +128,7 @@ public function make($source) if ($this->valid($source)) { return json_encode($this->response()); } - throw new \Exception("Data source must be instance of \Illuminate\Database\Eloquent\Builder"); + throw new \Exception("Data source not recognize please check query and try again"); } /** diff --git a/src/DatatableServiceProvider.php b/src/DatatableServiceProvider.php index 661bebf..136cca2 100644 --- a/src/DatatableServiceProvider.php +++ b/src/DatatableServiceProvider.php @@ -24,7 +24,6 @@ public function boot() public function register() { $dataTableConfig=__DIR__.'/config/Table.php'; - // merge config $this->mergeConfigFrom($dataTableConfig, 'datatable'); @@ -35,6 +34,7 @@ public function register() $this->app->singleton('datatable', function () { return new Datatable; }); + $this->app->singleton('table', function () { return new Table; });