osb/app/Providers/AppServiceProvider.php

45 lines
966 B
PHP

<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Intuit\Traits\IntuitSocialite;
use App\Models\{Checkout,Cost,Payment,Product,Service,Supplier};
class AppServiceProvider extends ServiceProvider
{
use IntuitSocialite;
/**
* Register any application services.
*/
public function register(): void
{
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Gate::define('wholesaler', function ($user) {
return $user->isWholesaler();
});
Gate::define('reseller', function ($user) {
return $user->isReseller();
});
$this->bootIntuitSocialite();
Route::model('co',Checkout::class);
Route::model('cso',Cost::class);
Route::model('po',Payment::class);
Route::model('pdo',Product::class);
Route::model('so',Service::class);
Route::model('spo',Supplier::class);
}
}