secure() ? "https" : "http"; return $this->poster ? $protocol . "://" . request()->getHost() . $this->poster : $this->poster; } public function project() { return $this->belongsTo(Project::class); } public function defaultItem() { return $this->hasOne(ProductItems::class)->where("patient_quantity", 1); } public function productItems() { return $this->hasMany(ProductItems::class); } public function productParamedicLevels() { return $this->hasMany(ProductParamedicLevel::class); } public function factors() { return $this->hasMany(Factor::class); } public function lastdayCheckoutRules() { return $this->hasMany(LastdayChekcoutRule::class, "product_id")->orderBy("before_time"); } }