HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/agile-selling-wpb/app/Providers/AppServiceProvider.php
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;

use App\CorporateIdentity;
use App\Parameter;
use App\ServiceCity;
use App\UserInformation;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Blade;

// SFTP PCO
use Storage;
use League\Flysystem\Filesystem;
use League\Flysystem\Sftp\SftpAdapter;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Schema::defaultStringLength(191);

        // Se envian las avariables de la identidad corporativa
        view()->composer( 'cruz_verde', function( $view ){
            $obj = CorporateIdentity::where('id', 1)->first();
            $view->with('identity', $obj);
        });

        view()->composer( 'modules.head', function( $view ){
            $obj = CorporateIdentity::where('id', 1)->first();
            $view->with('identity', $obj);
        });

        view()->composer( 'modules.header', function( $view ){
            $obj = CorporateIdentity::where('id', 1)->first();
            $services = new ServiceCity();
            $services->setConnection('main-db');
            $servicesN = $services->where('active',1)->get();
            // $db_name = UserInformation::where('user_id',Auth::user()->id)->first();

            $view->with('identity', $obj)->with('services',$servicesN);
            // ->with('db_name',$db_name->current_db);
           // $view->with('identity', $obj);
        });
        view()->composer( 'auth.login', function( $view ){
            $obj = CorporateIdentity::where('id', 1)->first();
            $view->with('identity', $obj);
        });
        view()->composer( 'modules.aside', function( $view ){
            $obj = Parameter::where('id', 1)->first();
            $view->with('parameter', $obj);
        });
        view()->composer( 'layouts.app', function( $view ){
            $obj = CorporateIdentity::where('id', 1)->first();
            $view->with('identity', $obj);
        });
        Blade::directive('priceFormat', function ($price) {
            return "<?php echo '$' . number_format($price, 2); ?>";
        });

        // SFTP PCO
        Storage::extend('sftp', function ($app, $config) {
            $config["root"] = "IF-016/in/";
            return new Filesystem(new SftpAdapter($config));
        });
    }
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}