PHP Classes

File: app/Http/Middleware/DbAdminPackageConfig.php

Recommend this page to a friend!
  Packages of Thierry Feuzeu   Jaxon DB Admin   app/Http/Middleware/DbAdminPackageConfig.php   Download  
File: app/Http/Middleware/DbAdminPackageConfig.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Jaxon DB Admin
Web application to manage SQL of databases
Author: By
Last change:
Date: 1 year ago
Size: 1,045 bytes
 

Contents

Class file image Download
<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Lagdo\DbAdmin\DbAdminPackage;
use Symfony\Component\HttpFoundation\Response;

use function config;

class DbAdminPackageConfig
{
    /**
     * Handle an incoming request.
     *
     * @param  \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response)  $next
     */
    public function handle(Request $request, Closure $next): Response
    {
        // Copy the logging options into the DbAdminPackage package options.
        $options = config('jaxon.app.packages')[DbAdminPackage::class];
        $options['logging'] = [
            'options' => config('dbadmin.logging.options'),
            'database' => config('dbadmin.logging.database'),
        ];
        config([
            'jaxon.app.packages' => [
                DbAdminPackage::class => $options,
            ],
            'jaxon.lib.core.request.uri' => '/jaxon',
            'jaxon.lib.js.app.file' => 'app-0.2.3',
        ]);

        return $next($request);
    }
}