mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
check system using file disk type
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user