29 lines
630 B
PHP
29 lines
630 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\Settings;
|
|
use Illuminate\Support\Facades\App;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use LDC\MESBR\MesBr;
|
|
|
|
class MesBrApiServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Bootstrap the application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
App::singleton('mesBrAPI', function () {
|
|
/** @var \App\Models\Settings|null */
|
|
$settings = app(Settings::class);
|
|
|
|
return new MesBr(
|
|
config('mesbr.endpoint'),
|
|
$settings->discounts_campaign
|
|
);
|
|
});
|
|
}
|
|
}
|