2017-06-09 02:28:26 +08:00
|
|
|
<?php
|
2018-03-19 09:37:35 +08:00
|
|
|
|
2017-06-09 02:28:26 +08:00
|
|
|
namespace App\Providers;
|
|
|
|
|
2018-03-19 09:37:35 +08:00
|
|
|
use App\Models\Aircraft;
|
|
|
|
use App\Models\Airport;
|
2018-05-31 03:00:20 +08:00
|
|
|
use App\Models\FlightField;
|
|
|
|
use App\Models\FlightFieldValue;
|
2018-03-19 09:37:35 +08:00
|
|
|
use App\Models\Journal;
|
|
|
|
use App\Models\JournalTransaction;
|
|
|
|
use App\Models\Observers\AircraftObserver;
|
|
|
|
use App\Models\Observers\AirportObserver;
|
|
|
|
use App\Models\Observers\JournalObserver;
|
|
|
|
use App\Models\Observers\JournalTransactionObserver;
|
|
|
|
use App\Models\Observers\SettingObserver;
|
2018-08-27 00:40:04 +08:00
|
|
|
use App\Models\Observers\Sluggable;
|
2018-03-20 09:50:40 +08:00
|
|
|
use App\Models\Observers\SubfleetObserver;
|
2018-03-19 09:37:35 +08:00
|
|
|
use App\Models\PirepField;
|
2018-07-13 10:20:10 +08:00
|
|
|
use App\Models\PirepFieldValue;
|
2018-03-19 09:37:35 +08:00
|
|
|
use App\Models\Setting;
|
2018-03-20 09:50:40 +08:00
|
|
|
use App\Models\Subfleet;
|
2018-02-21 12:33:09 +08:00
|
|
|
use App\Repositories\SettingRepository;
|
2018-03-12 07:00:42 +08:00
|
|
|
use App\Services\ModuleService;
|
2017-12-08 04:06:12 +08:00
|
|
|
use Illuminate\Support\Facades\Schema;
|
2017-06-09 02:28:26 +08:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2018-03-11 23:55:20 +08:00
|
|
|
use View;
|
2017-06-11 07:27:19 +08:00
|
|
|
|
2017-06-09 02:28:26 +08:00
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
{
|
2018-03-11 23:55:20 +08:00
|
|
|
public function boot(): void
|
2017-06-09 02:28:26 +08:00
|
|
|
{
|
2017-12-08 04:06:12 +08:00
|
|
|
Schema::defaultStringLength(191);
|
2018-05-02 09:58:05 +08:00
|
|
|
|
2018-05-02 11:52:31 +08:00
|
|
|
/*Carbon::serializeUsing(function ($carbon) {
|
2018-05-02 09:58:05 +08:00
|
|
|
return $carbon->format('U');
|
2018-05-02 11:52:31 +08:00
|
|
|
});*/
|
2018-05-02 09:58:05 +08:00
|
|
|
|
2017-12-10 11:56:26 +08:00
|
|
|
$this->app->bind('setting', SettingRepository::class);
|
2018-03-11 23:55:20 +08:00
|
|
|
|
2018-03-12 07:00:42 +08:00
|
|
|
View::share('moduleSvc', app(ModuleService::class));
|
2018-03-19 09:37:35 +08:00
|
|
|
|
|
|
|
// Model observers
|
|
|
|
Aircraft::observe(AircraftObserver::class);
|
|
|
|
Airport::observe(AirportObserver::class);
|
|
|
|
Journal::observe(JournalObserver::class);
|
|
|
|
JournalTransaction::observe(JournalTransactionObserver::class);
|
2018-05-31 03:00:20 +08:00
|
|
|
|
|
|
|
FlightField::observe(Sluggable::class);
|
|
|
|
FlightFieldValue::observe(Sluggable::class);
|
|
|
|
|
|
|
|
PirepField::observe(Sluggable::class);
|
2018-07-13 10:20:10 +08:00
|
|
|
PirepFieldValue::observe(Sluggable::class);
|
2018-05-31 03:00:20 +08:00
|
|
|
|
2018-03-19 09:37:35 +08:00
|
|
|
Setting::observe(SettingObserver::class);
|
2018-03-20 09:50:40 +08:00
|
|
|
Subfleet::observe(SubfleetObserver::class);
|
2017-06-09 02:28:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*/
|
2018-03-11 23:55:20 +08:00
|
|
|
public function register(): void
|
2017-06-09 02:28:26 +08:00
|
|
|
{
|
2018-08-27 00:40:04 +08:00
|
|
|
// Only dev environment stuff
|
2018-03-26 05:19:24 +08:00
|
|
|
if ($this->app->environment() === 'dev') {
|
2018-08-27 00:40:04 +08:00
|
|
|
// Only load the IDE helper if it's included. This lets use distribute the
|
|
|
|
// package without any dev dependencies
|
2018-08-27 02:51:47 +08:00
|
|
|
/* @noinspection NestedPositiveIfStatementsInspection */
|
2018-03-26 05:19:24 +08:00
|
|
|
if (class_exists(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class)) {
|
|
|
|
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
|
|
|
|
}
|
|
|
|
}
|
2017-06-09 02:28:26 +08:00
|
|
|
}
|
|
|
|
}
|