Skip to content

Commit e1a0bfd

Browse files
authored
Merge pull request #673 from awcodes/fix/glide-server-config
Fix: glide server config in GlideManager and update upgrade guide
2 parents 3ebdc42 + 7eac915 commit e1a0bfd

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

UPGRADE.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -507,18 +507,22 @@ The `CurationPreset` API remains the same in v4, so your existing presets should
507507
508508
### Step 12: Update Glide Server Factories (If Customized)
509509

510-
If you have a custom Glide server factory, the interface hasn't changed, but be aware:
510+
If you have a custom Glide server factory it should be set in a Service Provider with the Glide Facade:
511511

512512
```php
513-
// Both v3 and v4 use the same interface
514-
use Awcodes\Curator\Glide\Contracts\ServerFactory;
513+
use Awcodes\Curator\Facades\Glide;
515514

516-
class CustomServerFactory implements ServerFactory
515+
public function register(): void
517516
{
518-
public function getFactory(): ServerFactory | Server
519-
{
520-
// Implementation remains the same
521-
}
517+
Glide::serverConfig([
518+
'driver' => 'imagick',
519+
'response' => new LaravelResponseFactory(app('request')),
520+
'source' => storage_path('app'),
521+
'source_path_prefix' => 'public',
522+
'cache' => storage_path('app'),
523+
'cache_path_prefix' => '.cache',
524+
'max_image_size' => 2000 * 2000,
525+
]);
522526
}
523527
```
524528

src/Config/GlideManager.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ class GlideManager
1717
use EvaluatesClosures;
1818
use HasGliderFallbacks;
1919

20-
public $config;
21-
2220
protected array $serverConfig;
2321

2422
protected string $token;
@@ -46,7 +44,7 @@ public function basePath(string $basePath): static
4644

4745
public function getServer(): Server
4846
{
49-
return ServerFactory::create($this->config ?? $this->getDefaultServerConfig());
47+
return ServerFactory::create($this->serverConfig ?? $this->getDefaultServerConfig());
5048
}
5149

5250
public function getBasePath(): string

0 commit comments

Comments
 (0)