1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/app/Providers/AppServiceProvider.php

45 lines
933 B
PHP
Raw Normal View History

2018-10-04 19:10:43 +02:00
<?php
namespace App\Providers;
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()
{
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()
{
$this->loadHelpers();
}
protected function loadHelpers()
{
foreach (glob(__DIR__.'/../Helpers/*.php') as $filename) {
require_once $filename;
}
2018-10-04 19:10:43 +02:00
}
}