Using morphTo() on services, added Ezypay payment Import
This commit is contained in:
21
app/Models/Service/Adsl.php
Normal file
21
app/Models/Service/Adsl.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Service;
|
||||
|
||||
class Adsl extends \App\Models\Base\ServiceType
|
||||
{
|
||||
// @todo column service_id can be removed.
|
||||
protected $table = 'ab_service__adsl';
|
||||
|
||||
public function getFullNameAttribute()
|
||||
{
|
||||
return ($this->service_number AND $this->service_address)
|
||||
? sprintf('%s: %s',$this->service_number, $this->service_address)
|
||||
: $this->name;
|
||||
}
|
||||
|
||||
public function getNameAttribute()
|
||||
{
|
||||
return $this->service_number ?: $this->service_address;
|
||||
}
|
||||
}
|
18
app/Models/Service/Domain.php
Normal file
18
app/Models/Service/Domain.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Service;
|
||||
|
||||
class Domain extends \App\Models\Base\ServiceType
|
||||
{
|
||||
protected $table = 'ab_service__domain';
|
||||
|
||||
public function tld()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\DomainTld::class,'domain_tld_id');
|
||||
}
|
||||
|
||||
public function getNameAttribute()
|
||||
{
|
||||
return sprintf('%s.%s',$this->domain_name,$this->tld->name);
|
||||
}
|
||||
}
|
13
app/Models/Service/Host.php
Normal file
13
app/Models/Service/Host.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Service;
|
||||
|
||||
class Host extends \App\Models\Base\ServiceType
|
||||
{
|
||||
protected $table = 'ab_service__hosting';
|
||||
|
||||
public function getNameAttribute()
|
||||
{
|
||||
return sprintf('%s',$this->domain_name);
|
||||
}
|
||||
}
|
37
app/Models/Service/SSL.php
Normal file
37
app/Models/Service/SSL.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Service;
|
||||
|
||||
class SSL extends \App\Models\Base\ServiceType
|
||||
{
|
||||
protected $table = 'ab_service__ssl';
|
||||
protected $_o = NULL;
|
||||
|
||||
public function tld()
|
||||
{
|
||||
return $this->belongsTo(DomainTld::class,'domain_tld_id');
|
||||
}
|
||||
|
||||
public function getSSLAttribute()
|
||||
{
|
||||
if (is_null($this->_o))
|
||||
{
|
||||
$this->_o = new \App\Classes\SSL;
|
||||
|
||||
if ($this->cert)
|
||||
$this->_o->crt($this->cert);
|
||||
if ($this->csr)
|
||||
$this->_o->csr($this->csr);
|
||||
if ($this->pk)
|
||||
$this->_o->key($this->pk);
|
||||
|
||||
}
|
||||
|
||||
return $this->_o;
|
||||
}
|
||||
|
||||
public function getNameAttribute()
|
||||
{
|
||||
return $this->ssl->cn;
|
||||
}
|
||||
}
|
20
app/Models/Service/Voip.php
Normal file
20
app/Models/Service/Voip.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Service;
|
||||
|
||||
class Voip extends \App\Models\Base\ServiceType
|
||||
{
|
||||
protected $table = 'ab_service__voip';
|
||||
|
||||
public function getFullNameAttribute()
|
||||
{
|
||||
return ($this->service_number AND $this->service_address)
|
||||
? sprintf('%s: %s',$this->service_number, $this->service_address)
|
||||
: $this->name;
|
||||
}
|
||||
|
||||
public function getNameAttribute()
|
||||
{
|
||||
return $this->service_number;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user