You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.3 KiB
55 lines
1.3 KiB
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Scopes\ZoneScope;
|
|
use App\Scopes\RestaurantScope;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class RestaurantSubscription extends Model
|
|
{
|
|
use HasFactory;
|
|
protected $guarded = ['id'];
|
|
|
|
// protected $dates = ['expiry_date'];
|
|
|
|
|
|
|
|
protected $casts = [
|
|
'expiry_date'=> 'datetime',
|
|
'price'=>'float',
|
|
'validity'=>'integer',
|
|
'chat'=>'integer',
|
|
'review'=>'integer',
|
|
'package_id'=>'integer',
|
|
'status'=>'integer',
|
|
'pos'=>'integer',
|
|
'default'=>'integer',
|
|
'mobile_app'=>'integer',
|
|
'total_package_renewed'=>'integer',
|
|
'self_delivery'=>'integer',
|
|
'restaurant_id'=>'integer',
|
|
'max_order'=>'string',
|
|
'max_product'=>'string',
|
|
|
|
];
|
|
public function package()
|
|
{
|
|
return $this->belongsTo(SubscriptionPackage::class,'package_id');
|
|
}
|
|
public function transcations()
|
|
{
|
|
return $this->hasMany(SubscriptionTransaction::class,'restaurant_id');
|
|
}
|
|
public function restaurant()
|
|
{
|
|
return $this->belongsTo(Restaurant::class);
|
|
}
|
|
|
|
protected static function booted()
|
|
{
|
|
static::addGlobalScope(new ZoneScope);
|
|
}
|
|
|
|
}
|
|
|