Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,18 +507,22 @@ The `CurationPreset` API remains the same in v4, so your existing presets should

### Step 12: Update Glide Server Factories (If Customized)

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

```php
// Both v3 and v4 use the same interface
use Awcodes\Curator\Glide\Contracts\ServerFactory;
use Awcodes\Curator\Facades\Glide;

class CustomServerFactory implements ServerFactory
public function register(): void
{
public function getFactory(): ServerFactory | Server
{
// Implementation remains the same
}
Glide::serverConfig([
'driver' => 'imagick',
'response' => new LaravelResponseFactory(app('request')),
'source' => storage_path('app'),
'source_path_prefix' => 'public',
'cache' => storage_path('app'),
'cache_path_prefix' => '.cache',
'max_image_size' => 2000 * 2000,
]);
}
```

Expand Down
4 changes: 1 addition & 3 deletions src/Config/GlideManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class GlideManager
use EvaluatesClosures;
use HasGliderFallbacks;

public $config;

protected array $serverConfig;

protected string $token;
Expand Down Expand Up @@ -46,7 +44,7 @@ public function basePath(string $basePath): static

public function getServer(): Server
{
return ServerFactory::create($this->config ?? $this->getDefaultServerConfig());
return ServerFactory::create($this->serverConfig ?? $this->getDefaultServerConfig());
}

public function getBasePath(): string
Expand Down