Add Laravel 11 Support

This commit is contained in:
philipp lang 2024-09-21 22:45:44 +02:00
parent 6d8e9de3d7
commit 77cfe9bbc7
4 changed files with 1362 additions and 896 deletions

View File

@ -23,13 +23,13 @@
], ],
"require": { "require": {
"spatie/laravel-medialibrary": "^11.0", "spatie/laravel-medialibrary": "^11.0",
"laravel/framework": "^10.0", "laravel/framework": "^11.0",
"spatie/laravel-data": "^3.1", "spatie/laravel-data": "^4.0",
"pestphp/pest": "^2.0" "pestphp/pest": "^3.0"
}, },
"require-dev": { "require-dev": {
"orchestra/testbench": "^8.0", "orchestra/testbench": "^9.0",
"illuminate/console": "^10.0" "illuminate/console": "^11.0"
}, },
"scripts": { "scripts": {
"post-autoload-dump": [ "post-autoload-dump": [

2244
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@ class DeferredMediaData extends Data
public static function fromPath(string $path, MediaCollection $collection): self public static function fromPath(string $path, MediaCollection $collection): self
{ {
return static::withoutMagicalCreationFrom([ return self::factory()->withoutMagicalCreation()->from([
'path' => Lazy::create(fn () => $path), 'path' => Lazy::create(fn () => $path),
'collection_name' => $collection->name, 'collection_name' => $collection->name,
]); ]);

View File

@ -47,7 +47,7 @@ class MediaData extends Data
: null, : null,
); );
return self::withoutMagicalCreationFrom([ return self::factory()->withoutMagicalCreation()->from([
...$media->toArray(), ...$media->toArray(),
'conversions' => $conversions->toArray(), 'conversions' => $conversions->toArray(),
]); ]);