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/commit/5502e10312f1346e86a7121a4cdd08e66c54c696/app/Models/Discount.php You should set ROOT_URL correctly, otherwise the web may not work correctly.

33 lines
911 B

2 years ago
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Discount extends Model
{
use HasFactory;
protected $fillable = [
'start_date','end_date','start_time','end_time','min_purchase','max_discount','discount','discount_type','restaurant_id',
];
protected $casts = [
'min_purchase' => 'float',
'max_discount' => 'float',
'discount' => 'float',
'restaurant_id'=>'integer'
];
protected $dates = ['created_at', 'updated_at'];
public function restaurant()
{
return $this->belongsTo(Restaurant::class);
}
public function scopeValidate($query)
{
$query->whereDate('start_date','<=',date('Y-m-d'))->whereDate('end_date','>=',date('Y-m-d'))->whereTime('start_time','<=',date('H:i:s'))->whereTime('end_time','>=',date('H:i:s'));
}
}