PHP Classes

File: app/Providers/AppServiceProvider.php

Recommend this page to a friend!
  Classes of Thierry Feuzeu   Jaxon DB Admin   app/Providers/AppServiceProvider.php   Download  
File: app/Providers/AppServiceProvider.php
Role: Class source
Content typex: text/plain
Description: Class source
Class: Jaxon DB Admin
Web application to manage SQL of databases
Author: By
Last change: Protect the access to the logging page with a gate.
Date: 1 month ago
Size: 630 bytes
 

Contents

Class file image Download
<?php

namespace App\Providers;

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

use function
config;
use function
in_array;

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

   
/**
     * Bootstrap any application services.
     */
   
public function boot(): void
   
{
       
// Auth gate for the DbAdmin logging page
       
Gate::define('logging', fn (User $user) =>
           
in_array($user->email, config('dbadmin.logging.allowed', [])));
    }
}