Your ROOT_URL in app.ini is http://167.99.32.63:3000/ but you are visiting http://167.99.32.63/ibrahim/BAGETWEBPANEL/blame/branch/master/app/Models/Coupon.php You should set ROOT_URL correctly, otherwise the web may not work correctly.

39 lines
856 B

2 years ago
<?php
namespace App\Models;
use App\Scopes\RestaurantScope;
use Illuminate\Database\Eloquent\Model;
class Coupon extends Model
{
protected $casts = [
'min_purchase' => 'float',
'max_discount' => 'float',
'discount' => 'float',
'limit'=>'integer',
'restaurant_id'=>'integer',
// 'customer_id'=>'integer',
'status'=>'integer',
'id'=>'integer',
'total_uses'=>'integer',
];
public function scopeActive($query)
{
return $query->where('status', '=', 1);
}
public function restaurant()
{
return $this->belongsTo(Restaurant::class, 'restaurant_id');
}
// protected static function booted()
// {
// if(auth('vendor')->check())
// {
// static::addGlobalScope(new RestaurantScope);
// }
// }
}