Upload.php 537 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Models;
  3. class Upload extends Model
  4. {
  5. protected $guarded = [];
  6. const STATUS_OK = 1;
  7. const STATUS_PAUSE = 0;
  8. public static $statusMaps = [
  9. self::STATUS_OK => '正常',
  10. self::STATUS_PAUSE => '暂停'
  11. ];
  12. const USE_OK = 1;
  13. const USE_NO = 0;
  14. public static $useMaps = [
  15. self::USE_OK => '已使用',
  16. self::USE_NO => '未使用'
  17. ];
  18. public function getPathAttribute($path)
  19. {
  20. return path_to_url($path, $this->attributes['disk']);
  21. }
  22. }