40 lines
823 B
PHP
40 lines
823 B
PHP
<?php
|
|
|
|
namespace Modules\Authentication\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class SubscriptionItem extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $hidden = [
|
|
'updated_at',
|
|
'deleted_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'amount' => 'float',
|
|
];
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function package(): HasOne
|
|
{
|
|
return $this->hasOne(Package::class, 'id', 'package_id');
|
|
}
|
|
|
|
public function restaurant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Restaurant::class, 'restaurant_id', 'id');
|
|
}
|
|
}
|