123456789101112131415161718192021222324252627282930 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class Upload extends Model
- {
- protected $guarded = [];
- const STATUS_OK = 1;
- const STATUS_PAUSE = 0;
- public static $statusMaps = [
- self::STATUS_OK => '正常',
- self::STATUS_PAUSE => '暂停'
- ];
- const USE_OK = 1;
- const USE_NO = 0;
- public static $useMaps = [
- self::USE_OK => '已使用',
- self::USE_NO => '未使用'
- ];
- public function getPathAttribute($path)
- {
- return path_to_url($path, $this->attributes['disk']);
- }
- }
|