Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

Commit

Permalink
change spelling and others
Browse files Browse the repository at this point in the history
  • Loading branch information
arif98741 committed Jan 17, 2022
1 parent 802cb4e commit 6f359e3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"autoload": {
"psr-4": {
"Xenon\\LaravelBDSms\\": "src/"
"Xenon\\MultiCourier\\": "src/"
}
},
"extra": {
Expand Down
2 changes: 1 addition & 1 deletion src/Config/courier.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 12 additions & 12 deletions src/Log/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
}

/**
Expand 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();
}

/**
Expand All @@ -81,7 +81,7 @@ public function logByDefaultProvider()
*/
public function total(): int
{
return LaravelBDSmsLog::count();
return MultiCourierLog::count();
}

/**
Expand Down
8 changes: 8 additions & 0 deletions src/Models/MultiCourierLog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Xenon\MultiCourier\Models;

class MultiCourierLog
{

}
13 changes: 2 additions & 11 deletions src/MultiCourierServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MultiCourierServiceProvider extends ServiceProvider
*/
public function register()
{
$this->app->bind('LaravelBDSms', function () {
$this->app->bind('MultiCourier', function () {

$provider = config('sms.default_provider');

Expand All @@ -35,7 +35,7 @@ public function register()
return new SMS($sender);
});

$this->app->bind('LaravelBDSmsLogger', function () {
$this->app->bind('MultiCourierLogger', function () {
return new Log;
});

Expand All @@ -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');
}
}

}

0 comments on commit 6f359e3

Please sign in to comment.