36 lines
817 B
PHP
36 lines
817 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class HotspotVoucher extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
protected $hidden = ['password'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'password' => 'encrypted', 'profile_snapshot' => 'array', 'valid_until' => 'datetime',
|
|
'activated_at' => 'datetime', 'used_at' => 'datetime', 'synced_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function sale()
|
|
{
|
|
return $this->belongsTo(VoucherSale::class, 'voucher_sale_id');
|
|
}
|
|
|
|
public function packageProfile()
|
|
{
|
|
return $this->belongsTo(NasPackageProfile::class, 'nas_package_profile_id');
|
|
}
|
|
|
|
public function mikrotik()
|
|
{
|
|
return $this->belongsTo(NasMikrotik::class, 'nas_mikrotik_id');
|
|
}
|
|
}
|