check system using file disk type

This commit is contained in:
raishvaria
2020-12-08 15:07:57 +05:30
parent f18eac2001
commit 419104a4ec
4 changed files with 19 additions and 6 deletions

View File

@ -8,6 +8,9 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
class FileDisk extends Model
{
CONST DISK_TYPE_SYSTEM = 'SYSTEM';
CONST DISK_TYPE_REMOTE = 'REMOTE';
use HasFactory;
protected $guarded = [
@ -184,4 +187,14 @@ class FileDisk extends Model
return $this;
}
public function isSystem()
{
return $this->type === self::DISK_TYPE_SYSTEM;
}
public function isRemote()
{
return $this->type === self::DISK_TYPE_REMOTE;
}
}