Company.php 705 B

123456789101112131415161718192021222324252627282930313233
  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. class Company extends Model
  8. {
  9. use HasFactory,Filterable;
  10. protected $table = 'company';
  11. protected $fillable = [
  12. 'name',
  13. 'email',
  14. ];
  15. protected $guarded = [
  16. 'id'
  17. ];
  18. protected function storageSize(): Attribute
  19. {
  20. return Attribute::get(
  21. fn() => $this->storage_limit_size > 0
  22. ? $this->storage_limit_size
  23. : config("autocde.company_default_storage_limit_size") * 1024 * 1024
  24. );
  25. }
  26. }