40 lines
729 B
PHP
40 lines
729 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ShareFile extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'share_id',
|
|
'original_name',
|
|
'relative_path',
|
|
'stored_path',
|
|
'file_size',
|
|
'mime_type',
|
|
];
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'file_size' => 'integer',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo<Share, $this>
|
|
*/
|
|
public function share(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Share::class);
|
|
}
|
|
}
|