????PK! ## Attribute.phpnu[ 'integer', 'name' => 'string' ]; public function translations(): MorphMany { return $this->morphMany('App\Models\Translation', 'translationable'); } protected static function boot(): void { parent::boot(); static::addGlobalScope('translate', function (Builder $builder) { $builder->with(['translations' => function ($query) { if (strpos(url()->current(), '/api')) { return $query->where('locale', App::getLocale()); } else { return $query->where('locale', getDefaultLanguage()); } }]); }); } } PK!'lzShopFollower.phpnu[ 'integer', 'user_id' => 'integer', ]; } PK!^<OrderDeliveryVerification.phpnu[ 'integer', 'order_id' => 'integer', 'image' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'order_id', 'image', ]; } PK!IyDeliverymanWallet.phpnu[ 'integer', 'delivery_man_id' => 'integer', 'current_balance' => 'float', 'cash_in_hand' => 'float', 'pending_withdraw' => 'float', 'total_withdraw' => 'float', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'delivery_man_id', 'current_balance', 'cash_in_hand', 'pending_withdraw', 'total_withdraw', ]; protected $guarded = []; /*delivery_man ->deliveryMan*/ public function deliveryMan():BelongsTo { return $this->belongsTo(DeliveryMan::class, 'delivery_man_id'); } } PK!Ot Customer.phpnu[ 'integer', 'user_id' => 'integer', 'credit' => 'float', 'debit' => 'float', 'balance'=>'float', 'reference'=>'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function user(): BelongsTo { return $this->belongsTo(User::class); } } PK!F~Shop.phpnu[ 'integer', 'vacation_status' => 'boolean', 'temporary_close' => 'boolean', ]; public function seller():BelongsTo { return $this->belongsTo(Seller::class, 'seller_id'); } // old relation: product public function products():HasMany { return $this->hasMany(Product::class, 'user_id', 'seller_id')->where(['added_by'=>'seller', 'status'=>1, 'request_status'=>1]); } public function scopeActive($query) { return $query->whereHas('seller', function ($query) { $query->where(['status' => 'approved']); }); } } PK!6BH&&CategoryShippingCost.phpnu[ 'integer', 'seller_id' => 'integer', 'category_id' => 'integer', 'cost' => 'float', 'multiply_qty' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'seller_id', 'category_id', 'cost', 'multiply_qty', ]; public function category():BelongsTo { return $this->belongsTo(Category::class, 'category_id'); } } PK!f OrderDetail.phpnu[ 'integer', 'order_id' => 'integer', 'price' => 'float', 'discount' => 'float', 'qty' => 'integer', 'tax' => 'float', 'shipping_method_id' => 'integer', 'digital_file_after_sell' => 'string', 'seller_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'refund_request'=>'integer', ]; public function product(): BelongsTo { return $this->belongsTo(Product::class)->where('status', 1); } //active_product public function activeProduct(): BelongsTo { return $this->belongsTo(Product::class)->where('status', 1); } //product_all_status public function productAllStatus(): BelongsTo { return $this->belongsTo(Product::class, 'product_id'); } public function order(): BelongsTo { return $this->belongsTo(Order::class, 'order_id'); } public function seller(): BelongsTo { return $this->belongsTo(Seller::class, 'seller_id'); } public function address(): BelongsTo { return $this->belongsTo(ShippingAddress::class, 'shipping_address'); } //verification_images public function verificationImages(): HasMany { return $this->hasMany(OrderDeliveryVerification::class,'order_id','order_id'); } public function orderStatusHistory(): HasMany { return $this->hasMany(OrderStatusHistory::class,'order_id','order_id'); } } PK!VendorRegistrationReason.phpnu[ 'integer', 'title' => 'string', 'description' => 'string', 'priority' => 'integer', 'status' => 'integer', ]; } PK!  Currency.phpnu[ 'integer', 'status' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'name', 'symbol', 'code', 'exchange_rate', 'status', ]; protected $table = 'currencies'; protected static function boot(): void { parent::boot(); // static::addGlobalScope(new RememberScope); } } PK!˽Scopes/RememberScope.phpnu[remember(now()->addDay()); $builder->cacheFor(now()->addDays(1)); } } PK!yDealOfTheDay.phpnu[ 'integer', 'product_id' => 'integer', 'discount' => 'float', 'status' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'title', 'product_id', 'discount', 'discount_type', 'status', ]; public function product(): BelongsTo { return $this->belongsTo(Product::class); } public function translations(): MorphMany { return $this->morphMany(Translation::class, 'translationable'); } public function getTitleAttribute($title): string|null { if (strpos(url()->current(), '/admin') || strpos(url()->current(), '/vendor') || strpos(url()->current(), '/seller')) { return $title; } return $this->translations[0]->value??$title; } protected static function boot(): void { parent::boot(); static::addGlobalScope('translate', function (Builder $builder) { $builder->with(['translations' => function ($query) { if (strpos(url()->current(), '/api')){ return $query->where('locale', App::getLocale()); }else{ return $query->where('locale', Helpers::default_lang()); } }]); }); } } PK! .QNotificationSeen.phpnu[ 'integer', 'delivery_man_id' => 'integer', 'user_id' => 'integer', 'debit' => 'float', 'credit' => 'float', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'delivery_man_id', 'user_id', 'user_type', 'transaction_id', 'debit', 'credit', 'transaction_type', ]; } PK!^|NotificationMessage.phpnu[ 'string', 'key' => 'string', 'message' => 'string', 'status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function translations(): MorphMany { return $this->morphMany('App\Models\Translation', 'translationable'); } } PK!.zzSellerWalletHistory.phpnu[ 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected static function boot(): void { parent::boot(); // static::addGlobalScope(new RememberScope); } } PK!^XXDeliveryZipCode.phpnu[ 'integer', 'zipcode' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'zipcode', ]; } PK!//tt Contact.phpnu[ 'integer', 'seen' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'name', 'email', 'mobile_number', 'subject', 'message', 'seen', 'feedback', 'reply', ]; protected $table = 'contacts'; } PK!҇22AdminWalletHistory.phpnu[ 'integer', 'admin_id' => 'integer', 'amount' => 'float', 'order_id' => 'integer', 'product_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'admin_id', 'amount', 'order_id', 'product_id', 'payment', ]; } PK! OrderTransaction.phpnu[ 'float:2', 'seller_amount' => 'float:2', 'admin_commission' => 'float:2', 'delivery_charge' => 'float:2', 'tax' => 'float:2', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function seller(): BelongsTo { return $this->belongsTo(Seller::class, 'seller_id'); } public function customer(): BelongsTo { return $this->belongsTo(User::class, 'customer_id'); } public function order(): BelongsTo { return $this->belongsTo(Order::class, 'order_id'); } public function orderDetails(): HasMany { return $this->hasMany(OrderDetail::class, 'order_id', 'order_id'); } } PK!b\ \ Chatting.phpnu[ 'integer', 'user_id' => 'integer', 'seller_id' => 'integer', 'admin_id' => 'integer', 'message' => 'string', 'delivery_man_id' => 'integer', 'sent_by_customer' => 'boolean', 'sent_by_seller' => 'boolean', 'sent_by_admin' => 'boolean', 'sent_by_delivery_man' => 'boolean', 'seen_by_customer' => 'boolean', 'seen_by_seller' => 'boolean', 'seen_by_admin' => 'boolean', 'seen_by_delivery_man' => 'boolean', 'status' => 'boolean', 'notification_receiver' => 'string', 'seen_notification' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'shop_id' => 'integer', ]; protected $fillable = [ 'user_id', 'seller_id', 'admin_id', 'delivery_man_id', 'message', 'attachment', 'sent_by_customer', 'sent_by_seller', 'sent_by_admin', 'sent_by_delivery_man', 'seen_by_customer', 'seen_by_seller', 'seen_by_admin', 'seen_by_delivery_man', 'status', 'notification_receiver', 'seen_notification', 'shop_id', ]; protected $guarded=[]; /* seller_info -> sellerInfo*/ public function sellerInfo():BelongsTo { return $this->belongsTo(Seller::class, 'seller_id'); } public function customer():BelongsTo { return $this->belongsTo(User::class, 'user_id'); } public function shop():BelongsTo { return $this->belongsTo(Shop::class, 'shop_id'); } /* delivery_man -> deliveryMan*/ public function deliveryMan():BelongsTo { return $this->belongsTo(DeliveryMan::class, 'delivery_man_id'); } public function admin():BelongsTo { return $this->belongsTo(Admin::class, 'admin_id'); } } PK!,vvDeliveryHistory.phpnu[ 'integer', 'shipping_method_id' => 'integer', 'shipping_cost' => 'float', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'cart_group_id', 'shipping_method_id', 'shipping_cost', ]; public function cart(): BelongsTo { return $this->belongsTo(Cart::class,'cart_group_id','cart_group_id'); } } PK!\ Seller.phpnu[ 'integer', 'f_name' => 'string', 'l_name' => 'string', 'country_code' => 'string', 'orders_count' => 'integer', 'product_count' => 'integer', 'pos_status' => 'integer' ]; public function scopeApproved($query) { return $query->where(['status'=>'approved']); } public function shop():HasOne { return $this->hasOne(Shop::class, 'seller_id'); } public function shops():HasMany { return $this->hasMany(Shop::class, 'seller_id'); } public function orders():HasMany { return $this->hasMany(Order::class, 'seller_id'); } public function product():HasMany { return $this->hasMany(Product::class, 'user_id')->where(['added_by'=>'seller']); } public function wallet():HasOne { return $this->hasOne(SellerWallet::class); } public function coupon():HasMany { return $this->hasMany(Coupon::class, 'seller_id') ->where(['coupon_bearer'=>'seller', 'status'=>1]) ->whereDate('start_date','<=',date('Y-m-d')) ->whereDate('expire_date','>=',date('Y-m-d')); } } PK!ProductCompare.phpnu[ 'integer', 'user_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function product(): BelongsTo { return $this->belongsTo(Product::class, 'product_id')->active(); } } PK!OySubscription.phpnu[ 'string', ]; } PK!iCustomerWallet.phpnu[ 'integer', 'customer_id' => 'integer', 'balance' => 'float', 'royalty_points' => 'float', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'customer_id', 'balance', 'royalty_points', ]; } PK!rrFeatureDeal.phpnu[ 'integer', 'shipping_type' => 'string', ]; } PK!KCyyAdminWallet.phpnu[ 'integer', 'admin_id' => 'integer', 'inhouse_earning' => 'float', 'withdrawn' => 'float', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'commission_earned' => 'float', 'delivery_charge_earned' => 'float', 'pending_amount' => 'float', 'total_tax_collected' => 'float', ]; protected $fillable = [ 'admin_id', 'inhouse_earning', 'withdrawn', 'commission_earned', 'delivery_charge_earned', 'pending_amount', 'total_tax_collected', ]; } PK!oQQTranslation.phpnu[ 'integer', 'translationable_type' => 'string', 'locale' => 'string', 'key' => 'string', 'value' => 'string', 'id' => 'integer', ]; public function translationable(): MorphTo { return $this->morphTo(); } protected static function boot(): void { parent::boot(); // static::addGlobalScope(new RememberScope); } } PK!SUser.phpnu[ 'integer', 'name' => 'string', 'f_name' => 'string', 'l_name' => 'string', 'phone' => 'string', 'image' => 'string', 'email' => 'string', 'email_verified_at' => 'datetime', 'password' => 'string', 'remember_token' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'street_address' => 'string', 'country' => 'string', 'city' => 'string', 'zip' => 'string', 'house_no' => 'string', 'apartment_no' => 'string', 'cm_firebase_token' => 'string', 'is_active' => 'boolean', 'payment_card_last_four' => 'string', 'payment_card_brand' => 'string', 'payment_card_fawry_token' => 'string', 'login_medium' => 'string', 'social_id' => 'string', 'is_phone_verified' => 'boolean', 'temporary_token' => 'string', 'is_email_verified' => 'boolean', 'wallet_balance' => 'float', 'loyalty_point' => 'float', 'login_hit_count' => 'integer', 'is_temp_blocked' => 'boolean', 'temp_block_time' => 'datetime', 'referral_code' => 'string', 'referred_by' => 'integer', ]; // Old Relation: wish_list public function wishList(): hasMany { return $this->hasMany(Wishlist::class, 'customer_id'); } public function orders(): hasMany { return $this->hasMany(Order::class, 'customer_id'); } public function customer(): BelongsTo { return $this->belongsTo(User::class, 'customer_id'); } public function shipping(): BelongsTo { return $this->belongsTo(ShippingAddress::class, 'shipping_address'); } public function addresses(): HasMany { return $this->hasMany(ShippingAddress::class, 'customer_id'); } public function refundOrders(): HasMany { return $this->hasMany(RefundRequest::class, 'customer_id')->where('status','refunded'); } // Old Relation: compare_list public function compareList(): hasMany { return $this->hasMany(ProductCompare::class, 'user_id'); } } PK!o#q q FlashDeal.phpnu[ 'boolean', 'featured' => 'boolean', 'start_date' => 'date', 'end_date' => 'date', ]; public function products(): HasMany { return $this->hasMany(FlashDealProduct::class, 'flash_deal_id'); } public function translations(): MorphMany { return $this->morphMany(Translation::class, 'translationable'); } public function getTitleAttribute($title): string|null { if (strpos(url()->current(), '/admin') || strpos(url()->current(), '/vendor') || strpos(url()->current(), '/seller')) { return $title; } return $this->translations[0]->value??$title; } protected static function boot(): void { parent::boot(); static::addGlobalScope('translate', function (Builder $builder) { $builder->with(['translations' => function ($query) { if (strpos(url()->current(), '/api')){ return $query->where('locale', App::getLocale()); }else{ return $query->where('locale', getDefaultLanguage()); } }]); }); } } PK!SearchFunction.phpnu[ 'integer', 'added_by' => 'string', 'name' => 'string', 'code' => 'string', 'slug' => 'string', 'category_id' => 'integer', 'sub_category_id' => 'integer', 'sub_sub_category_id' => 'integer', 'brand_id' => 'integer', 'unit' => 'string', 'digital_product_type' => 'string', 'product_type' => 'string', 'details' => 'string', 'min_qty' => 'integer', 'published' => 'integer', 'tax' => 'float', 'tax_type' => 'string', 'tax_model' => 'string', 'unit_price' => 'float', 'status' => 'integer', 'discount' => 'float', 'current_stock' => 'integer', 'minimum_order_qty' => 'integer', 'free_shipping' => 'integer', 'request_status' => 'integer', 'featured_status' => 'integer', 'refundable' => 'integer', 'featured' => 'integer', 'flash_deal' => 'integer', 'seller_id' => 'integer', 'purchase_price' => 'float', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'shipping_cost' => 'float', 'multiply_qty' => 'integer', 'temp_shipping_cost' => 'float', 'thumbnail' => 'string', 'digital_file_ready' => 'string', 'meta_title' => 'string', 'meta_description' => 'string', 'meta_image' => 'string', 'is_shipping_cost_updated' => 'integer' ]; protected $appends = ['is_shop_temporary_close']; public function translations(): MorphMany { return $this->morphMany('App\Models\Translation', 'translationable'); } public function scopeActive($query) { $brandSetting = getWebConfig(name: 'product_brand'); $digitalProductSetting = getWebConfig(name: 'digital_product'); $businessMode = getWebConfig(name: 'business_mode'); if (!$digitalProductSetting) { $productType = ['physical']; } else { $productType = ['digital', 'physical']; } return $query->when($businessMode=='single', function ($query) { $query->where(['added_by'=>'admin']); })->when($brandSetting, function ($query) { $query->whereHas('brand', function ($query) { $query->where(['status' => 1]); }); })->when(!$brandSetting, function ($query) { $query->whereNull('brand_id')->where('status', 1); }) ->where(['status' => 1]) ->where(['request_status' => 1]) ->SellerApproved() ->whereIn('product_type', $productType); } public function scopeSellerApproved($query): void { $query->whereHas('seller', function ($query) { $query->where(['status' => 'approved']); })->orWhere(function ($query) { $query->where(['added_by' => 'admin', 'status' => 1]); }); } public function stocks(): HasMany { return $this->hasMany(ProductStock::class); } public function reviews(): HasMany { return $this->hasMany(Review::class, 'product_id'); } //old relation: reviews_by_customer public function reviewsByCustomer(): HasMany { return $this->hasMany(Review::class, 'product_id')->where('customer_id', auth('customer')->id())->whereNotNull('product_id')->whereNull('delivery_man_id'); } public function brand(): BelongsTo { return $this->belongsTo(Brand::class); } public function scopeStatus($query): Builder { return $query->where('featured_status', 1); } public function shop(): BelongsTo { return $this->belongsTo(Shop::class, 'seller_id'); } public function seller(): BelongsTo { return $this->belongsTo(Seller::class, 'user_id'); } public function getIsShopTemporaryCloseAttribute($value): int { $inhouseTemporaryClose = Cache::get('inhouseShopInTemporaryClose') ?? 0; if ($this->added_by == 'admin') { return $inhouseTemporaryClose ?? 0; } elseif ($this->added_by == 'seller') { return Cache::remember('product-shop-close-'.$this->id, 3600, function () { return $this?->seller?->shop?->temporary_close ?? 0; }); } return 0; } public function category(): BelongsTo { return $this->belongsTo(Category::class, 'category_id'); } //old relation: sub_category public function subCategory(): BelongsTo { return $this->belongsTo(Category::class, 'sub_category_id'); } //old relation: sub_sub_category public function subSubCategory(): BelongsTo { return $this->belongsTo(Category::class, 'sub_sub_category_id'); } public function rating(): HasMany { return $this->hasMany(Review::class) ->select(DB::raw('avg(rating) average, product_id')) ->whereNull('delivery_man_id') ->groupBy('product_id'); } //old relation: order_details public function orderDetails(): HasMany { return $this->hasMany(OrderDetail::class, 'product_id'); } //old relation: order_delivered public function orderDelivered(): HasMany { return $this->hasMany(OrderDetail::class, 'product_id') ->where('delivery_status', 'delivered'); } //old relation: wish_list public function wishList(): HasMany { return $this->hasMany(Wishlist::class, 'product_id'); } public function tags(): BelongsToMany { return $this->belongsToMany(Tag::class); } //old relation: flash_deal_product public function flashDealProducts(): HasMany { return $this->hasMany(FlashDealProduct::class); } public function scopeFlashDeal($query, $flashDealID) { return $query->whereHas('flashDealProducts.flashDeal', function ($query) use ($flashDealID) { return $query->where('id', $flashDealID); }); } //old relation: compare_list public function compareList(): HasMany { return $this->hasMany(ProductCompare::class); } public function getNameAttribute($name): string|null { if (strpos(url()->current(), '/admin') || strpos(url()->current(), '/vendor') || strpos(url()->current(), '/seller')) { return $name; } return $this->translations[0]->value ?? $name; } public function getDetailsAttribute($detail): string|null { if (strpos(url()->current(), '/admin') || strpos(url()->current(), '/vendor') || strpos(url()->current(), '/seller')) { return $detail; } return $this->translations[1]->value ?? $detail; } protected static function boot(): void { parent::boot(); static::addGlobalScope('translate', function (Builder $builder) { $builder->with(['translations' => function ($query) { if (strpos(url()->current(), '/api')) { return $query->where('locale', App::getLocale()); } else { return $query->where('locale', getDefaultLanguage()); } }, 'reviews' => function ($query) { $query->whereNull('delivery_man_id'); }]); }); } } PK!k*i77 HelpTopic.phpnu[ 'string', 'ranking' => 'integer', 'status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'type', 'question', 'answer', 'status', 'ranking', ]; public function scopeStatus($query) { return $query->where('status', 1); } } PK!olaEmergencyContact.phpnu[ 'integer', 'user_id' => 'integer', 'status' => 'boolean', 'country_code' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'user_id', 'name', 'country_code', 'phone', 'status', 'created_at', 'updated_at', ]; } PK!-b EmailTemplate.phpnu[ 'string', 'user_type' => 'string', 'template_design_name' => 'string', 'title' => 'string', 'body' => 'string', 'banner_image' => 'string', 'image' => 'string', 'logo' => 'string', 'button_name' => 'string', 'button_url' => 'string', 'footer_text' => 'string', 'copyright_text' => 'string', 'pages' => 'array', 'social_media' => 'array', 'hide_field' => 'array', 'status' => 'integer', 'button_content_status' => 'integer', 'product_information_status' => 'integer', 'order_information_status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function translations(): MorphMany { return $this->morphMany('App\Models\Translation', 'translationable'); } public function translationCurrentLanguage(): MorphMany { return $this->morphMany('App\Models\Translation', 'translationable')->where('locale', getDefaultLanguage()); } } PK!j((SupportTicket.phpnu[ 'integer', 'customer_id' => 'integer', 'priority' => 'string', 'status' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function conversations(): HasMany { return $this->hasMany(SupportTicketConv::class); } public function customer(): BelongsTo { return $this->belongsTo(User::class, 'customer_id'); } } PK!T?znn Wishlist.phpnu[ 'integer', 'product_id' => 'integer', ]; public function wishlistProduct() { return $this->belongsTo(Product::class, 'product_id')->active(); } public function product(): BelongsTo { return $this->belongsTo(Product::class, 'product_id')->select(['id','slug']); } public function productFullInfo(): BelongsTo { return $this->belongsTo(Product::class, 'product_id'); } } PK!ȅFlashDealProduct.phpnu[ 'decimal:2', ]; public function product(): BelongsTo { return $this->belongsTo(Product::class); } public function flashDeal(): BelongsTo { return $this->belongsTo(FlashDeal::class)->where(['deal_type'=>'flash_deal','status'=>1]); } public function featureDeal(): BelongsTo { return $this->belongsTo(FlashDeal::class, 'flash_deal_id', 'id')->where(['deal_type'=>'feature_deal','status'=>1]); } } PK!a,0hhDeliveryCountryCode.phpnu[ 'integer', 'country_code' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; } PK!B H[[CustomerWalletHistory.phpnu[ 'integer', 'customer_id' => 'integer', 'transaction_amount' => 'float', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'customer_id', 'transaction_amount', 'transaction_type', 'transaction_method', 'transaction_id', ]; } PK!̜!! Brand.phpnu[ 'string', 'image' => 'string', 'status' => 'integer', 'brand_products_count' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function scopeActive(): mixed { return $this->where('status',1); } public function brandProducts(): HasMany { return $this->hasMany(Product::class)->active(); } public function brandAllProducts(): HasMany { return $this->hasMany(Product::class); } public function translations(): MorphMany { return $this->morphMany('App\Models\Translation', 'translationable'); } public function getNameAttribute($name): string|null { if (strpos(url()->current(), '/admin') || strpos(url()->current(), '/vendor') || strpos(url()->current(), '/seller')) { return $name; } return $this->translations[0]->value??$name; } public function getDefaultNameAttribute(): string|null { return $this->translations[0]->value ?? $this->name; } protected static function boot(): void { parent::boot(); static::addGlobalScope('translate', function (Builder $builder) { $builder->with(['translations' => function ($query) { if (strpos(url()->current(), '/api')){ return $query->where('locale', App::getLocale()); }else{ return $query->where('locale', getDefaultLanguage()); } }]); }); } } PK!cQQOfflinePaymentMethod.phpnu[ 'array', 'method_informations' => 'array', ]; } PK!Z AdminRole.phpnu[ 'integer', 'name' => 'string', 'module_access' => 'string', 'status' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'name', 'module_access', 'status', ]; } PK!+eeShippingAddress.phpnu[ 'boolean', 'is_billing' => 'boolean', ]; } PK!mbuuSellerWallet.phpnu[ 'float', 'withdrawn' => 'float', 'commission_given' => 'float', 'pending_withdraw' => 'float', 'delivery_charge_earned' => 'float', 'collected_cash' => 'float', 'total_tax_collected' => 'float', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function seller(): BelongsTo { return $this->belongsTo(Seller::class); } } PK!NOfflinePayments.phpnu[ 'json', ]; } PK!VTransaction.phpnu[ 'integer', 'order_id' => 'integer', 'payer_id' => 'integer', 'payment_receiver_id' => 'integer', 'amount' => 'float', 'order_details_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function order(): BelongsTo { return $this->belongsTo(Order::class); } } PK!j99ShippingMethod.phpnu[ 'boolean', 'cost' => 'float:2', ]; public function seller():BelongsTo { return $this->belongsTo(Seller::class,'creator_id'); } } PK!=nProductTag.phpnu[ 'integer', 'status' => 'integer', 'is_saved' => 'boolean', ]; public function scopeActive($query): mixed { return $query->where('status', 1); } public function user():HasOne { return $this->hasOne('App\User', 'id', 'customer_id'); } public function product():BelongsTo { return $this->belongsTo(Product::class, 'product_id'); } public function customer():BelongsTo { return $this->belongsTo(User::class, 'customer_id'); } public function deliveryMan():BelongsTo { return $this->belongsTo(DeliveryMan::class, 'delivery_man_id'); } public function order():BelongsTo { return $this->belongsTo(Order::class, 'order_id'); } protected static function boot() { parent::boot(); static::addGlobalScope('active', function (Builder $builder) { if (str_contains(url()->current(), url('/') . '/admin') || str_contains(url()->current(), url('/') . '/seller') || str_contains(url()->current(), url('/') . '/vendor') || str_contains(url()->current(), url('/') . '/api/v2') || str_contains(url()->current(), url('/') . '/api/v3')) { return $builder; } else { return $builder->where('status', 1); } }); } } PK!y4RefundTransaction.phpnu[ 'integer', 'payment_for' => 'string', 'payer_id' => 'integer', 'payment_receiver_id' => 'integer', 'paid_by' => 'string', 'paid_to' => 'string', 'payment_method' => 'string', 'payment_status' => 'string', 'order_details_id' => 'integer', 'amount' => 'float', 'transaction_type' => 'string', 'refund_id' => 'string' ]; public function orderDetails(): BelongsTo { return $this->belongsTo(OrderDetail::class); } public function order(): BelongsTo { return $this->belongsTo(Order::class); } } PK!ehhDeliverymanNotification.phpnu[ 'integer', 'delivery_man_id' => 'integer', 'order_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'delivery_man_id', 'order_id', 'description', ]; public function order() { return $this->belongsTo(Order::class,'order_id'); } } PK!lWalletTransaction.phpnu[ 'integer', 'credit' => 'float', 'debit' => 'float', 'admin_bonus'=>'float', 'balance'=>'float', 'reference'=>'string', 'created_at'=>'string' ]; public function user() { return $this->belongsTo(User::class); } } PK!   Setting.phpnu[ 'array', 'test_values' => 'array', 'is_active' => 'integer', ]; protected $fillable = ['key_name', 'live_values', 'test_values', 'settings_type', 'mode', 'is_active', 'additional_data']; } PK! SSBillingAddress.phpnu[ 'integer', 'customer_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'customer_id', 'contact_person_name', 'address_type', 'address', 'city', 'zip', 'phone', 'state', 'country', 'latitude', 'longitude', ]; } PK!( OrderExpectedDeliveryHistory.phpnu[ 'integer', 'user_id' => 'integer', 'user_type' => 'string', 'expected_delivery_date' => 'date', 'cause' => 'string', ]; } PK!fII!DigitalProductOtpVerification.phpnu[ 'integer', 'otp_hit_count' => 'integer', 'is_temp_blocked' => 'boolean', 'temp_block_time' => 'datetime', 'expires_at' => 'datetime', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'order_details_id', 'identity', 'token', 'otp_hit_count', 'is_temp_blocked', 'temp_block_time', 'expires_at', ]; } PK!b Cart.phpnu[ 'integer', 'customer_id' => 'integer', 'product_id' => 'integer', // 'choices' => 'array', // 'variations' => 'array', // 'variant' => 'array', 'quantity' => 'integer', 'price' => 'float', 'tax' => 'float', 'discount' => 'float', 'seller_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'shipping_cost' => 'float', 'is_guest' => 'integer', ]; protected $fillable = [ 'customer_id', 'cart_group_id', 'product_id', 'product_type', 'digital_product_type', 'color', 'choices', 'variations', 'variant', 'quantity', 'price', 'tax', 'discount', 'tax_model', 'is_checked', 'slug', 'name', 'thumbnail', 'seller_id', 'seller_is', 'shop_info', 'shipping_cost', 'shipping_type', 'is_guest', ]; public function cartShipping(): HasOne { return $this->hasOne(CartShipping::class,'cart_group_id','cart_group_id'); } public function product(): BelongsTo { return $this->belongsTo(Product::class)->where('status', 1); } public function seller(): BelongsTo { return $this->belongsTo(Seller::class, 'seller_id'); } public function shop(): BelongsTo { return $this->belongsTo(Shop::class, 'seller_id', 'seller_id'); } public function allProducts(): BelongsTo { return $this->belongsTo(Product::class, 'product_id'); } } PK!|2ANotification.phpnu[ 'string', 'sent_to' => 'string', 'title' => 'string', 'description' => 'string', 'notification_count' => 'integer', 'image' => 'string', 'status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function scopeActive($query):mixed { return $query->where('status', 1); } /* notification_seen_by -> notificationSeenBy */ public function notificationSeenBy():HasOne { return $this->hasOne(NotificationSeen::class, 'notification_id'); } } PK!> GuestUser.phpnu[ 'integer', 'name' => 'string', 'code' => 'string', ]; } PK!օ>RefundStatus.phpnu[ 'integer', 'change_by' => 'string', 'change_by_id' => 'string', 'status' => 'string', 'message' => 'string', ]; } PK! DeliveryMan.phpnu[ 'integer', 'seller_id'=>'integer', 'f_name'=>'string', 'l_name'=>'string', 'address'=>'string', 'email'=>'string', 'country_code'=>'string', 'phone'=>'string', 'image'=>'string', 'identity_number'=>'string', 'identity_type'=>'string', 'identity_image'=>'string', 'is_active'=>'integer', 'is_online'=>'integer', 'password'=>'string', 'auth_token'=>'string', 'fcm_token'=>'string', 'app_language'=>'string', ]; public function orders():HasMany { return $this->hasMany(Order::class,'delivery_man_id'); } public function deliveredOrders():HasMany { return $this->hasMany(Order::class,'delivery_man_id')->where('order_status','delivered'); } public function wallet():HasOne { return $this->hasOne(DeliverymanWallet::class); } public function transactions():HasMany { return $this->hasMany(DeliveryManTransaction::class); } public function chats():HasMany { return $this->hasMany(Chatting::class); } public function review():HasMany { return $this->hasMany(Review::class, 'delivery_man_id'); } public function rating():HasMany { return $this->hasMany(Review::class) ->select(DB::raw('avg(rating) average, delivery_man_id')) ->groupBy('delivery_man_id'); } } PK!!VAddFundBonusCategories.phpnu[ 'integer', 'title' => 'string', 'description' => 'string', 'bonus_type' => 'string', 'bonus_amount' => 'float', 'min_add_money_amount' => 'float', 'max_bonus_amount' => 'float', 'start_date_time' => 'datetime', 'end_date_time' => 'datetime', 'is_active' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'title', 'description', 'bonus_type', 'bonus_amount', 'min_add_money_amount', 'max_bonus_amount', 'start_date_time', 'end_date_time', 'is_active', ]; public function scopeActive($query) { return $query->where(['is_active' => 1]); } } PK!>[CssProductStock.phpnu[ 'integer', 'name' => 'string', 'phone' => 'string', 'admin_role_id' => 'integer', 'image' => 'string', 'identify_image' => 'string', 'identify_type' => 'string', 'identify_number' => 'integer', 'email' => 'string', 'email_verified_at' => 'datetime', 'password' => 'string', 'remember_token' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'status' => 'boolean', ]; public function role(): BelongsTo { return $this->belongsTo(AdminRole::class,'admin_role_id'); } } PK!\nSocialMedia.phpnu[ 'integer', 'active_status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; } PK!RefundRequest.phpnu[ 'integer', 'customer_id' => 'integer', 'status'=>'string', 'amount' => 'float', 'product_id' => 'integer', 'order_id' => 'integer', 'refund_reason'=>'string', 'approved_note'=>'string', 'rejected_note'=>'string', 'payment_info'=>'string', 'change_by'=>'string' ]; public function customer():BelongsTo { return $this->belongsTo(User::class, 'customer_id'); } public function product():BelongsTo { return $this->belongsTo(Product::class,'product_id'); } /* order_details->orderDetails */ public function orderDetails():BelongsTo { return $this->belongsTo(OrderDetail::class,'order_details_id'); } public function order():BelongsTo { return $this->belongsTo(Order::class,'order_id'); } /* refund_status->refundStatus */ public function refundStatus():HasMany { return $this->hasMany(RefundStatus::class,'refund_request_id'); } } PK!Yqx55 Coupon.phpnu[ 'integer', 'added_by' => 'string', 'coupon_type' => 'string', 'coupon_bearer' => 'string', 'seller_id' => 'integer', 'customer_id' => 'integer', 'title' => 'string', 'code' => 'string', 'start_date' => 'datetime', 'expire_date' => 'datetime', 'min_purchase' => 'float', 'max_discount' => 'float', 'discount' => 'float', 'discount_type' => 'string', 'limit' => 'int', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function order():HasMany { return $this->hasMany(Order::class, 'coupon_code', 'code'); } public function seller():BelongsTo { return $this->belongsTo(Seller::class); } } PK!WWTag.phpnu[ 'integer', ]; public function items() { return $this->belongsToMany(Product::class)->using(ProductTag::class); } } PK!zMostDemanded.phpnu[ 'integer', 'product_id' => 'integer', 'status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; /** * Get the related product for the most demanded item. * * @return BelongsTo */ public function product(): BelongsTo { return $this->belongsTo(Product::class); } } PK!G^|'ssOrderStatusHistory.phpnu[ 'integer', ]; } PK!h)( Category.phpnu[ 'string', 'slug' => 'string', 'icon' => 'string', 'parent_id' => 'integer', 'position' => 'integer', 'home_status' => 'integer', 'priority' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function translations(): MorphMany { return $this->morphMany('App\Models\Translation', 'translationable'); } public function parent(): BelongsTo { return $this->belongsTo(Category::class, 'parent_id')->orderBy('priority', 'desc'); } public function childes(): HasMany { return $this->hasMany(Category::class, 'parent_id')->orderBy('priority', 'asc'); } public function product(): HasMany { return $this->hasMany(Product::class, 'category_id', 'id'); } // Old Relation: sub_category_product public function subCategoryProduct(): HasMany { return $this->hasMany(Product::class, 'sub_category_id', 'id'); } // Old Relation: sub_sub_category_product public function subSubCategoryProduct(): HasMany { return $this->hasMany(Product::class, 'sub_sub_category_id', 'id'); } public function getNameAttribute($name): string|null { if (strpos(url()->current(), '/admin') || strpos(url()->current(), '/vendor') || strpos(url()->current(), '/seller')) { return $name; } return $this->translations[0]->value ?? $name; } public function getDefaultNameAttribute(): string|null { return $this->translations[0]->value ?? $this->name; } public function scopePriority($query): mixed { return $query->orderBy('priority', 'asc'); } protected static function boot(): void { parent::boot(); static::addGlobalScope('translate', function (Builder $builder) { $builder->with(['translations' => function ($query) { if (strpos(url()->current(), '/api')) { return $query->where('locale', App::getLocale()); } else { return $query->where('locale', getDefaultLanguage()); } }]); }); } } PK!o Banner.phpnu[ 'integer', 'published' => 'integer', 'resource_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'photo', 'banner_type', 'theme', 'published', 'url', 'resource_type', 'resource_id', 'title', 'sub_title', 'button_text', 'background_color', ]; public function product(){ return $this->belongsTo(Product::class,'resource_id'); } } PK!x7PaymentRequest.phpnu[ 'string', 'token' => 'string', 'otp_hit_count' => 'integer', 'is_temp_blocked' => 'boolean', 'temp_block_time' => 'datetime', 'expires_at' => 'datetime', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; } PK!ZhhWithdrawRequest.phpnu[ 'array', 'approved' => 'integer', ]; public function seller(): BelongsTo { return $this->belongsTo(Seller::class,'seller_id'); } /* delivery_men->deliveryMan*/ public function deliveryMan(): BelongsTo { return $this->belongsTo(DeliveryMan::class,'delivery_man_id'); } /* withdraw_method->deliveryMan*/ public function withdrawMethod(): BelongsTo { return $this->belongsTo(WithdrawalMethod::class,'withdrawal_method_id'); } } PK!vZZSupportTicketConv.phpnu[ 'integer', 'support_ticket_id' => 'integer', 'admin_id' => 'integer', 'position' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function adminInfo(): BelongsTo { return $this->belongsTo(Admin::class, 'admin_id','id'); } } PK!zT Order.phpnu[ 'integer', 'is_guest' => 'boolean', 'customer_type' => 'string', 'payment_status' => 'string', 'order_status' => 'string', 'payment_method' => 'string', 'transaction_ref' => 'string', 'payment_by' => 'string', 'payment_note' => 'string', 'order_amount' => 'double', 'admin_commission' => 'decimal:2', 'is_pause' => 'boolean', 'cause' => 'string', 'shipping_address' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'discount_amount' => 'double', 'discount_type' => 'string', 'coupon_code' => 'string', 'coupon_discount_bearer' => 'string', 'shipping_responsibility' => 'string', 'shipping_method_id' => 'integer', 'shipping_cost' => 'double', 'is_shipping_free' => 'boolean', 'order_group_id' => 'string', 'verification_code' => 'string', 'verification_status' => 'boolean', 'seller_id' => 'integer', 'seller_is' => 'string', 'shipping_address_data' => 'object', 'delivery_man_id' => 'integer', 'deliveryman_charge' => 'double', 'order_note' => 'string', 'billing_address' => 'integer', 'billing_address_data' => 'object', 'order_type' => 'string', 'extra_discount' => 'double', 'extra_discount_type' => 'string', 'free_delivery_bearer' => 'string', 'checked' => 'boolean', 'shipping_type' => 'string', 'delivery_type' => 'string', 'delivery_service_name' => 'string', 'third_party_delivery_tracking_id' => 'string', ]; public function details() : HasMany { return $this->hasMany(OrderDetail::class)->orderBy('seller_id', 'ASC'); } public function seller(): BelongsTo { return $this->belongsTo(Seller::class); } public function sellerName() : HasOne { return $this->hasOne(OrderDetail::class); } public function customer(): BelongsTo { return $this->belongsTo(User::class, 'customer_id'); } public function shipping(): BelongsTo { return $this->belongsTo(ShippingMethod::class, 'shipping_method_id'); } public function shippingAddress(): BelongsTo { return $this->belongsTo(ShippingAddress::class, 'shipping_address'); } public function billingAddress(): BelongsTo { return $this->belongsTo(ShippingAddress::class, 'billing_address'); } public function deliveryMan(): BelongsTo { return $this->belongsTo(DeliveryMan::class,'delivery_man_id'); } /* delivery_man_review -> deliveryManReview */ public function deliveryManReview():HasOne { return $this->hasOne(Review::class,'order_id')->whereNotNull('delivery_man_id'); } /* order_transaction -> orderTransaction */ public function orderTransaction() : HasOne { return $this->hasOne(OrderTransaction::class, 'order_id'); } public function coupon():BelongsTo { return $this->belongsTo(Coupon::class, 'coupon_code', 'code'); } /* order_status_history -> orderStatusHistory */ public function orderStatusHistory():HasMany { return $this->hasMany(OrderStatusHistory::class); } /* order_details -> orderDetails */ public function orderDetails() : HasMany { return $this->hasMany(OrderDetail::class, 'order_id'); } /* offline_payments -> offlinePayments */ public function offlinePayments() : BelongsTo { return $this->belongsTo(OfflinePayments::class, 'id', 'order_id'); } /* verification_images -> verificationImages */ public function verificationImages(): HasMany { return $this->hasMany(OrderDeliveryVerification::class,'order_id'); } protected static function boot(): void { parent::boot(); //static::addGlobalScope(new RememberScope); } } PK!WithdrawalMethod.phpnu[ 'array', 'is_default' => 'boolean', 'is_active' => 'boolean', ]; protected function scopeOfStatus($query, $status) { $query->where('is_active', $status); } } PK! ## Attribute.phpnu[PK!'lz`ShopFollower.phpnu[PK!^<7OrderDeliveryVerification.phpnu[PK!Iy. DeliverymanWallet.phpnu[PK!Ot Customer.phpnu[PK!wLoyaltyPointTransaction.phpnu[PK!F~Shop.phpnu[PK!6BH&&CategoryShippingCost.phpnu[PK!f T!OrderDetail.phpnu[PK!H-VendorRegistrationReason.phpnu[PK!  0Currency.phpnu[PK!˽4Scopes/RememberScope.phpnu[PK!y6DealOfTheDay.phpnu[PK! .Q>NotificationSeen.phpnu[PK!?DeliveryManTransaction.phpnu[PK!^|;DNotificationMessage.phpnu[PK!.zzeHSellerWalletHistory.phpnu[PK!81%%&IBusinessSetting.phpnu[PK!^XXKDeliveryZipCode.phpnu[PK!//tt )NContact.phpnu[PK!҇22QAdminWalletHistory.phpnu[PK! PUOrderTransaction.phpnu[PK!b\ \ /^Chatting.phpnu[PK!,vviDeliveryHistory.phpnu[PK!$~~jCartShipping.phpnu[PK!\ >nSeller.phpnu[PK!VyProductCompare.phpnu[PK!Oy|Subscription.phpnu[PK!irCustomerWallet.phpnu[PK!rrFeatureDeal.phpnu[PK!fY0ShippingType.phpnu[PK!KCyyAdminWallet.phpnu[PK!oQQ;Translation.phpnu[PK!SˏUser.phpnu[PK!o#q q FlashDeal.phpnu[PK!KSearchFunction.phpnu[PK!_PhoneOrEmailVerification.phpnu[PK!# u"("( ޮProduct.phpnu[PK!k*i77 ;HelpTopic.phpnu[PK!olaEmergencyContact.phpnu[PK!-b yEmailTemplate.phpnu[PK!j((:SupportTicket.phpnu[PK!T?znn Wishlist.phpnu[PK!ȅMFlashDealProduct.phpnu[PK!a,0hhDeliveryCountryCode.phpnu[PK!B H[[7CustomerWalletHistory.phpnu[PK!̜!! Brand.phpnu[PK!cQQ5OfflinePaymentMethod.phpnu[PK!Z AdminRole.phpnu[PK!+ee ShippingAddress.phpnu[PK!mbuu_SellerWallet.phpnu[PK!NOfflinePayments.phpnu[PK!V\Transaction.phpnu[PK!j99UShippingMethod.phpnu[PK!=n ProductTag.phpnu[PK!)\ !Review.phpnu[PK!y4+RefundTransaction.phpnu[PK!ehh%3DeliverymanNotification.phpnu[PK!l6WalletTransaction.phpnu[PK!   19Setting.phpnu[PK! SSx;BillingAddress.phpnu[PK!(  @OrderExpectedDeliveryHistory.phpnu[PK!fII!@CDigitalProductOtpVerification.phpnu[PK!b GCart.phpnu[PK!|2ARNotification.phpnu[PK!> WGuestUser.phpnu[PK! XColor.phpnu[PK!օ>ZRefundStatus.phpnu[PK! >]DeliveryMan.phpnu[PK!!VhAddFundBonusCategories.phpnu[PK!>[CssHnProductStock.phpnu[PK! nAdmin.phpnu[PK!\nPvSocialMedia.phpnu[PK!yRefundRequest.phpnu[PK!Yqx55 xCoupon.phpnu[PK!WWTag.phpnu[PK!zuMostDemanded.phpnu[PK!G^|'ssTOrderStatusHistory.phpnu[PK!h)(  Category.phpnu[PK!o Banner.phpnu[PK!x7ǤPaymentRequest.phpnu[PK!_PasswordReset.phpnu[PK!ZhhWithdrawRequest.phpnu[PK!vZZSupportTicketConv.phpnu[PK!zT -Order.phpnu[PK!WithdrawalMethod.phpnu[PKVVL