40 lines
939 B
PHP
40 lines
939 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Providers;
|
||
|
|
|
||
|
|
use App\Models\Customer;
|
||
|
|
use App\Models\Staff;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\Relation;
|
||
|
|
use Illuminate\Support\Facades\URL;
|
||
|
|
use Illuminate\Support\ServiceProvider;
|
||
|
|
use Lunar\Facades\ModelManifest;
|
||
|
|
use Lunar\Facades\Telemetry;
|
||
|
|
|
||
|
|
class AppServiceProvider extends ServiceProvider
|
||
|
|
{
|
||
|
|
public function boot(): void
|
||
|
|
{
|
||
|
|
Telemetry::optOut();
|
||
|
|
|
||
|
|
if ($this->app->environment('production')) {
|
||
|
|
URL::forceScheme('https');
|
||
|
|
}
|
||
|
|
|
||
|
|
$this->app->booted(function () {
|
||
|
|
ModelManifest::replace(
|
||
|
|
\Lunar\Models\Contracts\Customer::class,
|
||
|
|
Customer::class,
|
||
|
|
);
|
||
|
|
|
||
|
|
$this->app['config']->set(
|
||
|
|
'auth.providers.staff.model',
|
||
|
|
Staff::class,
|
||
|
|
);
|
||
|
|
|
||
|
|
Relation::morphMap([
|
||
|
|
'staff' => \Lunar\Admin\Models\Staff::class,
|
||
|
|
]);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|