Skip to content

Commit

Permalink
add default value for alt
Browse files Browse the repository at this point in the history
  • Loading branch information
frasmage committed Mar 31, 2024
1 parent 1751150 commit 474879a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automated-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run phpunit
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml --verbose
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
env:
S3_KEY: ${{ secrets.S3_KEY }}
S3_SECRET: ${{ secrets.S3_SECRET }}
Expand Down
4 changes: 4 additions & 0 deletions src/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ class Media extends Model
'size' => 'int',
];

protected $attributes = [
'alt' => '',
];

/**
* {@inheritdoc}
*/
Expand Down
1 change: 0 additions & 1 deletion src/MediaUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Contracts\Filesystem\Filesystem;
use Illuminate\Filesystem\FilesystemManager;
use League\Flysystem\UnableToRetrieveMetadata;
use Mimey\MimeTypes;
use Plank\Mediable\Exceptions\MediaUpload\ConfigurationException;
use Plank\Mediable\Exceptions\MediaUpload\FileExistsException;
use Plank\Mediable\Exceptions\MediaUpload\FileNotFoundException;
Expand Down
1 change: 1 addition & 0 deletions tests/Factories/ModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'mime_type' => $faker->randomElement($types[$type]['mime_types']),
'aggregate_type' => $type,
'size' => $faker->randomNumber(),
'alt' => $faker->sentence,
];
});

Expand Down

0 comments on commit 474879a

Please sign in to comment.