completed clients and MNO module
This commit is contained in:
35
app/Models/NetworkOperator.php
Executable file
35
app/Models/NetworkOperator.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
|
||||
class NetworkOperator extends Model
|
||||
{
|
||||
protected $guarded = array('id');
|
||||
public $table = "network_operators";
|
||||
|
||||
protected $casts = [
|
||||
'services' => 'array',
|
||||
'support_emails' => 'array',
|
||||
'finance_emails' => 'array',
|
||||
'bind_specifics' => 'array',
|
||||
];
|
||||
public function account_manager_info(){
|
||||
return $this->hasOne('App\Models\StaffMember', 'id', 'account_manager_id');
|
||||
}
|
||||
/*
|
||||
public function setBuyingRateAttribute($value)
|
||||
{
|
||||
$cleanValue = filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
|
||||
$this->attributes['buying_rate'] = $cleanValue;
|
||||
}
|
||||
*/
|
||||
protected function buyingRate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
set: fn (string $value) => filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user