Upload.php 519 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. use Packages\Product\Models\Product;
  6. class Upload extends Model
  7. {
  8. use SoftDeletes;
  9. // protected $fillable = ['name', 'path', 'mime_type', 'extension', 'uploadable_type', 'uploadable_id'];
  10. protected $guarded = [] ;
  11. public function uploadable()
  12. {
  13. return $this->morphTo();
  14. }
  15. public function draft()
  16. {
  17. return $this->morphOne(Draft::class, 'draftable');
  18. }
  19. }