Upload.php 578 B

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