Closed Woeler closed 2 years ago
Kudos, SonarCloud Quality Gate passed!
I am not sure if this is being maintained anymore. For those wanting a solution without editing the vendor code, create your own class that extends AdvancedImage and use it in instead. Class looks like this:
<?php
declare(strict_types=1);
namespace App\Nova\Fields;
use Laravel\Nova\Http\Requests\NovaRequest;
class AdvancedImage extends \Ctessier\NovaAdvancedImageField\AdvancedImage
{
protected function fillAttribute(NovaRequest $request, $requestAttribute, $model, $attribute): void
{
$model->{$attribute} = $model->{$attribute} ?? '';
parent::fillAttribute($request, $requestAttribute, $model, $attribute);
}
}
Hi @Woeler !
Thank you very much for your contribution 🎉
The pull request was merged and I just released v1.3.1!
Hope you have a great day! Clément
Thanks! Fantastic.
Applications using Laravel 9 will use FlySystem 3. The delete methods of FlySystem 3 no longer allow null as an argument. The argument must be a string.
See: https://github.com/thephpleague/flysystem/blob/3.x/src/Filesystem.php#L82
This pr simply surrounds the delete call with an if statement, so it isn't called when the given argument is null. This happens when using Laravel 9 while creating a new resource using the AdvancedImage field.