Skip to content

Commit

Permalink
update stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
inmanturbo committed Mar 14, 2024
1 parent 46183f5 commit f3dc4f7
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace App\Providers;

use App\Models\SuperAdmin;
use App\Models\User;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}

/**
* Bootstrap any application services.
*/
public function boot(): void
{
Gate::before(function (SuperAdmin|User $user, string $ability) {
if ($user instanceof SuperAdmin) {
return true;
}
});

Gate::after(function (SuperAdmin|User $user, string $ability, bool|null $result, mixed $arguments) {
if ($user instanceof SuperAdmin) {
return true;
}
});
}
}
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions stubs/one-app/app/Providers/DomainServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public function boot(): void

public function configureRequests()
{
if($this->app->environment('production')) {
$this->app['url']->forceScheme('https');
}

if (! $this->app->runningInConsole()) {
$domain = $this->app->request->getHost();

Expand Down
File renamed without changes.

0 comments on commit f3dc4f7

Please sign in to comment.