????Attribute.php000064400000002043150072607460007226 0ustar00 '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()); } }]); }); } } ShopFollower.php000064400000000627150072607460007714 0ustar00 'integer', 'user_id' => 'integer', ]; } OrderDeliveryVerification.php000064400000001252150072607460012406 0ustar00 'integer', 'order_id' => 'integer', 'image' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'order_id', 'image', ]; } DeliverymanWallet.php000064400000002430150072607460010713 0ustar00 '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'); } } Customer.php000064400000000361150072607460007065 0ustar00 '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); } } Shop.php000064400000003730150072607460006200 0ustar00 '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']); }); } } CategoryShippingCost.php000064400000002046150072607460011376 0ustar00 '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'); } } OrderDetail.php000064400000005665150072607460007476 0ustar00 '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'); } } VendorRegistrationReason.php000064400000001371150072607460012266 0ustar00 'integer', 'title' => 'string', 'description' => 'string', 'priority' => 'integer', 'status' => 'integer', ]; } Currency.php000064400000001716150072607460007063 0ustar00 '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); } } Scopes/RememberScope.php000064400000000675150072607460011260 0ustar00remember(now()->addDay()); $builder->cacheFor(now()->addDays(1)); } } DealOfTheDay.php000064400000003745150072607460007526 0ustar00 '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()); } }]); }); } } NotificationSeen.php000064400000000335150072607460010526 0ustar00 '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', ]; } NotificationMessage.php000064400000001743150072607460011224 0ustar00 'string', 'key' => 'string', 'message' => 'string', 'status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function translations(): MorphMany { return $this->morphMany('App\Models\Translation', 'translationable'); } } SellerWalletHistory.php000064400000000172150072607460011245 0ustar00 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected static function boot(): void { parent::boot(); // static::addGlobalScope(new RememberScope); } } DeliveryZipCode.php000064400000001130150072607460010320 0ustar00 'integer', 'zipcode' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'zipcode', ]; } Contact.php000064400000001564150072607460006665 0ustar00 'integer', 'seen' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'name', 'email', 'mobile_number', 'subject', 'message', 'seen', 'feedback', 'reply', ]; protected $table = 'contacts'; } AdminWalletHistory.php000064400000001462150072607460011052 0ustar00 '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', ]; } OrderTransaction.php000064400000004233150072607460010547 0ustar00 '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'); } } Chatting.php000064400000005534150072607460007034 0ustar00 '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'); } } DeliveryHistory.php000064400000000166150072607460010434 0ustar00 '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'); } } Seller.php000064400000005336150072607460006521 0ustar00 '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')); } } ProductCompare.php000064400000001364150072607460010217 0ustar00 'integer', 'user_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function product(): BelongsTo { return $this->belongsTo(Product::class, 'product_id')->active(); } } Subscription.php000064400000001246150072607460007753 0ustar00 'string', ]; } CustomerWallet.php000064400000001313150072607460010234 0ustar00 'integer', 'customer_id' => 'integer', 'balance' => 'float', 'royalty_points' => 'float', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'customer_id', 'balance', 'royalty_points', ]; } FeatureDeal.php000064400000000162150072607460007444 0ustar00 'integer', 'shipping_type' => 'string', ]; } AdminWallet.php000064400000002171150072607460007466 0ustar00 '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', ]; } Translation.php000064400000002121150072607460007556 0ustar00 '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); } } User.php000064400000011632150072607460006205 0ustar00 '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'); } } FlashDeal.php000064400000004561150072607460007115 0ustar00 '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()); } }]); }); } } SearchFunction.php000064400000000206150072607460010175 0ustar00 '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'); }]); }); } } HelpTopic.php000064400000001067150072607460007157 0ustar00 '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); } } EmergencyContact.php000064400000001606150072607460010521 0ustar00 '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', ]; } EmailTemplate.php000064400000004600150072607460010007 0ustar00 '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()); } } SupportTicket.php000064400000002450150072607460010105 0ustar00 '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'); } } Wishlist.php000064400000002156150072607460007076 0ustar00 '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'); } } FlashDealProduct.php000064400000002367150072607460010460 0ustar00 '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]); } } DeliveryCountryCode.php000064400000001150150072607460011223 0ustar00 'integer', 'country_code' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; } CustomerWalletHistory.php000064400000001533150072607460011622 0ustar00 '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', ]; } Brand.php000064400000004041150072607460006311 0ustar00 '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()); } }]); }); } } OfflinePaymentMethod.php000064400000000521150072607460011343 0ustar00 'array', 'method_informations' => 'array', ]; } AdminRole.php000064400000001254150072607460007140 0ustar00 'integer', 'name' => 'string', 'module_access' => 'string', 'status' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $fillable = [ 'name', 'module_access', 'status', ]; } ShippingAddress.php000064400000002545150072607460010361 0ustar00 'boolean', 'is_billing' => 'boolean', ]; } SellerWallet.php000064400000002565150072607460007673 0ustar00 '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); } } OfflinePayments.php000064400000001405150072607460010367 0ustar00 'json', ]; } Transaction.php000064400000001672150072607460007557 0ustar00 '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); } } ShippingMethod.php000064400000002071150072607460010206 0ustar00 'boolean', 'cost' => 'float:2', ]; public function seller():BelongsTo { return $this->belongsTo(Seller::class,'creator_id'); } } ProductTag.php000064400000000277150072607460007346 0ustar00 '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); } }); } } RefundTransaction.php000064400000003354150072607460010722 0ustar00 '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); } } DeliverymanNotification.php000064400000001550150072607460012113 0ustar00 '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'); } } WalletTransaction.php000064400000001024150072607460010717 0ustar00 'integer', 'credit' => 'float', 'debit' => 'float', 'admin_bonus'=>'float', 'balance'=>'float', 'reference'=>'string', 'created_at'=>'string' ]; public function user() { return $this->belongsTo(User::class); } } Setting.php000064400000001014150072607460006675 0ustar00 'array', 'test_values' => 'array', 'is_active' => 'integer', ]; protected $fillable = ['key_name', 'live_values', 'test_values', 'settings_type', 'mode', 'is_active', 'additional_data']; } BillingAddress.php000064400000002123150072607460010150 0ustar00 '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', ]; } OrderExpectedDeliveryHistory.php000064400000001343150072607460013110 0ustar00 'integer', 'user_id' => 'integer', 'user_type' => 'string', 'expected_delivery_date' => 'date', 'cause' => 'string', ]; } DigitalProductOtpVerification.php000064400000002111150072607460013223 0ustar00 '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', ]; } Cart.php000064400000005271150072607460006162 0ustar00 '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'); } } Notification.php000064400000002347150072607460007720 0ustar00 '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'); } } GuestUser.php000064400000000264150072607460007214 0ustar00 'integer', 'name' => 'string', 'code' => 'string', ]; } RefundStatus.php000064400000001025150072607460007711 0ustar00 'integer', 'change_by' => 'string', 'change_by_id' => 'string', 'status' => 'string', 'message' => 'string', ]; } DeliveryMan.php000064400000005226150072607460007510 0ustar00 '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'); } } AddFundBonusCategories.php000064400000002753150072607460011615 0ustar00 '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]); } } ProductStock.php000064400000000163150072607460007710 0ustar00 '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'); } } SocialMedia.php000064400000001371150072607460007440 0ustar00 'integer', 'active_status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; } RefundRequest.php000064400000003257150072607460010067 0ustar00 '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'); } } Coupon.php000064400000003465150072607460006537 0ustar00 '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); } } Tag.php000064400000001527150072607460006004 0ustar00 'integer', ]; public function items() { return $this->belongsToMany(Product::class)->using(ProductTag::class); } } MostDemanded.php000064400000002237150072607460007634 0ustar00 '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); } } OrderStatusHistory.php000064400000001563150072607460011132 0ustar00 'integer', ]; } Category.php000064400000005657150072607460007056 0ustar00 '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()); } }]); }); } } Banner.php000064400000002225150072607460006472 0ustar00 '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'); } } PaymentRequest.php000064400000000416150072607460010253 0ustar00 'string', 'token' => 'string', 'otp_hit_count' => 'integer', 'is_temp_blocked' => 'boolean', 'temp_block_time' => 'datetime', 'expires_at' => 'datetime', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; } WithdrawRequest.php000064400000003150150072607460010425 0ustar00 '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'); } } SupportTicketConv.php000064400000002132150072607460010730 0ustar00 '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'); } } Order.php000064400000016034150072607460006343 0ustar00 '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); } } WithdrawalMethod.php000064400000002022150072607460010527 0ustar00 'array', 'is_default' => 'boolean', 'is_active' => 'boolean', ]; protected function scopeOfStatus($query, $status) { $query->where('is_active', $status); } }