migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Authentication\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Subscription extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $hidden = [
|
||||
'updated_at',
|
||||
'is_active',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function package(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Package::class);
|
||||
}
|
||||
|
||||
public function subscriptionItems(): HasMany
|
||||
{
|
||||
return $this->hasMany(SubscriptionItem::class);
|
||||
}
|
||||
|
||||
public function restaurant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Restaurant::class, 'restaurant_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user