protected function registerGlide()
    {
        $this->app->singleton('\League\Glide\Server', function ($app) {
            $fileSystem = $app->make(Filesystem::class);

            $uploadDir = config('laravelimage.uploadDir');
            // Set source filesystem
            $source = new LeagueFilesystem(
                new Local($uploadDir)
            );

            // Set cache filesystem
            $cache = new LeagueFilesystem(
                new Local($fileSystem->getDriver()->getAdapter()->getPathPrefix() . '/laravel-image-cache')
            );

            // Setup glide server
            return ServerFactory::create([
                'source'   => $source,
                'cache'    => $cache,
                'base_url' => config('laravelimage.routePath') . '/' . basename($uploadDir),
                'response' => new LaravelResponseFactory(),
            ]);
        });
    }
protected function registerGlide()
    {
        $this->app->singleton('\League\Glide\Server', function ($app) {
            $fileSystem = $app->make(Filesystem::class);

            $uploadDir = config('laravelimage.uploadDir');
            // Set source filesystem
            $source = new LeagueFilesystem(
                new Local($uploadDir)
            );

            // Set cache filesystem
            $cache = new LeagueFilesystem(
                new Local($fileSystem->getDriver()->getAdapter()->getPathPrefix() . '/laravel-image-cache')
            );

            // Setup glide server
            return ServerFactory::create([
                'source'   => $source,
                'cache'    => $cache,
                'base_url' => config('laravelimage.routePath') . '/' . basename($uploadDir),
                'response' => new LaravelResponseFactory(),
            ]);
        });
    }
protected function registerGlide ( ) { $ this -> app -> singleton ( '\League\Glide\Server' , function ( $ app ) { $ fileSystem = $ app -> make ( Filesystem :: class ) ; $ uploadDir = config ( 'laravelimage.uploadDir' ) ; // Set source filesystem $ source = new LeagueFilesystem ( new Local ( $ uploadDir ) ) ; // Set cache filesystem $ cache = new LeagueFilesystem ( new Local ( $ fileSystem -> getDriver ( ) -> getAdapter ( ) -> getPathPrefix ( ) . '/laravel-image-cache' ) ) ; // Setup glide server return ServerFactory :: create ( [ 'source' => $ source , 'cache' => $ cache , 'base_url' => config ( 'laravelimage.routePath' ) . '/' . basename ( $ uploadDir ) , 'response' => new LaravelResponseFactory ( ) , ] ) ; } ) ; }
Register glide.
Register glide .