mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
957ac9f5d8
* Remove unnecessary save() on invoice * Update copyright * Working on Credit Repository * Implement credits as a paymentable entity * Add credit_id to transformer * fix rules for update payment * Fix random deleted_at keys in transformers * Fix for password_protect check
94 lines
2.5 KiB
PHP
94 lines
2.5 KiB
PHP
<?php
|
|
/**
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
*
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
*
|
|
* @license https://opensource.org/licenses/AAL
|
|
*/
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\Account;
|
|
use App\Models\Client;
|
|
use App\Models\Company;
|
|
use App\Models\CompanyToken;
|
|
use App\Models\Expense;
|
|
use App\Models\Invoice;
|
|
use App\Models\Payment;
|
|
use App\Models\Product;
|
|
use App\Models\Proposal;
|
|
use App\Models\Quote;
|
|
use App\Models\Task;
|
|
use App\Models\User;
|
|
use App\Observers\AccountObserver;
|
|
use App\Observers\ClientObserver;
|
|
use App\Observers\CompanyObserver;
|
|
use App\Observers\CompanyTokenObserver;
|
|
use App\Observers\ExpenseObserver;
|
|
use App\Observers\InvoiceObserver;
|
|
use App\Observers\PaymentObserver;
|
|
use App\Observers\ProductObserver;
|
|
use App\Observers\ProposalObserver;
|
|
use App\Observers\QuoteObserver;
|
|
use App\Observers\TaskObserver;
|
|
use App\Observers\UserObserver;
|
|
use Illuminate\Database\Eloquent\Relations\Relation;
|
|
use Illuminate\Support\Facades\Blade;
|
|
use Illuminate\Support\Facades\Schema;
|
|
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;
|
|
});
|
|
|
|
Schema::defaultStringLength(191);
|
|
|
|
User::observe(UserObserver::class);
|
|
Account::observe(AccountObserver::class);
|
|
Client::observe(ClientObserver::class);
|
|
Company::observe(CompanyObserver::class);
|
|
CompanyToken::observe(CompanyTokenObserver::class);
|
|
Expense::observe(ExpenseObserver::class);
|
|
Invoice::observe(InvoiceObserver::class);
|
|
Payment::observe(PaymentObserver::class);
|
|
Product::observe(ProductObserver::class);
|
|
Proposal::observe(ProposalObserver::class);
|
|
Quote::observe(QuoteObserver::class);
|
|
Task::observe(TaskObserver::class);
|
|
}
|
|
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
$this->loadHelpers();
|
|
}
|
|
|
|
protected function loadHelpers()
|
|
{
|
|
foreach (glob(__DIR__.'/../Helpers/*.php') as $filename) {
|
|
require_once $filename;
|
|
}
|
|
}
|
|
}
|