From 6f359e31d8402da1360507922132f127b51ecce1 Mon Sep 17 00:00:00 2001 From: Ariful islam Date: Mon, 17 Jan 2022 18:38:53 +0600 Subject: [PATCH] change spelling and others --- composer.json | 2 +- src/Config/courier.php | 2 +- src/Log/Log.php | 24 ++++++++++++------------ src/Models/MultiCourierLog.php | 8 ++++++++ src/MultiCourierServiceProvider.php | 13 ++----------- 5 files changed, 24 insertions(+), 25 deletions(-) create mode 100644 src/Models/MultiCourierLog.php diff --git a/composer.json b/composer.json index a76e4cd..ec0e314 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ }, "autoload": { "psr-4": { - "Xenon\\LaravelBDSms\\": "src/" + "Xenon\\MultiCourier\\": "src/" } }, "extra": { diff --git a/src/Config/courier.php b/src/Config/courier.php index 8f82d3f..6a5bc1f 100644 --- a/src/Config/courier.php +++ b/src/Config/courier.php @@ -6,7 +6,7 @@ | | This file is key value a pair of providers. Individual provider has different types of | params and api request params. This file is generated after running command below from your terminal. -| php artisan vendor:publish --provider="Xenon\\LaravelBDSmsLog\\LaravelBDSmsServiceProvider" +| php artisan vendor:publish --provider="Xenon\\MultiCourier\\MultiCourierServiceProvider" | .Here All data ar dynamically coming from .env file. | Be sure to confirm to select default provider during use SMS facade, otherwise you can manually send sms | by selecting provider. diff --git a/src/Log/Log.php b/src/Log/Log.php index f4eb238..becd7ee 100644 --- a/src/Log/Log.php +++ b/src/Log/Log.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; -use Xenon\MultiCourier\Models\LaravelBDSmsLog; +use Xenon\MultiCourier\Models\MultiCourierLog; class Log @@ -18,27 +18,27 @@ class Log */ public function createLog(array $data) { - LaravelBDSmsLog::create($data); + MultiCourierLog::create($data); } /** - * @return Model|\Illuminate\Database\Query\Builder|object|LaravelBDSmsLog|null + * @return Model|\Illuminate\Database\Query\Builder|object|MultiCourierLog|null * @version v1.0.35 * @since v1.0.35 */ public function viewLastLog() { - return LaravelBDSmsLog::orderBy('id', 'desc')->first(); + return MultiCourierLog::orderBy('id', 'desc')->first(); } /** - * @return Collection|LaravelBDSmsLog[] + * @return Collection|MultiCourierLog[] * @since v1.0.35 * @version v1.0.35 */ public function viewAllLog() { - return LaravelBDSmsLog::all(); + return MultiCourierLog::all(); } /** @@ -48,30 +48,30 @@ public function viewAllLog() public function clearLog() { DB::statement("SET foreign_key_checks=0"); - LaravelBDSmsLog::truncate(); + MultiCourierLog::truncate(); DB::statement("SET foreign_key_checks=1"); } /** * @param $provider - * @return Builder[]|Collection|\Illuminate\Support\Collection|LaravelBDSmsLog[] + * @return Builder[]|Collection|\Illuminate\Support\Collection|MultiCourierLog[] * @since v1.0.35 * @version v1.0.35 */ public function logByProvider($provider) { - return LaravelBDSmsLog::where('provider', $provider)->get(); + return MultiCourierLog::where('provider', $provider)->get(); } /** - * @return Builder[]|Collection|\Illuminate\Support\Collection|LaravelBDSmsLog[] + * @return Builder[]|Collection|\Illuminate\Support\Collection|MultiCourierLog[] * @since v1.0.35 * @version v1.0.35 */ public function logByDefaultProvider() { $provider = config('sms.default_provider'); - return LaravelBDSmsLog::where('provider', config('sms.providers')[$provider])->get(); + return MultiCourierLog::where('provider', config('sms.providers')[$provider])->get(); } /** @@ -81,7 +81,7 @@ public function logByDefaultProvider() */ public function total(): int { - return LaravelBDSmsLog::count(); + return MultiCourierLog::count(); } /** diff --git a/src/Models/MultiCourierLog.php b/src/Models/MultiCourierLog.php new file mode 100644 index 0000000..7df6cdf --- /dev/null +++ b/src/Models/MultiCourierLog.php @@ -0,0 +1,8 @@ +app->bind('LaravelBDSms', function () { + $this->app->bind('MultiCourier', function () { $provider = config('sms.default_provider'); @@ -35,7 +35,7 @@ public function register() return new SMS($sender); }); - $this->app->bind('LaravelBDSmsLogger', function () { + $this->app->bind('MultiCourierLogger', function () { return new Log; }); @@ -59,15 +59,6 @@ public function boot() ]); - if ($this->app->runningInConsole()) - - if (!class_exists('CreateLaravelbdSmsTable')) { - - $this->publishes([ - __DIR__ . '/Database/migrations/create_laravelbd_sms_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_laravelbd_sms_table.php'), - - ], 'migrations'); - } } }