initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class CatRegistrationDocument extends Model
|
||||
{
|
||||
protected $fillable = ['cat_registration_id', 'label', 'document_type', 'file_path', 'issued_at'];
|
||||
protected function casts(): array { return ['issued_at' => 'date']; }
|
||||
public function registration() { return $this->belongsTo(CatRegistration::class, 'cat_registration_id'); }
|
||||
public function getUrlAttribute(): string { return Storage::disk('public')->url($this->file_path); }
|
||||
}
|
||||
Reference in New Issue
Block a user