Skip to content

Commit

Permalink
Add int cast to size column
Browse files Browse the repository at this point in the history
Co-authored-by: Billy Bouman <bbouman@rb-media.nl>

Resolves #180: Prevents type errors when using readableSize()
  • Loading branch information
boumanb committed Jun 3, 2020
1 parent 0635190 commit 7c3e9ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class Media extends Model

protected $table = 'media';
protected $guarded = ['id', 'disk', 'directory', 'filename', 'extension', 'size', 'mime_type', 'aggregate_type'];
protected $casts = [
'size' => 'int',
];

/**
* {@inheritdoc}
Expand Down

0 comments on commit 7c3e9ce

Please sign in to comment.