2018-10-04 19:10:43 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2018-10-22 14:04:37 +02:00
|
|
|
use Illuminate\Database\Eloquent\Relations\Relation;
|
|
|
|
use Illuminate\Support\Facades\Blade;
|
2018-10-04 19:10:43 +02:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
2018-10-22 14:04:37 +02:00
|
|
|
Relation::morphMap([
|
|
|
|
'invoices' => '\App\Models\Invoice',
|
|
|
|
'proposals' => '\App\Models\Proposal',
|
|
|
|
]);
|
|
|
|
|
|
|
|
Blade::if('env', function($environment){
|
|
|
|
return config('ninja.environment') === $environment;
|
|
|
|
});
|
2018-10-04 19:10:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
2019-01-22 10:47:26 +01:00
|
|
|
$this->loadHelpers();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function loadHelpers()
|
|
|
|
{
|
|
|
|
foreach (glob(__DIR__.'/../Helpers/*.php') as $filename) {
|
|
|
|
require_once $filename;
|
|
|
|
}
|
2018-10-04 19:10:43 +02:00
|
|
|
}
|
|
|
|
}
|