Skip to content

Commit

Permalink
fix alt migration for mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
frasmage committed Apr 9, 2024
1 parent 07d65c0 commit 9cfecc7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion migrations/2024_03_30_000000_add_alt_to_media.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function up()
Schema::table(
'media',
function (Blueprint $table) {
$table->text('alt')->default('');
$table->text('alt');
}
);
}
Expand Down
6 changes: 5 additions & 1 deletion src/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @property string|null $variant_name
* @property int|string|null $original_media_id
* @property int|null $size
* @property string|null $alt
* @property string $alt
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Pivot $pivot
Expand Down Expand Up @@ -85,6 +85,10 @@ class Media extends Model
'size' => 'int',
];

protected $attributes = [
'alt' => ''

This comment has been minimized.

Copy link
@siarheipashkevich

siarheipashkevich Apr 9, 2024

will be better to add a trailing comma

];

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 9cfecc7

Please sign in to comment.