Company.php 826 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Models;
  3. use EloquentFilter\Filterable;
  4. use Illuminate\Database\Eloquent\Casts\Attribute;
  5. use Illuminate\Database\Eloquent\Factories\HasFactory;
  6. use Illuminate\Database\Eloquent\Model;
  7. use Illuminate\Database\Eloquent\SoftDeletes;
  8. class Company extends Model
  9. {
  10. use HasFactory,Filterable,SoftDeletes;
  11. protected $table = 'company';
  12. protected $fillable = [
  13. 'name',
  14. 'email',
  15. 'review_status',
  16. 'exp_date',
  17. 'parent',
  18. ];
  19. protected $guarded = [
  20. 'id'
  21. ];
  22. protected function storageSize(): Attribute
  23. {
  24. return Attribute::get(
  25. fn() => $this->storage_limit_size > 0
  26. ? $this->storage_limit_size
  27. : config("autocde.company_default_storage_limit_size") * 1024 * 1024
  28. );
  29. }
  30. }