Separated laravel app to its own folder (#540)
This commit is contained in:
56
api/app/Providers/AppServiceProvider.php
Normal file
56
api/app/Providers/AppServiceProvider.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Billing\Subscription;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Cashier\Cashier;
|
||||
use Laravel\Dusk\DuskServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
if (config('filesystems.default') === 'local') {
|
||||
Storage::disk('local')->buildTemporaryUrlsUsing(function ($path, $expiration, $options) {
|
||||
return URL::temporarySignedRoute(
|
||||
'local.temp',
|
||||
$expiration,
|
||||
array_merge($options, ['path' => $path])
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
JsonResource::withoutWrapping();
|
||||
Cashier::calculateTaxes();
|
||||
Cashier::useSubscriptionModel(Subscription::class);
|
||||
|
||||
if ($this->app->runningUnitTests()) {
|
||||
Schema::defaultStringLength(191);
|
||||
}
|
||||
|
||||
Validator::includeUnvalidatedArrayKeys();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
if ($this->app->environment('local', 'testing') && class_exists(DuskServiceProvider::class)) {
|
||||
$this->app->register(DuskServiceProvider::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user