From 37b9624b8409115a7bdc68dcf3b16b9b65b58163 Mon Sep 17 00:00:00 2001 From: sina_sajjadi Date: Sun, 24 Nov 2024 16:18:36 +0330 Subject: [PATCH] initial commit --- .editorconfig | 15 + .env.example | 169 + .gitattributes | 5 + .gitignore | 20 + .styleci.yml | 13 + Dockerfile | 8 + app/Console/Kernel.php | 41 + app/Exceptions/Handler.php | 40 + app/Http/Controllers/Controller.php | 13 + app/Http/Kernel.php | 66 + app/Http/Middleware/Authenticate.php | 21 + app/Http/Middleware/EncryptCookies.php | 17 + .../PreventRequestsDuringMaintenance.php | 17 + .../Middleware/RedirectIfAuthenticated.php | 32 + app/Http/Middleware/TrimStrings.php | 18 + app/Http/Middleware/TrustHosts.php | 20 + app/Http/Middleware/TrustProxies.php | 29 + app/Http/Middleware/VerifyCsrfToken.php | 17 + app/Models/User.php | 43 + app/Providers/AppServiceProvider.php | 32 + app/Providers/AuthServiceProvider.php | 30 + app/Providers/BroadcastServiceProvider.php | 21 + app/Providers/EventServiceProvider.php | 32 + app/Providers/RouteServiceProvider.php | 63 + artisan | 53 + bootstrap/app.php | 55 + bootstrap/cache/.gitignore | 2 + composer.json | 90 + composer.lock | 14190 +++++++++++ config/app.php | 231 + config/auth.php | 117 + config/broadcasting.php | 64 + config/cache.php | 104 + config/cors.php | 34 + config/database.php | 147 + config/filesystems.php | 73 + config/flutterwave.php | 31 + config/hashing.php | 52 + config/logging.php | 104 + config/mail.php | 110 + config/money.php | 21 + config/pdf.php | 26 + config/purify.php | 86 + config/queue.php | 89 + config/services.php | 33 + config/session.php | 201 + config/sluggable.php | 141 + config/view.php | 36 + database/.gitignore | 2 + database/factories/UserFactory.php | 33 + .../2014_10_12_000000_create_users_table.php | 36 + ...12_100000_create_password_resets_table.php | 32 + ..._08_19_000000_create_failed_jobs_table.php | 36 + .../2022_04_11_094659_create_jobs_table.php | 36 + database/seeders/DatabaseSeeder.php | 29 + install.sh | 51 + lang/en/auth.php | 20 + lang/en/pagination.php | 19 + lang/en/passwords.php | 22 + lang/en/validation.php | 152 + package.json | 21 + packages/marvel/.gitignore | 14 + packages/marvel/.styleci.yml | 1 + packages/marvel/composer.json | 77 + packages/marvel/config/auth.php | 133 + packages/marvel/config/broadcasting.php | 64 + packages/marvel/config/cache.php | 105 + packages/marvel/config/constants.php | 71 + packages/marvel/config/cors.php | 34 + packages/marvel/config/flutterwave.php | 31 + packages/marvel/config/graphiql.php | 64 + packages/marvel/config/graphql-playground.php | 49 + packages/marvel/config/laravel-omnipay.php | 29 + packages/marvel/config/lighthouse.php | 600 + packages/marvel/config/media-library.php | 215 + packages/marvel/config/newsletter.php | 47 + packages/marvel/config/paystack.php | 38 + packages/marvel/config/permission.php | 187 + packages/marvel/config/repository.php | 249 + packages/marvel/config/sanctum.php | 48 + packages/marvel/config/scout.php | 91 + packages/marvel/config/services.php | 57 + packages/marvel/config/shop.php | 114 + packages/marvel/config/sluggable.php | 147 + packages/marvel/config/sslcommerz.php | 133 + ..._04_17_194830_create_permission_tables.php | 114 + ...2020_06_02_051901_create_marvel_tables.php | 280 + .../2020_10_26_163529_create_media_table.php | 40 + ..._04_17_051901_create_new_marvel_tables.php | 226 + .../2021_08_08_051901_create_wallet_table.php | 61 + ...09_26_051901_create_product_type_table.php | 77 + ...2021_10_12_193855_create_reviews_table.php | 88 + ...2022_01_19_051901_create_rental_tables.php | 104 + ..._051901_create_marvel_languages_tables.php | 95 + ...901_create_marvel_delivery_time_tables.php | 37 + ...1902_create_marvel_store_notice_tables.php | 59 + ...2022_03_24_124527_add_columns_to_table.php | 51 + ...022_05_09_070829_create_messages_table.php | 76 + ...05_10_154638_add_column_to_order_table.php | 32 + ..._07_12_030502_create_notify_logs_table.php | 37 + .../2023_07_19_162433_create_faqs_table.php | 38 + ...3633_create_terms_and_conditions_table.php | 39 + ...sold_quantity_column_to_products_table.php | 35 + ..._08_14_173253_create_flash_sales_table.php | 59 + ...d_is_featured_column_to_products_table.php | 28 + ...28_114418_create_refund_policies_table.php | 43 + ..._07_061715_create_refund_reasons_table.php | 37 + ...te_column_to_flash_sale_requests_table.php | 42 + ...10_add_new_two_column_to_coupons_table.php | 33 + ..._12_162216_create_became_sellers_table.php | 29 + ...2_063637_create_transfer_history_table.php | 45 + ..._02_07_162216_create_commissions_table.php | 42 + packages/marvel/license.md | 5 + packages/marvel/phpunit.xml | 22 + packages/marvel/readme.md | 5 + packages/marvel/src/Ai/Ai.php | 26 + packages/marvel/src/Ai/AiInterface.php | 8 + packages/marvel/src/Ai/Base.php | 20 + packages/marvel/src/Ai/Openai.php | 50 + .../marvel/src/Console/AWSSetupCommand.php | 161 + .../marvel/src/Console/AdminCreateCommand.php | 93 + .../marvel/src/Console/CopyFilesCommand.php | 34 + .../src/Console/DatabaseSetupCommand.php | 171 + .../Console/DefaultLanguageSetupCommand.php | 94 + .../marvel/src/Console/ENVSetupCommand.php | 108 + .../src/Console/FrontendSetupCommand.php | 203 + .../marvel/src/Console/ImportDemoData.php | 203 + .../marvel/src/Console/InstallCommand.php | 205 + .../marvel/src/Console/MailSetupCommand.php | 407 + .../MailchimpNewsletterSetupCommand.php | 108 + .../marvel/src/Console/MarvelInfoCommand.php | 90 + .../marvel/src/Console/MarvelVerification.php | 139 + .../src/Console/OTPGatewaySetupCommand.php | 188 + .../marvel/src/Console/OpenAiSetupCommand.php | 89 + .../Console/QueueConnectionSetupCommand.php | 89 + .../marvel/src/Console/SettingsDataSeed.php | 89 + .../src/Console/TestMailSendCommand.php | 64 + .../src/Console/TranslationEnabledCommand.php | 109 + .../src/Database/Models/AbusiveReport.php | 29 + .../marvel/src/Database/Models/Address.php | 26 + .../marvel/src/Database/Models/Attachment.php | 31 + .../marvel/src/Database/Models/Attribute.php | 60 + .../src/Database/Models/AttributeValue.php | 58 + .../marvel/src/Database/Models/Author.php | 62 + .../src/Database/Models/Availability.php | 16 + .../marvel/src/Database/Models/Balance.php | 25 + .../marvel/src/Database/Models/Banner.php | 28 + .../src/Database/Models/BecameSeller.php | 27 + .../marvel/src/Database/Models/Category.php | 111 + .../marvel/src/Database/Models/Commission.php | 17 + .../src/Database/Models/Conversation.php | 77 + .../marvel/src/Database/Models/Coupon.php | 68 + .../src/Database/Models/DeliveryTime.php | 39 + .../src/Database/Models/DigitalFile.php | 25 + .../src/Database/Models/DownloadToken.php | 21 + packages/marvel/src/Database/Models/Faqs.php | 56 + .../marvel/src/Database/Models/Feedback.php | 37 + .../marvel/src/Database/Models/FlashSale.php | 63 + .../src/Database/Models/FlashSaleRequests.php | 36 + .../marvel/src/Database/Models/Language.php | 12 + .../src/Database/Models/Manufacturer.php | 70 + .../marvel/src/Database/Models/Message.php | 47 + .../marvel/src/Database/Models/NotifyLogs.php | 45 + packages/marvel/src/Database/Models/Order.php | 126 + .../src/Database/Models/OrderWalletPoint.php | 21 + .../src/Database/Models/OrderedFile.php | 29 + .../src/Database/Models/OwnershipTransfer.php | 75 + .../src/Database/Models/Participant.php | 45 + .../src/Database/Models/PasswordReset.php | 15 + .../src/Database/Models/PaymentGateway.php | 35 + .../src/Database/Models/PaymentIntent.php | 38 + .../src/Database/Models/PaymentMethod.php | 26 + .../marvel/src/Database/Models/Permission.php | 23 + .../marvel/src/Database/Models/Product.php | 330 + .../marvel/src/Database/Models/Profile.php | 27 + .../marvel/src/Database/Models/Provider.php | 18 + .../marvel/src/Database/Models/Question.php | 95 + .../marvel/src/Database/Models/Refund.php | 60 + .../src/Database/Models/RefundPolicy.php | 56 + .../src/Database/Models/RefundReason.php | 40 + .../marvel/src/Database/Models/Resource.php | 44 + .../marvel/src/Database/Models/Review.php | 95 + .../marvel/src/Database/Models/Settings.php | 27 + .../marvel/src/Database/Models/Shipping.php | 30 + packages/marvel/src/Database/Models/Shop.php | 166 + .../src/Database/Models/StoreNotice.php | 111 + .../src/Database/Models/StoreNoticeRead.php | 34 + packages/marvel/src/Database/Models/Tag.php | 63 + packages/marvel/src/Database/Models/Tax.php | 27 + .../Database/Models/TermsAndConditions.php | 57 + packages/marvel/src/Database/Models/Type.php | 72 + packages/marvel/src/Database/Models/User.php | 223 + .../marvel/src/Database/Models/Variation.php | 78 + .../marvel/src/Database/Models/Wallet.php | 23 + .../marvel/src/Database/Models/Wishlist.php | 36 + .../marvel/src/Database/Models/Withdraw.php | 23 + .../Repositories/AbusiveReportRepository.php | 64 + .../Repositories/AddressRepository.php | 17 + .../Repositories/AttachmentRepository.php | 18 + .../Repositories/AttributeRepository.php | 89 + .../Repositories/AttributeValueRepository.php | 37 + .../Repositories/AuthorRepository.php | 81 + .../Repositories/AvailabilityRepository.php | 39 + .../Database/Repositories/BaseRepository.php | 251 + .../Repositories/BecameSellersRepository.php | 44 + .../Repositories/CategoryRepository.php | 71 + .../Repositories/CheckoutRepository.php | 217 + .../Repositories/CommissionRepository.php | 64 + .../Repositories/ConversationRepository.php | 40 + .../Repositories/CouponRepository.php | 147 + .../Repositories/DeliveryTimeRepository.php | 17 + .../Repositories/DownloadRepository.php | 29 + .../Database/Repositories/FaqsRepository.php | 102 + .../Repositories/FeedbackRepository.php | 29 + .../Repositories/FlashSaleRepository.php | 161 + .../FlashSaleVendorRequestRepository.php | 194 + .../Repositories/LanguageRepository.php | 17 + .../Repositories/ManufacturerRepository.php | 78 + .../Repositories/MessageRepository.php | 84 + .../Repositories/NotifyLogsRepository.php | 41 + .../Database/Repositories/OrderRepository.php | 577 + .../OwnershipTransferRepository.php | 143 + .../Repositories/ParticipantRepository.php | 34 + .../Repositories/PaymentIntentRepository.php | 55 + .../Repositories/PaymentMethodRepository.php | 144 + .../Repositories/ProductRepository.php | 758 + .../Repositories/ProfileRepository.php | 36 + .../Repositories/QuestionRepository.php | 89 + .../Repositories/RefundPolicyRepository.php | 73 + .../Repositories/RefundReasonRepository.php | 63 + .../Repositories/RefundRepository.php | 128 + .../Repositories/ResourceRepository.php | 42 + .../Repositories/ReviewRepository.php | 92 + .../Repositories/SettingsRepository.php | 47 + .../Repositories/ShippingRepository.php | 36 + .../Database/Repositories/ShopRepository.php | 197 + .../StoreNoticeReadRepository.php | 114 + .../Repositories/StoreNoticeRepository.php | 208 + .../Database/Repositories/TagRepository.php | 61 + .../Database/Repositories/TaxRepository.php | 36 + .../TermsAndConditionsRepository.php | 106 + .../Database/Repositories/TypeRepository.php | 91 + .../Database/Repositories/UserRepository.php | 147 + .../Repositories/WishlistRepository.php | 85 + .../Repositories/WithdrawRepository.php | 34 + .../marvel/src/Database/Seeders/FaqSeeder.php | 757 + .../src/Database/Seeders/MarvelSeeder.php | 24 + .../Database/Seeders/RefundPolicySeeder.php | 160 + .../Database/Seeders/RefundReasonSeeder.php | 240 + .../src/Database/Seeders/SettingsSeeder.php | 264 + .../Seeders/TermsAndConditionSeeder.php | 182 + packages/marvel/src/Enums/AiType.php | 15 + .../marvel/src/Enums/CouponTargetType.php | 16 + packages/marvel/src/Enums/CouponType.php | 18 + .../marvel/src/Enums/DefaultStatusType.php | 18 + packages/marvel/src/Enums/EventType.php | 27 + packages/marvel/src/Enums/FlashSaleType.php | 19 + .../marvel/src/Enums/ManufacturerType.php | 16 + packages/marvel/src/Enums/OrderStatus.php | 23 + .../marvel/src/Enums/PaymentGatewayType.php | 27 + packages/marvel/src/Enums/PaymentStatus.php | 25 + packages/marvel/src/Enums/Permission.php | 18 + packages/marvel/src/Enums/ProductStatus.php | 20 + packages/marvel/src/Enums/ProductType.php | 16 + .../src/Enums/ProductVisibilityStatus.php | 16 + .../marvel/src/Enums/RefundPolicyStatus.php | 16 + .../marvel/src/Enums/RefundPolicyTarget.php | 16 + packages/marvel/src/Enums/RefundStatus.php | 18 + packages/marvel/src/Enums/ResourceType.php | 19 + packages/marvel/src/Enums/Role.php | 18 + packages/marvel/src/Enums/ShippingType.php | 18 + .../marvel/src/Enums/StoreNoticePriority.php | 17 + packages/marvel/src/Enums/StoreNoticeType.php | 18 + packages/marvel/src/Enums/WithdrawStatus.php | 19 + .../src/Events/CommissionRateUpdateEvent.php | 32 + .../src/Events/DigitalProductUpdateEvent.php | 30 + .../marvel/src/Events/FlashSaleProcessed.php | 30 + packages/marvel/src/Events/Maintenance.php | 27 + packages/marvel/src/Events/MessageSent.php | 145 + packages/marvel/src/Events/OrderCancelled.php | 26 + packages/marvel/src/Events/OrderCreated.php | 142 + packages/marvel/src/Events/OrderDelivered.php | 28 + packages/marvel/src/Events/OrderProcessed.php | 26 + packages/marvel/src/Events/OrderReceived.php | 22 + .../marvel/src/Events/OrderStatusChanged.php | 28 + .../Events/OwnershipTransferStatusControl.php | 29 + packages/marvel/src/Events/PaymentFailed.php | 26 + packages/marvel/src/Events/PaymentMethods.php | 26 + packages/marvel/src/Events/PaymentSuccess.php | 26 + .../src/Events/ProcessOwnershipTransition.php | 46 + .../marvel/src/Events/ProcessUserData.php | 19 + .../src/Events/ProductReviewApproved.php | 26 + .../src/Events/ProductReviewRejected.php | 26 + .../marvel/src/Events/QuestionAnswered.php | 20 + packages/marvel/src/Events/RefundApproved.php | 24 + .../marvel/src/Events/RefundRequested.php | 24 + packages/marvel/src/Events/RefundUpdate.php | 24 + packages/marvel/src/Events/ReviewCreated.php | 20 + .../marvel/src/Events/ShopMaintenance.php | 23 + .../marvel/src/Events/StoreNoticeEvent.php | 123 + .../marvel/src/Events/TestPusherEvent.php | 75 + .../Exceptions/MarvelBadRequestException.php | 25 + .../MarvelInvalidArgumentException.php | 21 + .../Exceptions/MarvelNotFoundException.php | 24 + .../src/Exceptions/PickbazarException.php | 58 + packages/marvel/src/Exports/OrderExport.php | 116 + packages/marvel/src/Facades/Ai.php | 18 + packages/marvel/src/Facades/Payment.php | 29 + packages/marvel/src/Facades/Shop.php | 18 + .../EnsureEmailIsVerifiedDirective.php | 60 + .../Mutations/AbusiveReportMutator.php | 26 + .../src/GraphQL/Mutations/AiMutator.php | 15 + .../GraphQL/Mutations/AttributeMutator.php | 29 + .../Mutations/AttributeValueMutator.php | 24 + .../src/GraphQL/Mutations/AuthMutator.php | 107 + .../src/GraphQL/Mutations/AuthorMutator.php | 24 + .../GraphQL/Mutations/BecameSellerMutator.php | 16 + .../src/GraphQL/Mutations/CardMutator.php | 48 + .../src/GraphQL/Mutations/CategoryMutator.php | 20 + .../src/GraphQL/Mutations/CheckoutMutator.php | 16 + .../GraphQL/Mutations/ConversationMutator.php | 16 + .../src/GraphQL/Mutations/CouponMutator.php | 36 + .../src/GraphQL/Mutations/FaqMutator.php | 25 + .../src/GraphQL/Mutations/FeedbackMutator.php | 16 + .../GraphQL/Mutations/FlashSaleMutator.php | 24 + .../Mutations/FlashSaleRequestsMutator.php | 31 + .../GraphQL/Mutations/ManufacturerMutator.php | 24 + .../src/GraphQL/Mutations/MessageMutator.php | 21 + .../GraphQL/Mutations/NotifyLogMutator.php | 25 + .../src/GraphQL/Mutations/OrderMutator.php | 29 + .../GraphQL/Mutations/OwnershipMutator.php | 20 + .../Mutations/PaymentIntentMutator.php | 24 + .../src/GraphQL/Mutations/ProductMutator.php | 38 + .../src/GraphQL/Mutations/QuestionMutator.php | 21 + .../src/GraphQL/Mutations/RefundMutator.php | 21 + .../GraphQL/Mutations/RefundPolicyMutator.php | 24 + .../GraphQL/Mutations/RefundReasonMutator.php | 24 + .../src/GraphQL/Mutations/ReviewMutator.php | 21 + .../src/GraphQL/Mutations/SettingsMutator.php | 16 + .../src/GraphQL/Mutations/ShopMutator.php | 52 + .../GraphQL/Mutations/StoreNoticeMutator.php | 33 + .../src/GraphQL/Mutations/TagMutator.php | 20 + .../Mutations/TermsConditionsMutator.php | 32 + .../src/GraphQL/Mutations/TypeMutator.php | 20 + .../src/GraphQL/Mutations/UploadMutator.php | 16 + .../src/GraphQL/Mutations/WishlistMutator.php | 26 + .../GraphQL/Mutations/WithdrawMutation.php | 20 + .../src/GraphQL/Queries/AnalyticsQuery.php | 45 + .../GraphQL/Queries/AttributesValueQuery.php | 16 + .../src/GraphQL/Queries/AuthorQuery.php | 20 + .../src/GraphQL/Queries/BecameSellerQuery.php | 16 + .../marvel/src/GraphQL/Queries/CardQuery.php | 15 + .../src/GraphQL/Queries/ConversationQuery.php | 16 + .../src/GraphQL/Queries/CouponQuery.php | 15 + .../marvel/src/GraphQL/Queries/FaqQuery.php | 16 + .../src/GraphQL/Queries/FlashSaleQuery.php | 23 + .../GraphQL/Queries/FlashSaleRequestQuery.php | 19 + .../src/GraphQL/Queries/ManufacturerQuery.php | 16 + .../src/GraphQL/Queries/MessageQuery.php | 16 + .../src/GraphQL/Queries/NotifyLogQuery.php | 16 + .../marvel/src/GraphQL/Queries/OrderQuery.php | 21 + .../Queries/OwnershipTransferQuery.php | 23 + .../GraphQL/Queries/PaymentIntentQuery.php | 15 + .../src/GraphQL/Queries/ProductQuery.php | 38 + .../src/GraphQL/Queries/QuestionQuery.php | 16 + .../src/GraphQL/Queries/RefundPolicyQuery.php | 16 + .../src/GraphQL/Queries/RefundQuery.php | 16 + .../src/GraphQL/Queries/RefundReasonQuery.php | 16 + .../src/GraphQL/Queries/SettingsQuery.php | 16 + .../marvel/src/GraphQL/Queries/ShopQuery.php | 30 + .../src/GraphQL/Queries/StoreNoticeQuery.php | 27 + .../GraphQL/Queries/TermsConditionsQuery.php | 16 + .../marvel/src/GraphQL/Queries/UserQuery.php | 41 + .../src/GraphQL/Queries/WithdrawQuery.php | 21 + .../marvel/src/GraphQL/Schema/common.graphql | 89 + .../GraphQL/Schema/custom-directives.graphql | 8 + .../Schema/models/abusive_reports.graphql | 44 + .../src/GraphQL/Schema/models/address.graphql | 38 + .../src/GraphQL/Schema/models/ai.graphql | 13 + .../GraphQL/Schema/models/analytics.graphql | 112 + .../GraphQL/Schema/models/attribute.graphql | 56 + .../Schema/models/attribute_value.graphql | 41 + .../src/GraphQL/Schema/models/author.graphql | 71 + .../Schema/models/became_seller.graphql | 211 + .../src/GraphQL/Schema/models/card.graphql | 37 + .../GraphQL/Schema/models/category.graphql | 68 + .../GraphQL/Schema/models/checkout.graphql | 21 + .../src/GraphQL/Schema/models/contact.graphql | 22 + .../Schema/models/conversation.graphql | 33 + .../src/GraphQL/Schema/models/coupon.graphql | 133 + .../Schema/models/delivery_time.graphql | 51 + .../src/GraphQL/Schema/models/faqs.graphql | 71 + .../GraphQL/Schema/models/feedback.graphql | 16 + .../GraphQL/Schema/models/flash_sale.graphql | 108 + .../Schema/models/flash_sale_requests.graphql | 74 + .../GraphQL/Schema/models/languages.graphql | 40 + .../Schema/models/manufacturer.graphql | 77 + .../src/GraphQL/Schema/models/message.graphql | 40 + .../GraphQL/Schema/models/notify_log.graphql | 46 + .../src/GraphQL/Schema/models/order.graphql | 205 + .../Schema/models/ownership_transfer.graphql | 77 + .../Schema/models/payment_intent.graphql | 31 + .../src/GraphQL/Schema/models/product.graphql | 391 + .../src/GraphQL/Schema/models/profile.graphql | 46 + .../GraphQL/Schema/models/question.graphql | 54 + .../src/GraphQL/Schema/models/refund.graphql | 65 + .../Schema/models/refund_policy.graphql | 74 + .../Schema/models/refund_reason.graphql | 48 + .../src/GraphQL/Schema/models/review.graphql | 57 + .../GraphQL/Schema/models/settings.graphql | 366 + .../GraphQL/Schema/models/shipping.graphql | 50 + .../src/GraphQL/Schema/models/shop.graphql | 251 + .../Schema/models/store_notice.graphql | 111 + .../src/GraphQL/Schema/models/tag.graphql | 56 + .../GraphQL/Schema/models/tax_class.graphql | 65 + .../Schema/models/terms_conditions.graphql | 84 + .../src/GraphQL/Schema/models/type.graphql | 212 + .../src/GraphQL/Schema/models/upload.graphql | 5 + .../src/GraphQL/Schema/models/user.graphql | 291 + .../GraphQL/Schema/models/wishlist.graphql | 21 + .../GraphQL/Schema/models/withdraw.graphql | 54 + .../marvel/src/GraphQL/Schema/schema.graphql | 16 + .../marvel/src/Helpers/ResourceHelpers.php | 60 + packages/marvel/src/Helpers/helpers.php | 193 + .../Controllers/AbusiveReportController.php | 123 + .../Http/Controllers/AddressController.php | 107 + .../src/Http/Controllers/AiController.php | 20 + .../Http/Controllers/AnalyticsController.php | 666 + .../Http/Controllers/AttachmentController.php | 111 + .../Http/Controllers/AttributeController.php | 230 + .../Controllers/AttributeValueController.php | 133 + .../src/Http/Controllers/AuthorController.php | 163 + .../Controllers/BecameSellerController.php | 127 + .../Http/Controllers/CategoryController.php | 180 + .../Http/Controllers/CheckoutController.php | 32 + .../Controllers/ConversationController.php | 94 + .../src/Http/Controllers/CoreController.php | 15 + .../src/Http/Controllers/CouponController.php | 233 + .../Controllers/DeliveryTimeController.php | 103 + .../Http/Controllers/DownloadController.php | 120 + .../src/Http/Controllers/FaqsController.php | 206 + .../Http/Controllers/FeedbackController.php | 120 + .../Http/Controllers/FlashSaleController.php | 211 + .../FlashSaleVendorRequestController.php | 259 + .../Http/Controllers/LanguageController.php | 96 + .../Controllers/ManufacturerController.php | 161 + .../Http/Controllers/MessageController.php | 135 + .../Http/Controllers/NotifyLogsController.php | 165 + .../src/Http/Controllers/OrderController.php | 478 + .../OwnershipTransferController.php | 161 + .../Controllers/PaymentIntentController.php | 44 + .../Controllers/PaymentMethodController.php | 163 + .../Http/Controllers/ProductController.php | 808 + .../Http/Controllers/ProfileController.php | 94 + .../Http/Controllers/QuestionController.php | 145 + .../src/Http/Controllers/RefundController.php | 212 + .../Controllers/RefundPolicyController.php | 157 + .../Controllers/RefundReasonController.php | 132 + .../Http/Controllers/ResourceController.php | 103 + .../src/Http/Controllers/ReviewController.php | 136 + .../Http/Controllers/SettingsController.php | 141 + .../Http/Controllers/ShippingController.php | 98 + .../src/Http/Controllers/ShopController.php | 455 + .../Controllers/StoreNoticeController.php | 234 + .../src/Http/Controllers/TagController.php | 123 + .../src/Http/Controllers/TaxController.php | 94 + .../TermsAndConditionsController.php | 229 + .../src/Http/Controllers/TypeController.php | 118 + .../src/Http/Controllers/UserController.php | 811 + .../Http/Controllers/WebHookController.php | 58 + .../Http/Controllers/WishlistController.php | 128 + .../Http/Controllers/WithdrawController.php | 172 + .../Http/Middleware/EnsureEmailIsVerified.php | 41 + .../AbusiveReportAcceptOrRejectRequest.php | 40 + .../Requests/AbusiveReportCreateRequest.php | 41 + .../src/Http/Requests/AddressRequest.php | 43 + .../Http/Requests/AiDescriptionRequest.php | 40 + .../src/Http/Requests/AttachmentRequest.php | 40 + .../src/Http/Requests/AttributeRequest.php | 42 + .../Http/Requests/AttributeValueRequest.php | 42 + .../src/Http/Requests/AuthorRequest.php | 46 + .../Http/Requests/BecameSellersRequest.php | 43 + .../Http/Requests/CategoryCreateRequest.php | 66 + .../Http/Requests/CategoryUpdateRequest.php | 63 + .../Http/Requests/ChangePasswordRequest.php | 39 + .../Http/Requests/CheckoutVerifyRequest.php | 66 + .../Requests/ConversationCreateRequest.php | 39 + .../src/Http/Requests/CouponRequest.php | 76 + .../src/Http/Requests/CreateFaqsRequest.php | 42 + .../Http/Requests/CreateFlashSaleRequest.php | 47 + .../Http/Requests/CreateShippingRequest.php | 42 + .../src/Http/Requests/CreateTaxRequest.php | 47 + .../CreateTermsAndConditionsRequest.php | 41 + .../Requests/CreateVendorFlashSaleRequest.php | 42 + .../src/Http/Requests/DeliveryTimeRequest.php | 44 + .../Http/Requests/FeedbackCreateRequest.php | 52 + .../Http/Requests/FeedbackUpdateRequest.php | 52 + .../src/Http/Requests/LanguageRequest.php | 42 + .../src/Http/Requests/LicenseRequest.php | 37 + .../src/Http/Requests/ManufacturerRequest.php | 47 + .../Http/Requests/MessageCreateRequest.php | 39 + .../src/Http/Requests/OrderCreateRequest.php | 58 + .../src/Http/Requests/OrderUpdateRequest.php | 68 + .../Requests/PaymentMethodCreateRequest.php | 48 + .../Http/Requests/ProductCreateRequest.php | 90 + .../Http/Requests/ProductUpdateRequest.php | 84 + .../src/Http/Requests/ProfileRequest.php | 42 + .../Http/Requests/QuestionCreateRequest.php | 41 + .../Http/Requests/QuestionUpdateRequest.php | 39 + .../Requests/RefundReasonCreateRequest.php | 53 + .../Requests/RefundReasonUpdateRequest.php | 53 + .../src/Http/Requests/RefundRequest.php | 42 + .../Http/Requests/ResourceCreateRequest.php | 47 + .../Http/Requests/ResourceUpdateRequest.php | 47 + .../src/Http/Requests/ReviewCreateRequest.php | 45 + .../src/Http/Requests/ReviewUpdateRequest.php | 41 + .../src/Http/Requests/SettingsRequest.php | 38 + .../src/Http/Requests/ShopCreateRequest.php | 49 + .../src/Http/Requests/ShopUpdateRequest.php | 45 + .../src/Http/Requests/StoreNoticeRequest.php | 93 + .../Requests/StoreNoticeUpdateRequest.php | 93 + .../Requests/StoreRefundPolicyRequest.php | 47 + .../src/Http/Requests/TagCreateRequest.php | 62 + .../src/Http/Requests/TagUpdateRequest.php | 60 + .../Requests/TransferShopOwnerShipRequest.php | 41 + .../marvel/src/Http/Requests/TypeRequest.php | 43 + .../src/Http/Requests/UpdateCouponRequest.php | 82 + .../src/Http/Requests/UpdateFaqsRequest.php | 47 + .../Http/Requests/UpdateFlashSaleRequest.php | 51 + .../Requests/UpdateRefundPolicyRequest.php | 47 + .../Http/Requests/UpdateShippingRequest.php | 42 + .../src/Http/Requests/UpdateTaxRequest.php | 47 + .../UpdateTermsAndConditionsRequest.php | 47 + .../Requests/UpdateVendorFlashSaleRequest.php | 47 + .../Http/Requests/UpdateWithdrawRequest.php | 51 + .../src/Http/Requests/UserCreateRequest.php | 66 + .../src/Http/Requests/UserUpdateRequest.php | 61 + .../src/Http/Requests/WebHookRequest.php | 0 .../Http/Requests/WishlistCreateRequest.php | 40 + .../src/Http/Requests/WithdrawRequest.php | 44 + .../src/Http/Resources/AttributeResource.php | 28 + .../Http/Resources/AttributeValueResource.php | 27 + .../src/Http/Resources/AuthorResource.php | 35 + .../src/Http/Resources/BannerResource.php | 25 + .../src/Http/Resources/CategoryResource.php | 35 + .../Resources/ChildrenCategoryResource.php | 27 + .../Http/Resources/ConversationResource.php | 40 + .../ConversationResourceCollection.php | 22 + .../src/Http/Resources/CouponResource.php | 36 + .../marvel/src/Http/Resources/FaqResource.php | 29 + .../src/Http/Resources/FlashSaleResource.php | 38 + .../marvel/src/Http/Resources/GetResource.php | 24 + .../Resources/GetSingleRefundResource.php | 75 + .../GetSingleStoreNoticeResource.php | 36 + .../Http/Resources/ManufacturerResource.php | 33 + .../src/Http/Resources/MessageResource.php | 32 + .../Resources/MessageResourceCollection.php | 22 + .../Resources/OwnershipTransferResource.php | 80 + .../Http/Resources/RefundPolicyResource.php | 31 + .../src/Http/Resources/RefundResource.php | 37 + .../marvel/src/Http/Resources/Resource.php | 21 + .../src/Http/Resources/ShopResource.php | 36 + .../Http/Resources/ShopResourceCollection.php | 19 + .../Http/Resources/StoreNoticeResource.php | 50 + .../marvel/src/Http/Resources/TagResource.php | 30 + .../Http/Resources/TermsConditionResource.php | 31 + .../src/Http/Resources/TypeResource.php | 30 + .../src/Http/Resources/UserResource.php | 28 + .../Http/Resources/UserResourceCollection.php | 19 + .../product/GetSingleProductResource.php | 66 + .../Resources/product/ProductResource.php | 40 + .../product/RelatedProductResource.php | 33 + .../src/Jobs/SendConversationReminder.php | 50 + .../marvel/src/Listeners/AppDataListener.php | 41 + .../src/Listeners/CheckAndSetDefaultCard.php | 38 + .../CommissionRateUpdateListener.php | 51 + .../Listeners/DigitalProductNotifyLogs.php | 118 + .../src/Listeners/FlashSaleProductProcess.php | 245 + .../src/Listeners/MaintenanceNotification.php | 69 + .../src/Listeners/ManageProductInventory.php | 63 + .../MessageParticipantNotification.php | 27 + ...OwnershipTransferStatusControlListener.php | 105 + .../Listeners/ProductInventoryDecrement.php | 91 + .../src/Listeners/ProductInventoryRestore.php | 78 + .../ProductReviewApprovedListener.php | 22 + .../ProductReviewRejectedListener.php | 22 + .../marvel/src/Listeners/RatingRemoved.php | 30 + .../SendRefundRequestedNotification.php | 40 + .../Refund/SendRefundUpdateNotification.php | 38 + .../src/Listeners/SendMessageNotification.php | 64 + .../SendOrderCancelledNotification.php | 62 + .../SendOrderCreationNotification.php | 39 + .../SendOrderDeliveredNotification.php | 51 + .../SendOrderReceivedNotification.php | 28 + .../SendOrderStatusChangedNotification.php | 49 + .../SendPaymentFailedNotification.php | 40 + .../SendPaymentSuccessNotification.php | 42 + .../SendQuestionAnsweredNotification.php | 30 + .../src/Listeners/SendReviewNotification.php | 33 + .../src/Listeners/ShopMaintenanceListener.php | 68 + .../src/Listeners/StoreNoticeListener.php | 43 + .../StoredMessagedNotifyLogsListener.php | 67 + .../StoredOrderNotifyLogsListener.php | 64 + .../StoredStoreNoticeNotifyLogsListener.php | 47 + .../TransferredShopOwnershipNotification.php | 55 + .../src/Mail/AdminCommissionRateUpdate.php | 42 + packages/marvel/src/Mail/ContactAdmin.php | 35 + packages/marvel/src/Mail/ForgetPassword.php | 35 + .../src/Mail/VendorCommissionRateUpdate.php | 42 + .../DigitalProductUpdateNotification.php | 79 + .../src/Notifications/MaintenanceReminder.php | 75 + .../src/Notifications/MessageReminder.php | 67 + .../src/Notifications/NewOrderProcessed.php | 69 + .../src/Notifications/NewOrderReceived.php | 80 + .../src/Notifications/NewReviewCreated.php | 70 + .../Notifications/NotifyQuestionAnswered.php | 71 + .../OrderCancelledNotification.php | 72 + .../OrderDeliveredNotification.php | 70 + .../Notifications/OrderPlacedSuccessfully.php | 75 + .../OrderStatusChangedNotification.php | 71 + .../PaymentFailedNotification.php | 71 + .../PaymentSuccessfulNotification.php | 71 + .../ProductApprovedNotification.php | 68 + .../ProductRejectedNotification.php | 68 + .../src/Notifications/RefundRequested.php | 90 + .../marvel/src/Notifications/RefundUpdate.php | 93 + .../ShopMaintenanceNotification.php | 81 + .../Notifications/StoreNoticeNotification.php | 77 + .../TransferredShopOwnership.php | 92 + .../TransferredShopOwnershipStatus.php | 92 + .../src/Otp/Gateways/MessagebirdGateway.php | 78 + .../marvel/src/Otp/Gateways/OtpGateway.php | 34 + .../marvel/src/Otp/Gateways/TwilioGateway.php | 111 + packages/marvel/src/Otp/OtpInterface.php | 36 + packages/marvel/src/Otp/Result.php | 66 + packages/marvel/src/Payment/Base.php | 16 + packages/marvel/src/Payment/Flutterwave.php | 222 + packages/marvel/src/Payment/Iyzico.php | 305 + packages/marvel/src/Payment/Mollie.php | 203 + packages/marvel/src/Payment/Payment.php | 128 + .../marvel/src/Payment/PaymentInterface.php | 26 + packages/marvel/src/Payment/Paymongo.php | 220 + packages/marvel/src/Payment/Paypal.php | 251 + packages/marvel/src/Payment/Paystack.php | 200 + packages/marvel/src/Payment/Razorpay.php | 211 + packages/marvel/src/Payment/Stripe.php | 397 + .../src/Providers/EventServiceProvider.php | 172 + .../src/Providers/GraphQLServiceProvider.php | 30 + .../MarvelBroadcastServiceProvider.php | 26 + .../src/Providers/RestAPIServiceProvider.php | 25 + .../WhereConditionsServiceProvider.php | 105 + packages/marvel/src/Rest/Channel.php | 37 + packages/marvel/src/Rest/Routes.php | 532 + packages/marvel/src/Shop.php | 31 + packages/marvel/src/ShopServiceProvider.php | 316 + .../src/Traits/CalculatePaymentTrait.php | 71 + packages/marvel/src/Traits/ENVSetupTrait.php | 47 + packages/marvel/src/Traits/Excludable.php | 27 + packages/marvel/src/Traits/Helper.php | 21 + .../src/Traits/OrderManagementTrait.php | 57 + packages/marvel/src/Traits/OrderSmsTrait.php | 149 + .../OrderStatusManagerWithPaymentTrait.php | 328 + .../PaymentStatusManagerWithOrderTrait.php | 375 + packages/marvel/src/Traits/PaymentTrait.php | 370 + packages/marvel/src/Traits/SmsTrait.php | 168 + .../marvel/src/Traits/StoreNoticeable.php | 67 + .../marvel/src/Traits/TranslationTrait.php | 93 + packages/marvel/src/Traits/UsersTrait.php | 19 + packages/marvel/src/Traits/WalletsTrait.php | 62 + packages/marvel/stubs/resources/css/app.css | 0 .../stubs/resources/fonts/SolaimanLipi.ttf | Bin 0 -> 249656 bytes packages/marvel/stubs/resources/js/app.js | 1 + .../marvel/stubs/resources/js/bootstrap.js | 28 + .../marvel/stubs/resources/lang/de/common.php | 6 + .../stubs/resources/lang/de/message.php | 4 + .../marvel/stubs/resources/lang/de/order.php | 76 + .../marvel/stubs/resources/lang/de/sms.php | 111 + .../marvel/stubs/resources/lang/en/common.php | 6 + .../stubs/resources/lang/en/message.php | 4 + .../marvel/stubs/resources/lang/en/sms.php | 110 + .../views/emails/contact-admin.blade.php | 10 + .../views/emails/forget-password.blade.php | 10 + .../emails/maintenance/reminder.blade.php | 10 + .../maintenance/shop-maintenance.blade.php | 15 + .../emails/order/order-cancelled.blade.php | 15 + .../emails/order/order-delivered.blade.php | 15 + .../emails/order/order-invoice.blade.php | 360 + .../emails/order/order-processed.blade.php | 15 + .../emails/order/order-received.blade.php | 22 + .../order/order-status-changed.blade.php | 20 + .../views/emails/order/placed.blade.php | 15 + .../views/emails/ownership/reminder.blade.php | 19 + .../views/emails/ownership/status.blade.php | 19 + .../emails/payment/payment-failed.blade.php | 14 + .../payment/payment-successful.blade.php | 14 + .../emails/refund/refund-requested.blade.php | 25 + .../emails/refund/refund-updated.blade.php | 25 + .../views/pdf/order-invoice.blade.php | 399 + .../products/digital_product/update.blade.php | 15 + .../marvel/stubs/seeders/DemoDataSeeders.php | 82 + .../marvel/stubs/sql/chawkbazar/address.sql | 50 + .../stubs/sql/chawkbazar/attachments.sql | 324 + .../sql/chawkbazar/attribute_product.sql | 99 + .../stubs/sql/chawkbazar/attribute_values.sql | 11 + .../stubs/sql/chawkbazar/attributes.sql | 3 + .../marvel/stubs/sql/chawkbazar/balances.sql | 3 + .../stubs/sql/chawkbazar/became_sellers.sql | 16 + .../stubs/sql/chawkbazar/categories.sql | 117 + .../stubs/sql/chawkbazar/category_product.sql | 95 + .../stubs/sql/chawkbazar/commissions.sql | 39 + .../marvel/stubs/sql/chawkbazar/coupons.sql | 247 + .../marvel/stubs/sql/chawkbazar/media.sql | 324 + .../sql/chawkbazar/model_has_permissions.sql | 7 + .../stubs/sql/chawkbazar/model_has_roles.sql | 5 + .../stubs/sql/chawkbazar/order_product.sql | 420 + .../marvel/stubs/sql/chawkbazar/orders.sql | 1088 + .../stubs/sql/chawkbazar/permissions.sql | 35 + .../stubs/sql/chawkbazar/product_tag.sql | 153 + .../marvel/stubs/sql/chawkbazar/products.sql | 1682 ++ .../sql/chawkbazar/role_has_permissions.sql | 9 + .../marvel/stubs/sql/chawkbazar/roles.sql | 35 + .../marvel/stubs/sql/chawkbazar/settings.sql | 2 + .../stubs/sql/chawkbazar/shipping_classes.sql | 3 + .../marvel/stubs/sql/chawkbazar/shops.sql | 180 + packages/marvel/stubs/sql/chawkbazar/tags.sql | 90 + .../stubs/sql/chawkbazar/tax_classes.sql | 3 + .../sql/chawkbazar/terms_and_conditions.sql | 225 + .../marvel/stubs/sql/chawkbazar/types.sql | 17 + .../stubs/sql/chawkbazar/user_profiles.sql | 30 + .../marvel/stubs/sql/chawkbazar/users.sql | 60 + .../sql/chawkbazar/variation_options.sql | 101 + .../marvel/stubs/sql/chawkbazar/withdraws.sql | 5 + phpunit.xml | 31 + public/.htaccess | 21 + public/css/app.css | 0 public/favicon.ico | 0 public/index.php | 55 + public/js/app.js | 19441 ++++++++++++++++ public/mix-manifest.json | 4 + public/robots.txt | 2 + public/sql/address.sql | 50 + public/sql/attachments.sql | 324 + public/sql/attribute_product.sql | 99 + public/sql/attribute_values.sql | 11 + public/sql/attributes.sql | 3 + public/sql/balances.sql | 3 + public/sql/became_sellers.sql | 16 + public/sql/categories.sql | 117 + public/sql/category_product.sql | 95 + public/sql/commissions.sql | 39 + public/sql/coupons.sql | 247 + public/sql/media.sql | 324 + public/sql/model_has_permissions.sql | 7 + public/sql/model_has_roles.sql | 5 + public/sql/order_product.sql | 420 + public/sql/orders.sql | 1088 + public/sql/permissions.sql | 35 + public/sql/product_tag.sql | 153 + public/sql/products.sql | 1682 ++ public/sql/role_has_permissions.sql | 9 + public/sql/roles.sql | 35 + public/sql/settings.sql | 2 + public/sql/shipping_classes.sql | 3 + public/sql/shops.sql | 180 + public/sql/tags.sql | 90 + public/sql/tax_classes.sql | 3 + public/sql/terms_and_conditions.sql | 225 + public/sql/types.sql | 17 + public/sql/user_profiles.sql | 30 + public/sql/users.sql | 60 + public/sql/variation_options.sql | 101 + public/sql/withdraws.sql | 5 + public/vendor/telescope/app-dark.css | 8 + public/vendor/telescope/app.css | 7 + public/vendor/telescope/app.js | 2 + public/vendor/telescope/favicon.ico | Bin 0 -> 26622 bytes public/vendor/telescope/mix-manifest.json | 5 + public/web.config | 28 + resources/css/app.css | 0 resources/fonts/SolaimanLipi.ttf | Bin 0 -> 249656 bytes resources/js/app.js | 1 + resources/js/bootstrap.js | 28 + resources/lang/de/common.php | 6 + resources/lang/de/message.php | 4 + resources/lang/de/order.php | 76 + resources/lang/de/sms.php | 111 + resources/lang/en/common.php | 6 + resources/lang/en/message.php | 4 + resources/lang/en/sms.php | 110 + .../views/emails/contact-admin.blade.php | 10 + .../views/emails/forget-password.blade.php | 10 + .../emails/maintenance/reminder.blade.php | 10 + .../maintenance/shop-maintenance.blade.php | 15 + .../views/emails/message/reminder.blade.php | 11 + .../admin-commission-rate-update.blade.php | 17 + .../emails/order/order-cancelled.blade.php | 15 + .../emails/order/order-delivered.blade.php | 15 + .../emails/order/order-invoice.blade.php | 360 + .../emails/order/order-processed.blade.php | 15 + .../emails/order/order-received.blade.php | 22 + .../order/order-status-changed.blade.php | 20 + resources/views/emails/order/placed.blade.php | 15 + .../vendor-commission-rate-update.blade.php | 17 + .../views/emails/ownership/reminder.blade.php | 19 + .../views/emails/ownership/status.blade.php | 19 + .../emails/payment/payment-failed.blade.php | 14 + .../payment/payment-successful.blade.php | 14 + .../emails/product/product-approved.blade.php | 14 + .../emails/product/product-rejected.blade.php | 14 + .../views/emails/question/answered.blade.php | 13 + .../emails/refund/refund-requested.blade.php | 25 + .../emails/refund/refund-updated.blade.php | 25 + .../views/emails/review/created.blade.php | 14 + .../emails/storeNotice/storeNotice.blade.php | 20 + resources/views/pdf/order-invoice.blade.php | 399 + .../products/digital_product/update.blade.php | 20 + resources/views/welcome.blade.php | 79 + routes/api.php | 19 + routes/channels.php | 18 + routes/console.php | 19 + routes/web.php | 18 + server.php | 21 + storage/app/.gitignore | 3 + storage/app/public/.gitignore | 2 + storage/framework/.gitignore | 9 + storage/framework/sessions/.gitignore | 2 + storage/framework/testing/.gitignore | 2 + storage/framework/views/.gitignore | 2 + storage/logs/.gitignore | 2 + tests/CreatesApplication.php | 22 + tests/Feature/ExampleTest.php | 21 + tests/TestCase.php | 10 + tests/Unit/ExampleTest.php | 18 + webpack.mix.js | 17 + yarn.lock | 7112 ++++++ 835 files changed, 106481 insertions(+) create mode 100644 .editorconfig create mode 100644 .env.example create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .styleci.yml create mode 100644 Dockerfile create mode 100644 app/Console/Kernel.php create mode 100644 app/Exceptions/Handler.php create mode 100644 app/Http/Controllers/Controller.php create mode 100644 app/Http/Kernel.php create mode 100644 app/Http/Middleware/Authenticate.php create mode 100644 app/Http/Middleware/EncryptCookies.php create mode 100644 app/Http/Middleware/PreventRequestsDuringMaintenance.php create mode 100644 app/Http/Middleware/RedirectIfAuthenticated.php create mode 100644 app/Http/Middleware/TrimStrings.php create mode 100644 app/Http/Middleware/TrustHosts.php create mode 100644 app/Http/Middleware/TrustProxies.php create mode 100644 app/Http/Middleware/VerifyCsrfToken.php create mode 100644 app/Models/User.php create mode 100644 app/Providers/AppServiceProvider.php create mode 100644 app/Providers/AuthServiceProvider.php create mode 100644 app/Providers/BroadcastServiceProvider.php create mode 100644 app/Providers/EventServiceProvider.php create mode 100644 app/Providers/RouteServiceProvider.php create mode 100644 artisan create mode 100644 bootstrap/app.php create mode 100644 bootstrap/cache/.gitignore create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 config/app.php create mode 100644 config/auth.php create mode 100644 config/broadcasting.php create mode 100644 config/cache.php create mode 100644 config/cors.php create mode 100644 config/database.php create mode 100644 config/filesystems.php create mode 100644 config/flutterwave.php create mode 100644 config/hashing.php create mode 100644 config/logging.php create mode 100644 config/mail.php create mode 100644 config/money.php create mode 100644 config/pdf.php create mode 100644 config/purify.php create mode 100644 config/queue.php create mode 100644 config/services.php create mode 100644 config/session.php create mode 100644 config/sluggable.php create mode 100644 config/view.php create mode 100644 database/.gitignore create mode 100644 database/factories/UserFactory.php create mode 100644 database/migrations/2014_10_12_000000_create_users_table.php create mode 100644 database/migrations/2014_10_12_100000_create_password_resets_table.php create mode 100644 database/migrations/2019_08_19_000000_create_failed_jobs_table.php create mode 100644 database/migrations/2022_04_11_094659_create_jobs_table.php create mode 100644 database/seeders/DatabaseSeeder.php create mode 100644 install.sh create mode 100644 lang/en/auth.php create mode 100644 lang/en/pagination.php create mode 100644 lang/en/passwords.php create mode 100644 lang/en/validation.php create mode 100644 package.json create mode 100644 packages/marvel/.gitignore create mode 100644 packages/marvel/.styleci.yml create mode 100644 packages/marvel/composer.json create mode 100644 packages/marvel/config/auth.php create mode 100644 packages/marvel/config/broadcasting.php create mode 100644 packages/marvel/config/cache.php create mode 100644 packages/marvel/config/constants.php create mode 100644 packages/marvel/config/cors.php create mode 100644 packages/marvel/config/flutterwave.php create mode 100644 packages/marvel/config/graphiql.php create mode 100644 packages/marvel/config/graphql-playground.php create mode 100644 packages/marvel/config/laravel-omnipay.php create mode 100644 packages/marvel/config/lighthouse.php create mode 100644 packages/marvel/config/media-library.php create mode 100644 packages/marvel/config/newsletter.php create mode 100644 packages/marvel/config/paystack.php create mode 100644 packages/marvel/config/permission.php create mode 100644 packages/marvel/config/repository.php create mode 100644 packages/marvel/config/sanctum.php create mode 100644 packages/marvel/config/scout.php create mode 100644 packages/marvel/config/services.php create mode 100644 packages/marvel/config/shop.php create mode 100644 packages/marvel/config/sluggable.php create mode 100644 packages/marvel/config/sslcommerz.php create mode 100644 packages/marvel/database/migrations/2020_04_17_194830_create_permission_tables.php create mode 100644 packages/marvel/database/migrations/2020_06_02_051901_create_marvel_tables.php create mode 100644 packages/marvel/database/migrations/2020_10_26_163529_create_media_table.php create mode 100644 packages/marvel/database/migrations/2021_04_17_051901_create_new_marvel_tables.php create mode 100644 packages/marvel/database/migrations/2021_08_08_051901_create_wallet_table.php create mode 100644 packages/marvel/database/migrations/2021_09_26_051901_create_product_type_table.php create mode 100644 packages/marvel/database/migrations/2021_10_12_193855_create_reviews_table.php create mode 100644 packages/marvel/database/migrations/2022_01_19_051901_create_rental_tables.php create mode 100644 packages/marvel/database/migrations/2022_01_31_051901_create_marvel_languages_tables.php create mode 100644 packages/marvel/database/migrations/2022_03_23_051901_create_marvel_delivery_time_tables.php create mode 100644 packages/marvel/database/migrations/2022_03_23_051902_create_marvel_store_notice_tables.php create mode 100644 packages/marvel/database/migrations/2022_03_24_124527_add_columns_to_table.php create mode 100644 packages/marvel/database/migrations/2022_05_09_070829_create_messages_table.php create mode 100644 packages/marvel/database/migrations/2023_05_10_154638_add_column_to_order_table.php create mode 100644 packages/marvel/database/migrations/2023_07_12_030502_create_notify_logs_table.php create mode 100644 packages/marvel/database/migrations/2023_07_19_162433_create_faqs_table.php create mode 100644 packages/marvel/database/migrations/2023_07_25_053633_create_terms_and_conditions_table.php create mode 100644 packages/marvel/database/migrations/2023_08_10_161757_add_sold_quantity_column_to_products_table.php create mode 100644 packages/marvel/database/migrations/2023_08_14_173253_create_flash_sales_table.php create mode 100644 packages/marvel/database/migrations/2023_08_15_061447_add_is_featured_column_to_products_table.php create mode 100644 packages/marvel/database/migrations/2023_08_28_114418_create_refund_policies_table.php create mode 100644 packages/marvel/database/migrations/2023_09_07_061715_create_refund_reasons_table.php create mode 100644 packages/marvel/database/migrations/2023_10_19_055742_add_note_column_to_flash_sale_requests_table.php create mode 100644 packages/marvel/database/migrations/2023_11_28_090210_add_new_two_column_to_coupons_table.php create mode 100644 packages/marvel/database/migrations/2023_12_12_162216_create_became_sellers_table.php create mode 100644 packages/marvel/database/migrations/2024_01_02_063637_create_transfer_history_table.php create mode 100644 packages/marvel/database/migrations/2024_02_07_162216_create_commissions_table.php create mode 100644 packages/marvel/license.md create mode 100644 packages/marvel/phpunit.xml create mode 100644 packages/marvel/readme.md create mode 100644 packages/marvel/src/Ai/Ai.php create mode 100644 packages/marvel/src/Ai/AiInterface.php create mode 100644 packages/marvel/src/Ai/Base.php create mode 100644 packages/marvel/src/Ai/Openai.php create mode 100644 packages/marvel/src/Console/AWSSetupCommand.php create mode 100644 packages/marvel/src/Console/AdminCreateCommand.php create mode 100644 packages/marvel/src/Console/CopyFilesCommand.php create mode 100644 packages/marvel/src/Console/DatabaseSetupCommand.php create mode 100644 packages/marvel/src/Console/DefaultLanguageSetupCommand.php create mode 100644 packages/marvel/src/Console/ENVSetupCommand.php create mode 100644 packages/marvel/src/Console/FrontendSetupCommand.php create mode 100644 packages/marvel/src/Console/ImportDemoData.php create mode 100644 packages/marvel/src/Console/InstallCommand.php create mode 100644 packages/marvel/src/Console/MailSetupCommand.php create mode 100644 packages/marvel/src/Console/MailchimpNewsletterSetupCommand.php create mode 100644 packages/marvel/src/Console/MarvelInfoCommand.php create mode 100644 packages/marvel/src/Console/MarvelVerification.php create mode 100644 packages/marvel/src/Console/OTPGatewaySetupCommand.php create mode 100644 packages/marvel/src/Console/OpenAiSetupCommand.php create mode 100644 packages/marvel/src/Console/QueueConnectionSetupCommand.php create mode 100644 packages/marvel/src/Console/SettingsDataSeed.php create mode 100644 packages/marvel/src/Console/TestMailSendCommand.php create mode 100644 packages/marvel/src/Console/TranslationEnabledCommand.php create mode 100644 packages/marvel/src/Database/Models/AbusiveReport.php create mode 100644 packages/marvel/src/Database/Models/Address.php create mode 100644 packages/marvel/src/Database/Models/Attachment.php create mode 100644 packages/marvel/src/Database/Models/Attribute.php create mode 100644 packages/marvel/src/Database/Models/AttributeValue.php create mode 100644 packages/marvel/src/Database/Models/Author.php create mode 100644 packages/marvel/src/Database/Models/Availability.php create mode 100644 packages/marvel/src/Database/Models/Balance.php create mode 100644 packages/marvel/src/Database/Models/Banner.php create mode 100644 packages/marvel/src/Database/Models/BecameSeller.php create mode 100644 packages/marvel/src/Database/Models/Category.php create mode 100644 packages/marvel/src/Database/Models/Commission.php create mode 100644 packages/marvel/src/Database/Models/Conversation.php create mode 100644 packages/marvel/src/Database/Models/Coupon.php create mode 100644 packages/marvel/src/Database/Models/DeliveryTime.php create mode 100644 packages/marvel/src/Database/Models/DigitalFile.php create mode 100644 packages/marvel/src/Database/Models/DownloadToken.php create mode 100644 packages/marvel/src/Database/Models/Faqs.php create mode 100644 packages/marvel/src/Database/Models/Feedback.php create mode 100644 packages/marvel/src/Database/Models/FlashSale.php create mode 100644 packages/marvel/src/Database/Models/FlashSaleRequests.php create mode 100644 packages/marvel/src/Database/Models/Language.php create mode 100644 packages/marvel/src/Database/Models/Manufacturer.php create mode 100644 packages/marvel/src/Database/Models/Message.php create mode 100644 packages/marvel/src/Database/Models/NotifyLogs.php create mode 100644 packages/marvel/src/Database/Models/Order.php create mode 100644 packages/marvel/src/Database/Models/OrderWalletPoint.php create mode 100644 packages/marvel/src/Database/Models/OrderedFile.php create mode 100644 packages/marvel/src/Database/Models/OwnershipTransfer.php create mode 100644 packages/marvel/src/Database/Models/Participant.php create mode 100644 packages/marvel/src/Database/Models/PasswordReset.php create mode 100644 packages/marvel/src/Database/Models/PaymentGateway.php create mode 100644 packages/marvel/src/Database/Models/PaymentIntent.php create mode 100644 packages/marvel/src/Database/Models/PaymentMethod.php create mode 100644 packages/marvel/src/Database/Models/Permission.php create mode 100644 packages/marvel/src/Database/Models/Product.php create mode 100644 packages/marvel/src/Database/Models/Profile.php create mode 100644 packages/marvel/src/Database/Models/Provider.php create mode 100644 packages/marvel/src/Database/Models/Question.php create mode 100644 packages/marvel/src/Database/Models/Refund.php create mode 100644 packages/marvel/src/Database/Models/RefundPolicy.php create mode 100644 packages/marvel/src/Database/Models/RefundReason.php create mode 100644 packages/marvel/src/Database/Models/Resource.php create mode 100644 packages/marvel/src/Database/Models/Review.php create mode 100644 packages/marvel/src/Database/Models/Settings.php create mode 100644 packages/marvel/src/Database/Models/Shipping.php create mode 100644 packages/marvel/src/Database/Models/Shop.php create mode 100644 packages/marvel/src/Database/Models/StoreNotice.php create mode 100644 packages/marvel/src/Database/Models/StoreNoticeRead.php create mode 100644 packages/marvel/src/Database/Models/Tag.php create mode 100644 packages/marvel/src/Database/Models/Tax.php create mode 100644 packages/marvel/src/Database/Models/TermsAndConditions.php create mode 100644 packages/marvel/src/Database/Models/Type.php create mode 100644 packages/marvel/src/Database/Models/User.php create mode 100644 packages/marvel/src/Database/Models/Variation.php create mode 100644 packages/marvel/src/Database/Models/Wallet.php create mode 100644 packages/marvel/src/Database/Models/Wishlist.php create mode 100644 packages/marvel/src/Database/Models/Withdraw.php create mode 100644 packages/marvel/src/Database/Repositories/AbusiveReportRepository.php create mode 100644 packages/marvel/src/Database/Repositories/AddressRepository.php create mode 100644 packages/marvel/src/Database/Repositories/AttachmentRepository.php create mode 100644 packages/marvel/src/Database/Repositories/AttributeRepository.php create mode 100644 packages/marvel/src/Database/Repositories/AttributeValueRepository.php create mode 100644 packages/marvel/src/Database/Repositories/AuthorRepository.php create mode 100644 packages/marvel/src/Database/Repositories/AvailabilityRepository.php create mode 100644 packages/marvel/src/Database/Repositories/BaseRepository.php create mode 100644 packages/marvel/src/Database/Repositories/BecameSellersRepository.php create mode 100644 packages/marvel/src/Database/Repositories/CategoryRepository.php create mode 100644 packages/marvel/src/Database/Repositories/CheckoutRepository.php create mode 100644 packages/marvel/src/Database/Repositories/CommissionRepository.php create mode 100644 packages/marvel/src/Database/Repositories/ConversationRepository.php create mode 100644 packages/marvel/src/Database/Repositories/CouponRepository.php create mode 100644 packages/marvel/src/Database/Repositories/DeliveryTimeRepository.php create mode 100644 packages/marvel/src/Database/Repositories/DownloadRepository.php create mode 100644 packages/marvel/src/Database/Repositories/FaqsRepository.php create mode 100644 packages/marvel/src/Database/Repositories/FeedbackRepository.php create mode 100644 packages/marvel/src/Database/Repositories/FlashSaleRepository.php create mode 100644 packages/marvel/src/Database/Repositories/FlashSaleVendorRequestRepository.php create mode 100644 packages/marvel/src/Database/Repositories/LanguageRepository.php create mode 100644 packages/marvel/src/Database/Repositories/ManufacturerRepository.php create mode 100644 packages/marvel/src/Database/Repositories/MessageRepository.php create mode 100644 packages/marvel/src/Database/Repositories/NotifyLogsRepository.php create mode 100644 packages/marvel/src/Database/Repositories/OrderRepository.php create mode 100644 packages/marvel/src/Database/Repositories/OwnershipTransferRepository.php create mode 100644 packages/marvel/src/Database/Repositories/ParticipantRepository.php create mode 100644 packages/marvel/src/Database/Repositories/PaymentIntentRepository.php create mode 100644 packages/marvel/src/Database/Repositories/PaymentMethodRepository.php create mode 100644 packages/marvel/src/Database/Repositories/ProductRepository.php create mode 100644 packages/marvel/src/Database/Repositories/ProfileRepository.php create mode 100644 packages/marvel/src/Database/Repositories/QuestionRepository.php create mode 100644 packages/marvel/src/Database/Repositories/RefundPolicyRepository.php create mode 100644 packages/marvel/src/Database/Repositories/RefundReasonRepository.php create mode 100644 packages/marvel/src/Database/Repositories/RefundRepository.php create mode 100644 packages/marvel/src/Database/Repositories/ResourceRepository.php create mode 100644 packages/marvel/src/Database/Repositories/ReviewRepository.php create mode 100644 packages/marvel/src/Database/Repositories/SettingsRepository.php create mode 100644 packages/marvel/src/Database/Repositories/ShippingRepository.php create mode 100644 packages/marvel/src/Database/Repositories/ShopRepository.php create mode 100644 packages/marvel/src/Database/Repositories/StoreNoticeReadRepository.php create mode 100644 packages/marvel/src/Database/Repositories/StoreNoticeRepository.php create mode 100644 packages/marvel/src/Database/Repositories/TagRepository.php create mode 100644 packages/marvel/src/Database/Repositories/TaxRepository.php create mode 100644 packages/marvel/src/Database/Repositories/TermsAndConditionsRepository.php create mode 100644 packages/marvel/src/Database/Repositories/TypeRepository.php create mode 100644 packages/marvel/src/Database/Repositories/UserRepository.php create mode 100644 packages/marvel/src/Database/Repositories/WishlistRepository.php create mode 100644 packages/marvel/src/Database/Repositories/WithdrawRepository.php create mode 100644 packages/marvel/src/Database/Seeders/FaqSeeder.php create mode 100644 packages/marvel/src/Database/Seeders/MarvelSeeder.php create mode 100644 packages/marvel/src/Database/Seeders/RefundPolicySeeder.php create mode 100644 packages/marvel/src/Database/Seeders/RefundReasonSeeder.php create mode 100644 packages/marvel/src/Database/Seeders/SettingsSeeder.php create mode 100644 packages/marvel/src/Database/Seeders/TermsAndConditionSeeder.php create mode 100644 packages/marvel/src/Enums/AiType.php create mode 100644 packages/marvel/src/Enums/CouponTargetType.php create mode 100644 packages/marvel/src/Enums/CouponType.php create mode 100644 packages/marvel/src/Enums/DefaultStatusType.php create mode 100644 packages/marvel/src/Enums/EventType.php create mode 100644 packages/marvel/src/Enums/FlashSaleType.php create mode 100644 packages/marvel/src/Enums/ManufacturerType.php create mode 100644 packages/marvel/src/Enums/OrderStatus.php create mode 100644 packages/marvel/src/Enums/PaymentGatewayType.php create mode 100644 packages/marvel/src/Enums/PaymentStatus.php create mode 100644 packages/marvel/src/Enums/Permission.php create mode 100644 packages/marvel/src/Enums/ProductStatus.php create mode 100644 packages/marvel/src/Enums/ProductType.php create mode 100644 packages/marvel/src/Enums/ProductVisibilityStatus.php create mode 100644 packages/marvel/src/Enums/RefundPolicyStatus.php create mode 100644 packages/marvel/src/Enums/RefundPolicyTarget.php create mode 100644 packages/marvel/src/Enums/RefundStatus.php create mode 100644 packages/marvel/src/Enums/ResourceType.php create mode 100644 packages/marvel/src/Enums/Role.php create mode 100644 packages/marvel/src/Enums/ShippingType.php create mode 100644 packages/marvel/src/Enums/StoreNoticePriority.php create mode 100644 packages/marvel/src/Enums/StoreNoticeType.php create mode 100644 packages/marvel/src/Enums/WithdrawStatus.php create mode 100644 packages/marvel/src/Events/CommissionRateUpdateEvent.php create mode 100644 packages/marvel/src/Events/DigitalProductUpdateEvent.php create mode 100644 packages/marvel/src/Events/FlashSaleProcessed.php create mode 100644 packages/marvel/src/Events/Maintenance.php create mode 100644 packages/marvel/src/Events/MessageSent.php create mode 100644 packages/marvel/src/Events/OrderCancelled.php create mode 100644 packages/marvel/src/Events/OrderCreated.php create mode 100644 packages/marvel/src/Events/OrderDelivered.php create mode 100644 packages/marvel/src/Events/OrderProcessed.php create mode 100644 packages/marvel/src/Events/OrderReceived.php create mode 100644 packages/marvel/src/Events/OrderStatusChanged.php create mode 100644 packages/marvel/src/Events/OwnershipTransferStatusControl.php create mode 100644 packages/marvel/src/Events/PaymentFailed.php create mode 100644 packages/marvel/src/Events/PaymentMethods.php create mode 100644 packages/marvel/src/Events/PaymentSuccess.php create mode 100644 packages/marvel/src/Events/ProcessOwnershipTransition.php create mode 100644 packages/marvel/src/Events/ProcessUserData.php create mode 100644 packages/marvel/src/Events/ProductReviewApproved.php create mode 100644 packages/marvel/src/Events/ProductReviewRejected.php create mode 100644 packages/marvel/src/Events/QuestionAnswered.php create mode 100644 packages/marvel/src/Events/RefundApproved.php create mode 100644 packages/marvel/src/Events/RefundRequested.php create mode 100644 packages/marvel/src/Events/RefundUpdate.php create mode 100644 packages/marvel/src/Events/ReviewCreated.php create mode 100644 packages/marvel/src/Events/ShopMaintenance.php create mode 100644 packages/marvel/src/Events/StoreNoticeEvent.php create mode 100644 packages/marvel/src/Events/TestPusherEvent.php create mode 100644 packages/marvel/src/Exceptions/MarvelBadRequestException.php create mode 100644 packages/marvel/src/Exceptions/MarvelInvalidArgumentException.php create mode 100644 packages/marvel/src/Exceptions/MarvelNotFoundException.php create mode 100644 packages/marvel/src/Exceptions/PickbazarException.php create mode 100644 packages/marvel/src/Exports/OrderExport.php create mode 100644 packages/marvel/src/Facades/Ai.php create mode 100644 packages/marvel/src/Facades/Payment.php create mode 100644 packages/marvel/src/Facades/Shop.php create mode 100644 packages/marvel/src/GraphQL/Directives/EnsureEmailIsVerifiedDirective.php create mode 100644 packages/marvel/src/GraphQL/Mutations/AbusiveReportMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/AiMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/AttributeMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/AttributeValueMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/AuthMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/AuthorMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/BecameSellerMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/CardMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/CategoryMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/CheckoutMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/ConversationMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/CouponMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/FaqMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/FeedbackMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/FlashSaleMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/FlashSaleRequestsMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/ManufacturerMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/MessageMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/NotifyLogMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/OrderMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/OwnershipMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/PaymentIntentMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/ProductMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/QuestionMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/RefundMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/RefundPolicyMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/RefundReasonMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/ReviewMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/SettingsMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/ShopMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/StoreNoticeMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/TagMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/TermsConditionsMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/TypeMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/UploadMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/WishlistMutator.php create mode 100644 packages/marvel/src/GraphQL/Mutations/WithdrawMutation.php create mode 100644 packages/marvel/src/GraphQL/Queries/AnalyticsQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/AttributesValueQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/AuthorQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/BecameSellerQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/CardQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/ConversationQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/CouponQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/FaqQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/FlashSaleQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/FlashSaleRequestQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/ManufacturerQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/MessageQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/NotifyLogQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/OrderQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/OwnershipTransferQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/PaymentIntentQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/ProductQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/QuestionQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/RefundPolicyQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/RefundQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/RefundReasonQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/SettingsQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/ShopQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/StoreNoticeQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/TermsConditionsQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/UserQuery.php create mode 100644 packages/marvel/src/GraphQL/Queries/WithdrawQuery.php create mode 100644 packages/marvel/src/GraphQL/Schema/common.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/custom-directives.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/abusive_reports.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/address.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/ai.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/analytics.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/attribute.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/attribute_value.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/author.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/became_seller.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/card.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/category.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/checkout.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/contact.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/conversation.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/coupon.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/delivery_time.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/faqs.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/feedback.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/flash_sale.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/flash_sale_requests.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/languages.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/manufacturer.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/message.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/notify_log.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/order.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/ownership_transfer.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/payment_intent.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/product.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/profile.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/question.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/refund.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/refund_policy.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/refund_reason.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/review.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/settings.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/shipping.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/shop.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/store_notice.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/tag.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/tax_class.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/terms_conditions.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/type.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/upload.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/user.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/wishlist.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/models/withdraw.graphql create mode 100644 packages/marvel/src/GraphQL/Schema/schema.graphql create mode 100644 packages/marvel/src/Helpers/ResourceHelpers.php create mode 100644 packages/marvel/src/Helpers/helpers.php create mode 100644 packages/marvel/src/Http/Controllers/AbusiveReportController.php create mode 100644 packages/marvel/src/Http/Controllers/AddressController.php create mode 100644 packages/marvel/src/Http/Controllers/AiController.php create mode 100644 packages/marvel/src/Http/Controllers/AnalyticsController.php create mode 100644 packages/marvel/src/Http/Controllers/AttachmentController.php create mode 100644 packages/marvel/src/Http/Controllers/AttributeController.php create mode 100644 packages/marvel/src/Http/Controllers/AttributeValueController.php create mode 100644 packages/marvel/src/Http/Controllers/AuthorController.php create mode 100644 packages/marvel/src/Http/Controllers/BecameSellerController.php create mode 100644 packages/marvel/src/Http/Controllers/CategoryController.php create mode 100644 packages/marvel/src/Http/Controllers/CheckoutController.php create mode 100644 packages/marvel/src/Http/Controllers/ConversationController.php create mode 100644 packages/marvel/src/Http/Controllers/CoreController.php create mode 100644 packages/marvel/src/Http/Controllers/CouponController.php create mode 100644 packages/marvel/src/Http/Controllers/DeliveryTimeController.php create mode 100644 packages/marvel/src/Http/Controllers/DownloadController.php create mode 100644 packages/marvel/src/Http/Controllers/FaqsController.php create mode 100644 packages/marvel/src/Http/Controllers/FeedbackController.php create mode 100644 packages/marvel/src/Http/Controllers/FlashSaleController.php create mode 100644 packages/marvel/src/Http/Controllers/FlashSaleVendorRequestController.php create mode 100644 packages/marvel/src/Http/Controllers/LanguageController.php create mode 100644 packages/marvel/src/Http/Controllers/ManufacturerController.php create mode 100644 packages/marvel/src/Http/Controllers/MessageController.php create mode 100644 packages/marvel/src/Http/Controllers/NotifyLogsController.php create mode 100644 packages/marvel/src/Http/Controllers/OrderController.php create mode 100644 packages/marvel/src/Http/Controllers/OwnershipTransferController.php create mode 100644 packages/marvel/src/Http/Controllers/PaymentIntentController.php create mode 100644 packages/marvel/src/Http/Controllers/PaymentMethodController.php create mode 100644 packages/marvel/src/Http/Controllers/ProductController.php create mode 100644 packages/marvel/src/Http/Controllers/ProfileController.php create mode 100644 packages/marvel/src/Http/Controllers/QuestionController.php create mode 100644 packages/marvel/src/Http/Controllers/RefundController.php create mode 100644 packages/marvel/src/Http/Controllers/RefundPolicyController.php create mode 100644 packages/marvel/src/Http/Controllers/RefundReasonController.php create mode 100644 packages/marvel/src/Http/Controllers/ResourceController.php create mode 100644 packages/marvel/src/Http/Controllers/ReviewController.php create mode 100644 packages/marvel/src/Http/Controllers/SettingsController.php create mode 100644 packages/marvel/src/Http/Controllers/ShippingController.php create mode 100644 packages/marvel/src/Http/Controllers/ShopController.php create mode 100644 packages/marvel/src/Http/Controllers/StoreNoticeController.php create mode 100644 packages/marvel/src/Http/Controllers/TagController.php create mode 100644 packages/marvel/src/Http/Controllers/TaxController.php create mode 100644 packages/marvel/src/Http/Controllers/TermsAndConditionsController.php create mode 100644 packages/marvel/src/Http/Controllers/TypeController.php create mode 100644 packages/marvel/src/Http/Controllers/UserController.php create mode 100644 packages/marvel/src/Http/Controllers/WebHookController.php create mode 100644 packages/marvel/src/Http/Controllers/WishlistController.php create mode 100644 packages/marvel/src/Http/Controllers/WithdrawController.php create mode 100644 packages/marvel/src/Http/Middleware/EnsureEmailIsVerified.php create mode 100644 packages/marvel/src/Http/Requests/AbusiveReportAcceptOrRejectRequest.php create mode 100644 packages/marvel/src/Http/Requests/AbusiveReportCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/AddressRequest.php create mode 100644 packages/marvel/src/Http/Requests/AiDescriptionRequest.php create mode 100644 packages/marvel/src/Http/Requests/AttachmentRequest.php create mode 100644 packages/marvel/src/Http/Requests/AttributeRequest.php create mode 100644 packages/marvel/src/Http/Requests/AttributeValueRequest.php create mode 100644 packages/marvel/src/Http/Requests/AuthorRequest.php create mode 100644 packages/marvel/src/Http/Requests/BecameSellersRequest.php create mode 100644 packages/marvel/src/Http/Requests/CategoryCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/CategoryUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/ChangePasswordRequest.php create mode 100644 packages/marvel/src/Http/Requests/CheckoutVerifyRequest.php create mode 100644 packages/marvel/src/Http/Requests/ConversationCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/CouponRequest.php create mode 100644 packages/marvel/src/Http/Requests/CreateFaqsRequest.php create mode 100644 packages/marvel/src/Http/Requests/CreateFlashSaleRequest.php create mode 100644 packages/marvel/src/Http/Requests/CreateShippingRequest.php create mode 100644 packages/marvel/src/Http/Requests/CreateTaxRequest.php create mode 100644 packages/marvel/src/Http/Requests/CreateTermsAndConditionsRequest.php create mode 100644 packages/marvel/src/Http/Requests/CreateVendorFlashSaleRequest.php create mode 100644 packages/marvel/src/Http/Requests/DeliveryTimeRequest.php create mode 100644 packages/marvel/src/Http/Requests/FeedbackCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/FeedbackUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/LanguageRequest.php create mode 100644 packages/marvel/src/Http/Requests/LicenseRequest.php create mode 100644 packages/marvel/src/Http/Requests/ManufacturerRequest.php create mode 100644 packages/marvel/src/Http/Requests/MessageCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/OrderCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/OrderUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/PaymentMethodCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/ProductCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/ProductUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/ProfileRequest.php create mode 100644 packages/marvel/src/Http/Requests/QuestionCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/QuestionUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/RefundReasonCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/RefundReasonUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/RefundRequest.php create mode 100644 packages/marvel/src/Http/Requests/ResourceCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/ResourceUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/ReviewCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/ReviewUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/SettingsRequest.php create mode 100644 packages/marvel/src/Http/Requests/ShopCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/ShopUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/StoreNoticeRequest.php create mode 100644 packages/marvel/src/Http/Requests/StoreNoticeUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/StoreRefundPolicyRequest.php create mode 100644 packages/marvel/src/Http/Requests/TagCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/TagUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/TransferShopOwnerShipRequest.php create mode 100644 packages/marvel/src/Http/Requests/TypeRequest.php create mode 100644 packages/marvel/src/Http/Requests/UpdateCouponRequest.php create mode 100644 packages/marvel/src/Http/Requests/UpdateFaqsRequest.php create mode 100644 packages/marvel/src/Http/Requests/UpdateFlashSaleRequest.php create mode 100644 packages/marvel/src/Http/Requests/UpdateRefundPolicyRequest.php create mode 100644 packages/marvel/src/Http/Requests/UpdateShippingRequest.php create mode 100644 packages/marvel/src/Http/Requests/UpdateTaxRequest.php create mode 100644 packages/marvel/src/Http/Requests/UpdateTermsAndConditionsRequest.php create mode 100644 packages/marvel/src/Http/Requests/UpdateVendorFlashSaleRequest.php create mode 100644 packages/marvel/src/Http/Requests/UpdateWithdrawRequest.php create mode 100644 packages/marvel/src/Http/Requests/UserCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/UserUpdateRequest.php create mode 100644 packages/marvel/src/Http/Requests/WebHookRequest.php create mode 100644 packages/marvel/src/Http/Requests/WishlistCreateRequest.php create mode 100644 packages/marvel/src/Http/Requests/WithdrawRequest.php create mode 100644 packages/marvel/src/Http/Resources/AttributeResource.php create mode 100644 packages/marvel/src/Http/Resources/AttributeValueResource.php create mode 100644 packages/marvel/src/Http/Resources/AuthorResource.php create mode 100644 packages/marvel/src/Http/Resources/BannerResource.php create mode 100644 packages/marvel/src/Http/Resources/CategoryResource.php create mode 100644 packages/marvel/src/Http/Resources/ChildrenCategoryResource.php create mode 100644 packages/marvel/src/Http/Resources/ConversationResource.php create mode 100644 packages/marvel/src/Http/Resources/ConversationResourceCollection.php create mode 100644 packages/marvel/src/Http/Resources/CouponResource.php create mode 100644 packages/marvel/src/Http/Resources/FaqResource.php create mode 100644 packages/marvel/src/Http/Resources/FlashSaleResource.php create mode 100644 packages/marvel/src/Http/Resources/GetResource.php create mode 100644 packages/marvel/src/Http/Resources/GetSingleRefundResource.php create mode 100644 packages/marvel/src/Http/Resources/GetSingleStoreNoticeResource.php create mode 100644 packages/marvel/src/Http/Resources/ManufacturerResource.php create mode 100644 packages/marvel/src/Http/Resources/MessageResource.php create mode 100644 packages/marvel/src/Http/Resources/MessageResourceCollection.php create mode 100644 packages/marvel/src/Http/Resources/OwnershipTransferResource.php create mode 100644 packages/marvel/src/Http/Resources/RefundPolicyResource.php create mode 100644 packages/marvel/src/Http/Resources/RefundResource.php create mode 100644 packages/marvel/src/Http/Resources/Resource.php create mode 100644 packages/marvel/src/Http/Resources/ShopResource.php create mode 100644 packages/marvel/src/Http/Resources/ShopResourceCollection.php create mode 100644 packages/marvel/src/Http/Resources/StoreNoticeResource.php create mode 100644 packages/marvel/src/Http/Resources/TagResource.php create mode 100644 packages/marvel/src/Http/Resources/TermsConditionResource.php create mode 100644 packages/marvel/src/Http/Resources/TypeResource.php create mode 100644 packages/marvel/src/Http/Resources/UserResource.php create mode 100644 packages/marvel/src/Http/Resources/UserResourceCollection.php create mode 100644 packages/marvel/src/Http/Resources/product/GetSingleProductResource.php create mode 100644 packages/marvel/src/Http/Resources/product/ProductResource.php create mode 100644 packages/marvel/src/Http/Resources/product/RelatedProductResource.php create mode 100644 packages/marvel/src/Jobs/SendConversationReminder.php create mode 100644 packages/marvel/src/Listeners/AppDataListener.php create mode 100644 packages/marvel/src/Listeners/CheckAndSetDefaultCard.php create mode 100644 packages/marvel/src/Listeners/CommissionRateUpdateListener.php create mode 100644 packages/marvel/src/Listeners/DigitalProductNotifyLogs.php create mode 100644 packages/marvel/src/Listeners/FlashSaleProductProcess.php create mode 100644 packages/marvel/src/Listeners/MaintenanceNotification.php create mode 100644 packages/marvel/src/Listeners/ManageProductInventory.php create mode 100644 packages/marvel/src/Listeners/MessageParticipantNotification.php create mode 100644 packages/marvel/src/Listeners/OwnershipTransferStatusControlListener.php create mode 100644 packages/marvel/src/Listeners/ProductInventoryDecrement.php create mode 100644 packages/marvel/src/Listeners/ProductInventoryRestore.php create mode 100644 packages/marvel/src/Listeners/ProductReviewApprovedListener.php create mode 100644 packages/marvel/src/Listeners/ProductReviewRejectedListener.php create mode 100644 packages/marvel/src/Listeners/RatingRemoved.php create mode 100644 packages/marvel/src/Listeners/Refund/SendRefundRequestedNotification.php create mode 100644 packages/marvel/src/Listeners/Refund/SendRefundUpdateNotification.php create mode 100644 packages/marvel/src/Listeners/SendMessageNotification.php create mode 100644 packages/marvel/src/Listeners/SendOrderCancelledNotification.php create mode 100644 packages/marvel/src/Listeners/SendOrderCreationNotification.php create mode 100644 packages/marvel/src/Listeners/SendOrderDeliveredNotification.php create mode 100644 packages/marvel/src/Listeners/SendOrderReceivedNotification.php create mode 100644 packages/marvel/src/Listeners/SendOrderStatusChangedNotification.php create mode 100644 packages/marvel/src/Listeners/SendPaymentFailedNotification.php create mode 100644 packages/marvel/src/Listeners/SendPaymentSuccessNotification.php create mode 100644 packages/marvel/src/Listeners/SendQuestionAnsweredNotification.php create mode 100644 packages/marvel/src/Listeners/SendReviewNotification.php create mode 100644 packages/marvel/src/Listeners/ShopMaintenanceListener.php create mode 100644 packages/marvel/src/Listeners/StoreNoticeListener.php create mode 100644 packages/marvel/src/Listeners/StoredMessagedNotifyLogsListener.php create mode 100644 packages/marvel/src/Listeners/StoredOrderNotifyLogsListener.php create mode 100644 packages/marvel/src/Listeners/StoredStoreNoticeNotifyLogsListener.php create mode 100644 packages/marvel/src/Listeners/TransferredShopOwnershipNotification.php create mode 100644 packages/marvel/src/Mail/AdminCommissionRateUpdate.php create mode 100644 packages/marvel/src/Mail/ContactAdmin.php create mode 100644 packages/marvel/src/Mail/ForgetPassword.php create mode 100644 packages/marvel/src/Mail/VendorCommissionRateUpdate.php create mode 100644 packages/marvel/src/Notifications/DigitalProductUpdateNotification.php create mode 100644 packages/marvel/src/Notifications/MaintenanceReminder.php create mode 100644 packages/marvel/src/Notifications/MessageReminder.php create mode 100644 packages/marvel/src/Notifications/NewOrderProcessed.php create mode 100644 packages/marvel/src/Notifications/NewOrderReceived.php create mode 100644 packages/marvel/src/Notifications/NewReviewCreated.php create mode 100644 packages/marvel/src/Notifications/NotifyQuestionAnswered.php create mode 100644 packages/marvel/src/Notifications/OrderCancelledNotification.php create mode 100644 packages/marvel/src/Notifications/OrderDeliveredNotification.php create mode 100644 packages/marvel/src/Notifications/OrderPlacedSuccessfully.php create mode 100644 packages/marvel/src/Notifications/OrderStatusChangedNotification.php create mode 100644 packages/marvel/src/Notifications/PaymentFailedNotification.php create mode 100644 packages/marvel/src/Notifications/PaymentSuccessfulNotification.php create mode 100644 packages/marvel/src/Notifications/ProductApprovedNotification.php create mode 100644 packages/marvel/src/Notifications/ProductRejectedNotification.php create mode 100644 packages/marvel/src/Notifications/RefundRequested.php create mode 100644 packages/marvel/src/Notifications/RefundUpdate.php create mode 100644 packages/marvel/src/Notifications/ShopMaintenanceNotification.php create mode 100644 packages/marvel/src/Notifications/StoreNoticeNotification.php create mode 100644 packages/marvel/src/Notifications/TransferredShopOwnership.php create mode 100644 packages/marvel/src/Notifications/TransferredShopOwnershipStatus.php create mode 100644 packages/marvel/src/Otp/Gateways/MessagebirdGateway.php create mode 100644 packages/marvel/src/Otp/Gateways/OtpGateway.php create mode 100644 packages/marvel/src/Otp/Gateways/TwilioGateway.php create mode 100644 packages/marvel/src/Otp/OtpInterface.php create mode 100644 packages/marvel/src/Otp/Result.php create mode 100644 packages/marvel/src/Payment/Base.php create mode 100644 packages/marvel/src/Payment/Flutterwave.php create mode 100644 packages/marvel/src/Payment/Iyzico.php create mode 100644 packages/marvel/src/Payment/Mollie.php create mode 100644 packages/marvel/src/Payment/Payment.php create mode 100644 packages/marvel/src/Payment/PaymentInterface.php create mode 100644 packages/marvel/src/Payment/Paymongo.php create mode 100644 packages/marvel/src/Payment/Paypal.php create mode 100644 packages/marvel/src/Payment/Paystack.php create mode 100644 packages/marvel/src/Payment/Razorpay.php create mode 100644 packages/marvel/src/Payment/Stripe.php create mode 100644 packages/marvel/src/Providers/EventServiceProvider.php create mode 100644 packages/marvel/src/Providers/GraphQLServiceProvider.php create mode 100644 packages/marvel/src/Providers/MarvelBroadcastServiceProvider.php create mode 100644 packages/marvel/src/Providers/RestAPIServiceProvider.php create mode 100644 packages/marvel/src/Providers/WhereConditionsServiceProvider.php create mode 100644 packages/marvel/src/Rest/Channel.php create mode 100644 packages/marvel/src/Rest/Routes.php create mode 100644 packages/marvel/src/Shop.php create mode 100644 packages/marvel/src/ShopServiceProvider.php create mode 100644 packages/marvel/src/Traits/CalculatePaymentTrait.php create mode 100644 packages/marvel/src/Traits/ENVSetupTrait.php create mode 100644 packages/marvel/src/Traits/Excludable.php create mode 100644 packages/marvel/src/Traits/Helper.php create mode 100644 packages/marvel/src/Traits/OrderManagementTrait.php create mode 100644 packages/marvel/src/Traits/OrderSmsTrait.php create mode 100644 packages/marvel/src/Traits/OrderStatusManagerWithPaymentTrait.php create mode 100644 packages/marvel/src/Traits/PaymentStatusManagerWithOrderTrait.php create mode 100644 packages/marvel/src/Traits/PaymentTrait.php create mode 100644 packages/marvel/src/Traits/SmsTrait.php create mode 100644 packages/marvel/src/Traits/StoreNoticeable.php create mode 100644 packages/marvel/src/Traits/TranslationTrait.php create mode 100644 packages/marvel/src/Traits/UsersTrait.php create mode 100644 packages/marvel/src/Traits/WalletsTrait.php create mode 100644 packages/marvel/stubs/resources/css/app.css create mode 100644 packages/marvel/stubs/resources/fonts/SolaimanLipi.ttf create mode 100644 packages/marvel/stubs/resources/js/app.js create mode 100644 packages/marvel/stubs/resources/js/bootstrap.js create mode 100644 packages/marvel/stubs/resources/lang/de/common.php create mode 100644 packages/marvel/stubs/resources/lang/de/message.php create mode 100644 packages/marvel/stubs/resources/lang/de/order.php create mode 100644 packages/marvel/stubs/resources/lang/de/sms.php create mode 100644 packages/marvel/stubs/resources/lang/en/common.php create mode 100644 packages/marvel/stubs/resources/lang/en/message.php create mode 100644 packages/marvel/stubs/resources/lang/en/sms.php create mode 100644 packages/marvel/stubs/resources/views/emails/contact-admin.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/forget-password.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/maintenance/reminder.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/maintenance/shop-maintenance.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/order/order-cancelled.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/order/order-delivered.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/order/order-invoice.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/order/order-processed.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/order/order-received.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/order/order-status-changed.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/order/placed.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/ownership/reminder.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/ownership/status.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/payment/payment-failed.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/payment/payment-successful.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/refund/refund-requested.blade.php create mode 100644 packages/marvel/stubs/resources/views/emails/refund/refund-updated.blade.php create mode 100644 packages/marvel/stubs/resources/views/pdf/order-invoice.blade.php create mode 100644 packages/marvel/stubs/resources/views/products/digital_product/update.blade.php create mode 100644 packages/marvel/stubs/seeders/DemoDataSeeders.php create mode 100644 packages/marvel/stubs/sql/chawkbazar/address.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/attachments.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/attribute_product.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/attribute_values.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/attributes.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/balances.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/became_sellers.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/categories.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/category_product.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/commissions.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/coupons.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/media.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/model_has_permissions.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/model_has_roles.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/order_product.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/orders.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/permissions.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/product_tag.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/products.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/role_has_permissions.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/roles.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/settings.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/shipping_classes.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/shops.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/tags.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/tax_classes.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/terms_and_conditions.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/types.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/user_profiles.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/users.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/variation_options.sql create mode 100644 packages/marvel/stubs/sql/chawkbazar/withdraws.sql create mode 100644 phpunit.xml create mode 100644 public/.htaccess create mode 100644 public/css/app.css create mode 100644 public/favicon.ico create mode 100644 public/index.php create mode 100644 public/js/app.js create mode 100644 public/mix-manifest.json create mode 100644 public/robots.txt create mode 100644 public/sql/address.sql create mode 100644 public/sql/attachments.sql create mode 100644 public/sql/attribute_product.sql create mode 100644 public/sql/attribute_values.sql create mode 100644 public/sql/attributes.sql create mode 100644 public/sql/balances.sql create mode 100644 public/sql/became_sellers.sql create mode 100644 public/sql/categories.sql create mode 100644 public/sql/category_product.sql create mode 100644 public/sql/commissions.sql create mode 100644 public/sql/coupons.sql create mode 100644 public/sql/media.sql create mode 100644 public/sql/model_has_permissions.sql create mode 100644 public/sql/model_has_roles.sql create mode 100644 public/sql/order_product.sql create mode 100644 public/sql/orders.sql create mode 100644 public/sql/permissions.sql create mode 100644 public/sql/product_tag.sql create mode 100644 public/sql/products.sql create mode 100644 public/sql/role_has_permissions.sql create mode 100644 public/sql/roles.sql create mode 100644 public/sql/settings.sql create mode 100644 public/sql/shipping_classes.sql create mode 100644 public/sql/shops.sql create mode 100644 public/sql/tags.sql create mode 100644 public/sql/tax_classes.sql create mode 100644 public/sql/terms_and_conditions.sql create mode 100644 public/sql/types.sql create mode 100644 public/sql/user_profiles.sql create mode 100644 public/sql/users.sql create mode 100644 public/sql/variation_options.sql create mode 100644 public/sql/withdraws.sql create mode 100644 public/vendor/telescope/app-dark.css create mode 100644 public/vendor/telescope/app.css create mode 100644 public/vendor/telescope/app.js create mode 100644 public/vendor/telescope/favicon.ico create mode 100644 public/vendor/telescope/mix-manifest.json create mode 100644 public/web.config create mode 100644 resources/css/app.css create mode 100644 resources/fonts/SolaimanLipi.ttf create mode 100644 resources/js/app.js create mode 100644 resources/js/bootstrap.js create mode 100644 resources/lang/de/common.php create mode 100644 resources/lang/de/message.php create mode 100644 resources/lang/de/order.php create mode 100644 resources/lang/de/sms.php create mode 100644 resources/lang/en/common.php create mode 100644 resources/lang/en/message.php create mode 100644 resources/lang/en/sms.php create mode 100644 resources/views/emails/contact-admin.blade.php create mode 100644 resources/views/emails/forget-password.blade.php create mode 100644 resources/views/emails/maintenance/reminder.blade.php create mode 100644 resources/views/emails/maintenance/shop-maintenance.blade.php create mode 100644 resources/views/emails/message/reminder.blade.php create mode 100644 resources/views/emails/order/admin-commission-rate-update.blade.php create mode 100644 resources/views/emails/order/order-cancelled.blade.php create mode 100644 resources/views/emails/order/order-delivered.blade.php create mode 100644 resources/views/emails/order/order-invoice.blade.php create mode 100644 resources/views/emails/order/order-processed.blade.php create mode 100644 resources/views/emails/order/order-received.blade.php create mode 100644 resources/views/emails/order/order-status-changed.blade.php create mode 100644 resources/views/emails/order/placed.blade.php create mode 100644 resources/views/emails/order/vendor-commission-rate-update.blade.php create mode 100644 resources/views/emails/ownership/reminder.blade.php create mode 100644 resources/views/emails/ownership/status.blade.php create mode 100644 resources/views/emails/payment/payment-failed.blade.php create mode 100644 resources/views/emails/payment/payment-successful.blade.php create mode 100644 resources/views/emails/product/product-approved.blade.php create mode 100644 resources/views/emails/product/product-rejected.blade.php create mode 100644 resources/views/emails/question/answered.blade.php create mode 100644 resources/views/emails/refund/refund-requested.blade.php create mode 100644 resources/views/emails/refund/refund-updated.blade.php create mode 100644 resources/views/emails/review/created.blade.php create mode 100644 resources/views/emails/storeNotice/storeNotice.blade.php create mode 100644 resources/views/pdf/order-invoice.blade.php create mode 100644 resources/views/products/digital_product/update.blade.php create mode 100644 resources/views/welcome.blade.php create mode 100644 routes/api.php create mode 100644 routes/channels.php create mode 100644 routes/console.php create mode 100644 routes/web.php create mode 100644 server.php create mode 100644 storage/app/.gitignore create mode 100644 storage/app/public/.gitignore create mode 100644 storage/framework/.gitignore create mode 100644 storage/framework/sessions/.gitignore create mode 100644 storage/framework/testing/.gitignore create mode 100644 storage/framework/views/.gitignore create mode 100644 storage/logs/.gitignore create mode 100644 tests/CreatesApplication.php create mode 100644 tests/Feature/ExampleTest.php create mode 100644 tests/TestCase.php create mode 100644 tests/Unit/ExampleTest.php create mode 100644 webpack.mix.js create mode 100644 yarn.lock diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6537ca4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c76ad01 --- /dev/null +++ b/.env.example @@ -0,0 +1,169 @@ +APP_NAME=ChawkBazar +APP_ENV=production +APP_KEY= +APP_DEBUG=false +APP_URL=http://localhost +APP_VERSION=6.6.0 +APP_SERVICE=marvel.test +APP_NOTICE_DOMAIN=MARVEL_ +DUMMY_DATA_PATH=chawkbazar + +# Multilang +# If you want to enable multilang then follow this doc -> https://pickbazar-doc.vercel.app/multilingual +TRANSLATION_ENABLED=false +DEFAULT_LANGUAGE=en + +LOG_CHANNEL=stack +LOG_LEVEL=debug + +DB_CONNECTION=mysql +DB_HOST=mysql +DB_PORT=3306 +DB_DATABASE=marvel_laravel +DB_USERNAME=marvel_laravel +DB_PASSWORD=1Amarvel@laravel + +BROADCAST_DRIVER=pusher +CACHE_DRIVER=file +QUEUE_CONNECTION=database +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +MEMCACHED_HOST=memcached + +LIGHTHOUSE_CACHE_ENABLE=false + +REDIS_HOST=redis +REDIS_PASSWORD=null +REDIS_PORT=6379 + +# Email +# To configure email visit https://chawkbazar-laravel-doc.vercel.app/email-configuration +MAIL_MAILER=mailgun +MAIL_HOST=smtp.mailgun.org +MAILGUN_DOMAIN= +MAILGUN_SECRET= +MAIL_FROM_ADDRESS= +MAIL_PORT=1025 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +ADMIN_EMAIL=support@example.com + +# File system +MEDIA_DISK=public +FILESYSTEM_DISK=local + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION= +AWS_BUCKET= + +# Connect With Frontend +SHOP_URL= +DASHBOARD_URL= + +# To configure the payment gateway follow this doc -> https://pickbazar-doc.vercel.app/payment +# PAYMENT +ACTIVE_PAYMENT_GATEWAY=Stripe +DEFAULT_CURRENCY=USD + +# Payment -> Stripe +STRIPE_API_KEY= +STRIPE_WEBHOOK_SECRET_KEY= +# Payment -> Paypal + +# Add currency like USD +PAYPAL_CURRENCY= +# Change this accordingly for your application. +PAYPAL_NOTIFY_URL= +# force gateway language i.e. it_IT, es_ES, en_US ... (for express checkout only) +PAYPAL_LOCALE= +# Validate SSL when creating api client. +PAYPAL_VALIDATE_SSL= + +# Values: sandbox or live -> sanbox for development and live for production +PAYPAL_MODE= + +#PayPal Setting & API Credentials - sandbox +PAYPAL_SANDBOX_CLIENT_ID= +PAYPAL_SANDBOX_CLIENT_SECRET= + +#PayPal Setting & API Credentials - live +PAYPAL_LIVE_CLIENT_ID= +PAYPAL_LIVE_CLIENT_SECRET= +PAYPAL_WEBHOOK_ID= +PAYPAL_REDIRECT_URL= + +# Payment -> Mollie +MOLLIE_KEY= +MOLLIE_REDIRECT_URL= +MOLLIE_WEBHOOK_URL= + +# Payment -> Razorpay +RAZORPAY_KEY_ID= +RAZORPAY_KEY_SECRET= +RAZORPAY_WEBHOOK_SECRET_KEY= + +# Payment -> PayStack +PAYSTACK_PUBLIC_KEY= +PAYSTACK_SECRET_KEY= +PAYSTACK_PAYMENT_URL=https://api.paystack.co +MERCHANT_EMAIL= + +# Remove sandbox- for production +IYZIPAY_BASE_URL=https://sandbox-api.iyzipay.com +IYZIPAY_API_KEY=YOUR_KEY_HERE +IYZIPAY_SECRET_KEY=YOUR_SECRET_KEY_HERE + +# Payment -> bKash +BKASH_SANDBOX=true #for production use false +BKASH_APP_KEY="" +BKASH_APP_SECRET="" +BKASH_USERNAME="" +BKASH_PASSWORD="" + +# Payment -> Paymongo +PAYMONGO_SECRET_KEY= +PAYMONGO_PUBLIC_KEY= +# This is the secret from the webhook you created. +PAYMONGO_WEBHOOK_SIG= + +# Payment -> Flutterwave +FLW_PUBLIC_KEY= +FLW_SECRET_KEY= +FLW_SECRET_HASH= + +# AI --> OpenAi +OPENAI_SECRET_KEY= + +# Social Login +GOOGLE_CLIENT_ID= +GOOGLE_CLIENT_SECRET= +GOOGLE_REDIRECT_URI=http://127.0.0.1/login/google/callback + +FACEBOOK_CLIENT_ID= +FACEBOOK_CLIENT_SECRET= +FACEBOOK_REDIRECT_URI=https://127.0.0.1/login/facebook/callback + +# Mailchimp Newslater +NEWSLETTER_API_KEY= +NEWSLETTER_LIST_ID= + +# OTP Message System +ACTIVE_OTP_GATEWAY=twilio + +TWILIO_AUTH_TOKEN= +TWILIO_ACCOUNT_SID= +TWILIO_VERIFICATION_SID= +TWILIO_FROM_NUMBER= + +MESSAGEBIRD_API_KEY= +MESSAGEBIRD_ORIGINATOR=Marvel + +# PUSHER_ENABLED is either true or false +PUSHER_ENABLED=true +PUSHER_APP_ID=1697086 +PUSHER_APP_KEY=4f67daf566b719c6f606 +PUSHER_APP_SECRET=fa0152a9a28112e6e164 +PUSHER_APP_CLUSTER=ap2 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..967315d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +* text=auto +*.css linguist-vendored +*.scss linguist-vendored +*.js linguist-vendored +CHANGELOG.md export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2545c6e --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +/node_modules +/public/hot +/public/storage +/public/license +/storage/*.key +/storage/framework/cache +/storage/debugbar +/vendor +.env +.env.backup +.phpunit.result.cache +docker-compose.override.yml +Homestead.json +Homestead.yaml +npm-debug.log +yarn-error.log +.DS_Store +docker-compose.yml +.idea +.vscode \ No newline at end of file diff --git a/.styleci.yml b/.styleci.yml new file mode 100644 index 0000000..9231873 --- /dev/null +++ b/.styleci.yml @@ -0,0 +1,13 @@ +php: + preset: laravel + disabled: + - no_unused_imports + finder: + not-name: + - index.php + - server.php +js: + finder: + not-name: + - webpack.mix.js +css: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9d7784d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM laravelsail/php81-composer + +RUN apt-get update -y && apt-get install -y libpng-dev zlib1g-dev libicu-dev g++ + +RUN docker-php-ext-configure intl + +RUN docker-php-ext-install exif gd intl zip + diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php new file mode 100644 index 0000000..69914e9 --- /dev/null +++ b/app/Console/Kernel.php @@ -0,0 +1,41 @@ +command('inspire')->hourly(); + } + + /** + * Register the commands for the application. + * + * @return void + */ + protected function commands() + { + $this->load(__DIR__.'/Commands'); + + require base_path('routes/console.php'); + } +} diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php new file mode 100644 index 0000000..f9644ad --- /dev/null +++ b/app/Exceptions/Handler.php @@ -0,0 +1,40 @@ +reportable(function (Throwable $e) { + // + }); + } +} diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php new file mode 100644 index 0000000..a0a2a8a --- /dev/null +++ b/app/Http/Controllers/Controller.php @@ -0,0 +1,13 @@ + [ + \App\Http\Middleware\EncryptCookies::class, + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, + \Illuminate\Session\Middleware\StartSession::class, + // \Illuminate\Session\Middleware\AuthenticateSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \App\Http\Middleware\VerifyCsrfToken::class, + \Illuminate\Routing\Middleware\SubstituteBindings::class, + ], + + 'api' => [ + 'throttle:api', + \Illuminate\Routing\Middleware\SubstituteBindings::class, + ], + ]; + + /** + * The application's route middleware. + * + * These middleware may be assigned to groups or used individually. + * + * @var array + */ + protected $routeMiddleware = [ + 'auth' => \App\Http\Middleware\Authenticate::class, + 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, + 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, + 'can' => \Illuminate\Auth\Middleware\Authorize::class, + 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, + 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, + ]; +} diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php new file mode 100644 index 0000000..704089a --- /dev/null +++ b/app/Http/Middleware/Authenticate.php @@ -0,0 +1,21 @@ +expectsJson()) { + return route('login'); + } + } +} diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php new file mode 100644 index 0000000..033136a --- /dev/null +++ b/app/Http/Middleware/EncryptCookies.php @@ -0,0 +1,17 @@ +check()) { + return redirect(RouteServiceProvider::HOME); + } + } + + return $next($request); + } +} diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php new file mode 100644 index 0000000..5a50e7b --- /dev/null +++ b/app/Http/Middleware/TrimStrings.php @@ -0,0 +1,18 @@ +allSubdomainsOfApplicationUrl(), + ]; + } +} diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php new file mode 100644 index 0000000..087cac7 --- /dev/null +++ b/app/Http/Middleware/TrustProxies.php @@ -0,0 +1,29 @@ + 'datetime', + ]; +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php new file mode 100644 index 0000000..f2dcfd4 --- /dev/null +++ b/app/Providers/AppServiceProvider.php @@ -0,0 +1,32 @@ +app['request']->server->set('HTTPS', true); + } + } +} diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php new file mode 100644 index 0000000..ce74491 --- /dev/null +++ b/app/Providers/AuthServiceProvider.php @@ -0,0 +1,30 @@ + 'App\Policies\ModelPolicy', + ]; + + /** + * Register any authentication / authorization services. + * + * @return void + */ + public function boot() + { + $this->registerPolicies(); + + // + } +} diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php new file mode 100644 index 0000000..395c518 --- /dev/null +++ b/app/Providers/BroadcastServiceProvider.php @@ -0,0 +1,21 @@ + [ + SendEmailVerificationNotification::class, + ], + ]; + + /** + * Register any events for your application. + * + * @return void + */ + public function boot() + { + // + } +} diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php new file mode 100644 index 0000000..3bd3c81 --- /dev/null +++ b/app/Providers/RouteServiceProvider.php @@ -0,0 +1,63 @@ +configureRateLimiting(); + + $this->routes(function () { + Route::prefix('api') + ->middleware('api') + ->namespace($this->namespace) + ->group(base_path('routes/api.php')); + + Route::middleware('web') + ->namespace($this->namespace) + ->group(base_path('routes/web.php')); + }); + } + + /** + * Configure the rate limiters for the application. + * + * @return void + */ + protected function configureRateLimiting() + { + RateLimiter::for('api', function (Request $request) { + return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); + }); + } +} diff --git a/artisan b/artisan new file mode 100644 index 0000000..5c23e2e --- /dev/null +++ b/artisan @@ -0,0 +1,53 @@ +#!/usr/bin/env php +make(Illuminate\Contracts\Console\Kernel::class); + +$status = $kernel->handle( + $input = new Symfony\Component\Console\Input\ArgvInput, + new Symfony\Component\Console\Output\ConsoleOutput +); + +/* +|-------------------------------------------------------------------------- +| Shutdown The Application +|-------------------------------------------------------------------------- +| +| Once Artisan has finished running, we will fire off the shutdown events +| so that any final work may be done by the application before we shut +| down the process. This is the last thing to happen to the request. +| +*/ + +$kernel->terminate($input, $status); + +exit($status); diff --git a/bootstrap/app.php b/bootstrap/app.php new file mode 100644 index 0000000..037e17d --- /dev/null +++ b/bootstrap/app.php @@ -0,0 +1,55 @@ +singleton( + Illuminate\Contracts\Http\Kernel::class, + App\Http\Kernel::class +); + +$app->singleton( + Illuminate\Contracts\Console\Kernel::class, + App\Console\Kernel::class +); + +$app->singleton( + Illuminate\Contracts\Debug\ExceptionHandler::class, + App\Exceptions\Handler::class +); + +/* +|-------------------------------------------------------------------------- +| Return The Application +|-------------------------------------------------------------------------- +| +| This script returns the application instance. The instance is given to +| the calling script so we can separate the building of the instances +| from the actual running of the application and sending responses. +| +*/ + +return $app; diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/bootstrap/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..89fd5c0 --- /dev/null +++ b/composer.json @@ -0,0 +1,90 @@ +{ + "name": "redq/marvel", + "type": "project", + "description": "Marvel, a complete e-commerce engine for both rest and graphql", + "keywords": [ + "marvel", + "graphql", + "rest-api" + ], + "license": "MIT", + "require": { + "php": "^8.0|^8.1", + "barryvdh/laravel-dompdf": "2.0.1", + "doctrine/dbal": "3.7.1", + "guzzlehttp/guzzle": "7.8.0", + "karim007/laravel-bkash-tokenize": "dev-main", + "laravel/framework": "10.30.1", + "laravel/socialite": "5.10.0", + "laravel/tinker": "2.8.2", + "marvel/shop": "dev-master", + "messagebird/php-rest-api": "3.1.4", + "psr/log": "3.0.0", + "stevebauman/purify": "6.0.2", + "symfony/http-client": "6.3.7", + "symfony/mailgun-mailer": "6.3.6", + "kingflamez/laravelrave": "dev-master" + }, + "require-dev": { + "fakerphp/faker": "1.21.0", + "laravel/sail": "1.21.0", + "mockery/mockery": "1.5.1", + "nunomaduro/collision": "7.0.5", + "phpunit/phpunit": "10.0.13", + "spatie/laravel-ignition": "2.0.0", + "squizlabs/php_codesniffer": "3.7.2" + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true, + "allow-plugins": { + "php-http/discovery": true + } + }, + "extra": { + "laravel": { + "dont-discover": [] + } + }, + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Factories\\": "database/factories/", + "Database\\Seeders\\": "database/seeders/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "scripts": { + "post-autoload-dump": [ + "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", + "@php artisan package:discover --ansi" + ], + "post-root-package-install": [ + "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" + ], + "post-create-project-cmd": [ + "@php artisan key:generate --ansi" + ] + }, + "repositories": { + "marvel/shop": { + "type": "path", + "url": "packages/marvel" + }, + "marvel/bkash": { + "type": "vcs", + "url": "https://github.com/CodersFaruk/laravel-bkash-tokenize" + }, + "marvel/flutterwave": { + "type": "vcs", + "url": "https://github.com/CodersFaruk/laravel-flutterwave" + } + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..0829dd0 --- /dev/null +++ b/composer.lock @@ -0,0 +1,14190 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "99bf17669d2abad79b8c84dd1466f690", + "packages": [ + { + "name": "aws/aws-crt-php", + "version": "v1.2.4", + "source": { + "type": "git", + "url": "https://github.com/awslabs/aws-crt-php.git", + "reference": "eb0c6e4e142224a10b08f49ebf87f32611d162b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/eb0c6e4e142224a10b08f49ebf87f32611d162b2", + "reference": "eb0c6e4e142224a10b08f49ebf87f32611d162b2", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35||^5.6.3||^9.5", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality." + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "AWS SDK Common Runtime Team", + "email": "aws-sdk-common-runtime@amazon.com" + } + ], + "description": "AWS Common Runtime for PHP", + "homepage": "https://github.com/awslabs/aws-crt-php", + "keywords": [ + "amazon", + "aws", + "crt", + "sdk" + ], + "support": { + "issues": "https://github.com/awslabs/aws-crt-php/issues", + "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.4" + }, + "time": "2023-11-08T00:42:13+00:00" + }, + { + "name": "aws/aws-sdk-php", + "version": "3.299.1", + "source": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-php.git", + "reference": "a0f87b8e8bfb9afd0ffd702fcda556b465eee457" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a0f87b8e8bfb9afd0ffd702fcda556b465eee457", + "reference": "a0f87b8e8bfb9afd0ffd702fcda556b465eee457", + "shasum": "" + }, + "require": { + "aws/aws-crt-php": "^1.2.3", + "ext-json": "*", + "ext-pcre": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", + "guzzlehttp/promises": "^1.4.0 || ^2.0", + "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "mtdowling/jmespath.php": "^2.6", + "php": ">=7.2.5", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "andrewsville/php-token-reflection": "^1.4", + "aws/aws-php-sns-message-validator": "~1.0", + "behat/behat": "~3.0", + "composer/composer": "^1.10.22", + "dms/phpunit-arraysubset-asserts": "^0.4.0", + "doctrine/cache": "~1.4", + "ext-dom": "*", + "ext-openssl": "*", + "ext-pcntl": "*", + "ext-sockets": "*", + "nette/neon": "^2.3", + "paragonie/random_compat": ">= 2", + "phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0", + "sebastian/comparator": "^1.2.3 || ^4.0", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", + "doctrine/cache": "To use the DoctrineCacheAdapter", + "ext-curl": "To send requests using cURL", + "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages", + "ext-sockets": "To use client-side monitoring" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Aws\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Amazon Web Services", + "homepage": "http://aws.amazon.com" + } + ], + "description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project", + "homepage": "http://aws.amazon.com/sdkforphp", + "keywords": [ + "amazon", + "aws", + "cloud", + "dynamodb", + "ec2", + "glacier", + "s3", + "sdk" + ], + "support": { + "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", + "issues": "https://github.com/aws/aws-sdk-php/issues", + "source": "https://github.com/aws/aws-sdk-php/tree/3.299.1" + }, + "time": "2024-02-16T19:08:34+00:00" + }, + { + "name": "barryvdh/laravel-dompdf", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-dompdf.git", + "reference": "9843d2be423670fb434f4c978b3c0f4dd92c87a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/9843d2be423670fb434f4c978b3c0f4dd92c87a6", + "reference": "9843d2be423670fb434f4c978b3c0f4dd92c87a6", + "shasum": "" + }, + "require": { + "dompdf/dompdf": "^2.0.1", + "illuminate/support": "^6|^7|^8|^9|^10", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "nunomaduro/larastan": "^1|^2", + "orchestra/testbench": "^4|^5|^6|^7|^8", + "phpro/grumphp": "^1", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + }, + "laravel": { + "providers": [ + "Barryvdh\\DomPDF\\ServiceProvider" + ], + "aliases": { + "Pdf": "Barryvdh\\DomPDF\\Facade\\Pdf", + "PDF": "Barryvdh\\DomPDF\\Facade\\Pdf" + } + } + }, + "autoload": { + "psr-4": { + "Barryvdh\\DomPDF\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "A DOMPDF Wrapper for Laravel", + "keywords": [ + "dompdf", + "laravel", + "pdf" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-dompdf/issues", + "source": "https://github.com/barryvdh/laravel-dompdf/tree/v2.0.1" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2023-01-12T15:12:49+00:00" + }, + { + "name": "bensampo/laravel-enum", + "version": "v6.6.4", + "source": { + "type": "git", + "url": "https://github.com/BenSampo/laravel-enum.git", + "reference": "5c867210ef3ec074f26980dc51e5743428ce3eec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/BenSampo/laravel-enum/zipball/5c867210ef3ec074f26980dc51e5743428ce3eec", + "reference": "5c867210ef3ec074f26980dc51e5743428ce3eec", + "shasum": "" + }, + "require": { + "composer/class-map-generator": "^1", + "illuminate/contracts": "^9 || ^10", + "illuminate/support": "^9 || ^10", + "laminas/laminas-code": "^3.4 || ^4", + "nikic/php-parser": "^4.13", + "php": "^8" + }, + "require-dev": { + "doctrine/dbal": "^3.4", + "ergebnis/composer-normalize": "^2.28.3", + "mll-lab/php-cs-fixer-config": "^5.4", + "mockery/mockery": "^1.5", + "nunomaduro/larastan": "^2.6.3", + "orchestra/testbench": "^7.6.1 || ^8", + "phpstan/phpstan": "^1.8.2", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1.1", + "phpunit/phpunit": "^9.5.21 || ^10", + "rector/rector": "^0.17.6", + "symplify/rule-doc-generator": "^11" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "BenSampo\\Enum\\EnumServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "BenSampo\\Enum\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Sampson", + "homepage": "https://sampo.co.uk", + "role": "Developer" + }, + { + "name": "Benedikt Franke", + "homepage": "https://franke.tech", + "role": "Developer" + } + ], + "description": "Simple, extensible and powerful enumeration implementation for Laravel.", + "homepage": "https://github.com/bensampo/laravel-enum", + "keywords": [ + "bensampo", + "enum", + "laravel", + "package", + "validation" + ], + "support": { + "issues": "https://github.com/BenSampo/laravel-enum/issues", + "source": "https://github.com/BenSampo/laravel-enum/tree/v6.6.4" + }, + "funding": [ + { + "url": "https://github.com/bensampo", + "type": "github" + } + ], + "time": "2023-09-26T12:34:43+00:00" + }, + { + "name": "brick/math", + "version": "0.11.0", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478", + "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^9.0", + "vimeo/psalm": "5.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "brick", + "math" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.11.0" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + } + ], + "time": "2023-01-15T23:15:59+00:00" + }, + { + "name": "carbonphp/carbon-doctrine-types", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", + "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/99f76ffa36cce3b70a4a6abce41dba15ca2e84cb", + "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "doctrine/dbal": "<3.7.0 || >=4.0.0" + }, + "require-dev": { + "doctrine/dbal": "^3.7.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Types to use Carbon in Doctrine", + "keywords": [ + "carbon", + "date", + "datetime", + "doctrine", + "time" + ], + "support": { + "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/2.1.0" + }, + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2023-12-11T17:09:12+00:00" + }, + { + "name": "cknow/laravel-money", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/cknow/laravel-money.git", + "reference": "d54ebc59342ed2a68647cc878444ef48af9f21ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cknow/laravel-money/zipball/d54ebc59342ed2a68647cc878444ef48af9f21ef", + "reference": "d54ebc59342ed2a68647cc878444ef48af9f21ef", + "shasum": "" + }, + "require": { + "ext-intl": "*", + "ext-json": "*", + "illuminate/support": "^7.0|^8.0|^9.0|^10.0", + "illuminate/view": "^7.0|^8.0|^9.0|^10.0", + "moneyphp/money": "^3.3|^4.2", + "php": "^7.3|^8.0" + }, + "require-dev": { + "graham-campbell/testbench": "^5.7", + "illuminate/filesystem": "^7.0|^8.0|^9.0|^10.0", + "mockery/mockery": "^1.6", + "phpunit/phpunit": "^8.5|^9.5.10|^10.0", + "spatie/phpunit-watcher": "^1.23" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Cknow\\Money\\MoneyServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Cknow\\Money\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ricardo Gobbo de Souza", + "email": "ricardogobbosouza@yahoo.com.br" + } + ], + "description": "Laravel Money", + "homepage": "https://github.com/cknow/laravel-money", + "keywords": [ + "currency", + "laravel", + "money" + ], + "support": { + "issues": "https://github.com/cknow/laravel-money/issues", + "source": "https://github.com/cknow/laravel-money/tree/v7.2.0" + }, + "time": "2023-08-18T11:13:55+00:00" + }, + { + "name": "cocur/slugify", + "version": "v4.5.1", + "source": { + "type": "git", + "url": "https://github.com/cocur/slugify.git", + "reference": "7c6e088228b9f082050876ae8b0cd287b117b840" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cocur/slugify/zipball/7c6e088228b9f082050876ae8b0cd287b117b840", + "reference": "7c6e088228b9f082050876ae8b0cd287b117b840", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" + }, + "conflict": { + "symfony/config": "<3.4 || >=4,<4.3", + "symfony/dependency-injection": "<3.4 || >=4,<4.3", + "symfony/http-kernel": "<3.4 || >=4,<4.3", + "twig/twig": "<2.12.1" + }, + "require-dev": { + "laravel/framework": "^5.0|^6.0|^7.0|^8.0", + "latte/latte": "~2.2", + "league/container": "^2.2.0", + "mikey179/vfsstream": "~1.6.8", + "mockery/mockery": "^1.3", + "nette/di": "~2.4", + "pimple/pimple": "~1.1", + "plumphp/plum": "~0.1", + "symfony/config": "^3.4 || ^4.3 || ^5.0 || ^6.0", + "symfony/dependency-injection": "^3.4 || ^4.3 || ^5.0 || ^6.0", + "symfony/http-kernel": "^3.4 || ^4.3 || ^5.0 || ^6.0", + "symfony/phpunit-bridge": "^5.4 || ^6.0", + "twig/twig": "^2.12.1 || ~3.0", + "zendframework/zend-modulemanager": "~2.2", + "zendframework/zend-servicemanager": "~2.2", + "zendframework/zend-view": "~2.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cocur\\Slugify\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florian Eckerstorfer", + "email": "florian@eckerstorfer.co", + "homepage": "https://florian.ec" + }, + { + "name": "Ivo Bathke", + "email": "ivo.bathke@gmail.com" + } + ], + "description": "Converts a string into a slug.", + "keywords": [ + "slug", + "slugify" + ], + "support": { + "issues": "https://github.com/cocur/slugify/issues", + "source": "https://github.com/cocur/slugify/tree/v4.5.1" + }, + "time": "2023-09-17T07:26:20+00:00" + }, + { + "name": "composer/ca-bundle", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "b66d11b7479109ab547f9405b97205640b17d385" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/b66d11b7479109ab547f9405b97205640b17d385", + "reference": "b66d11b7479109ab547f9405b97205640b17d385", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-12-18T12:05:55+00:00" + }, + { + "name": "composer/class-map-generator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/class-map-generator.git", + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/953cc4ea32e0c31f2185549c7d216d7921f03da9", + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9", + "shasum": "" + }, + "require": { + "composer/pcre": "^2.1 || ^3.1", + "php": "^7.2 || ^8.0", + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" + }, + "require-dev": { + "phpstan/phpstan": "^1.6", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/filesystem": "^5.4 || ^6", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\ClassMapGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Utilities to scan PHP code and generate class maps.", + "keywords": [ + "classmap" + ], + "support": { + "issues": "https://github.com/composer/class-map-generator/issues", + "source": "https://github.com/composer/class-map-generator/tree/1.1.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-06-30T13:58:57+00:00" + }, + { + "name": "composer/pcre", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-10-11T07:11:09+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-31T09:50:34+00:00" + }, + { + "name": "cviebrock/eloquent-sluggable", + "version": "10.0.0", + "source": { + "type": "git", + "url": "https://github.com/cviebrock/eloquent-sluggable.git", + "reference": "92f456b10337ca97c1cccfcc853a1cf51d2cedd0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cviebrock/eloquent-sluggable/zipball/92f456b10337ca97c1cccfcc853a1cf51d2cedd0", + "reference": "92f456b10337ca97c1cccfcc853a1cf51d2cedd0", + "shasum": "" + }, + "require": { + "cocur/slugify": "^4.3", + "illuminate/config": "^10.0", + "illuminate/database": "^10.0", + "illuminate/support": "^10.0", + "php": "^8.1" + }, + "require-dev": { + "limedeck/phpunit-detailed-printer": "^6.0", + "mockery/mockery": "^1.4.4", + "orchestra/testbench": "^8.0", + "pestphp/pest": "2.x-dev" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Cviebrock\\EloquentSluggable\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Cviebrock\\EloquentSluggable\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Colin Viebrock", + "email": "colin@viebrock.ca" + } + ], + "description": "Easy creation of slugs for your Eloquent models in Laravel", + "homepage": "https://github.com/cviebrock/eloquent-sluggable", + "keywords": [ + "eloquent", + "eloquent-sluggable", + "laravel", + "lumen", + "slug", + "sluggable" + ], + "support": { + "issues": "https://github.com/cviebrock/eloquent-sluggable/issues", + "source": "https://github.com/cviebrock/eloquent-sluggable/tree/10.0.0" + }, + "funding": [ + { + "url": "https://github.com/cviebrock", + "type": "github" + } + ], + "time": "2023-02-16T23:01:35+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "f41715465d65213d644d3141a6a93081be5d3549" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/f41715465d65213d644d3141a6a93081be5d3549", + "reference": "f41715465d65213d644d3141a6a93081be5d3549", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", + "scrutinizer/ocular": "1.6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Dflydev\\DotAccessData\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "support": { + "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.2" + }, + "time": "2022-10-27T11:44:00+00:00" + }, + { + "name": "dgvai/laravel-sslcommerz", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/dgvai/laravel-sslcommerz.git", + "reference": "b357221d2513be692f45e7587b4fdf0b169364c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dgvai/laravel-sslcommerz/zipball/b357221d2513be692f45e7587b4fdf0b169364c8", + "reference": "b357221d2513be692f45e7587b4fdf0b169364c8", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~7.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "DGvai\\SSLCommerz\\SSLCommerzServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "DGvai\\SSLCommerz\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jalal Uddin", + "email": "dgvai@users.noreply.github.com" + } + ], + "description": "Laravel package of SSLCommerz", + "support": { + "issues": "https://github.com/dgvai/laravel-sslcommerz/issues", + "source": "https://github.com/dgvai/laravel-sslcommerz/tree/1.0.4" + }, + "time": "2022-03-01T04:42:37+00:00" + }, + { + "name": "doctrine/cache", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", + "shasum": "" + }, + "require": { + "php": "~7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/2.2.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "time": "2022-05-20T20:07:39+00:00" + }, + { + "name": "doctrine/dbal", + "version": "3.7.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/5b7bd66c9ff58c04c5474ab85edce442f8081cb2", + "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2", + "doctrine/cache": "^1.11|^2.0", + "doctrine/deprecations": "^0.5.3|^1", + "doctrine/event-manager": "^1|^2", + "php": "^7.4 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" + }, + "require-dev": { + "doctrine/coding-standard": "12.0.0", + "fig/log-test": "^1", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.10.35", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "9.6.13", + "psalm/plugin-phpunit": "0.18.4", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.7.2", + "symfony/cache": "^5.4|^6.0", + "symfony/console": "^4.4|^5.4|^6.0", + "vimeo/psalm": "4.30.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/3.7.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], + "time": "2023-10-06T05:06:20+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + }, + "time": "2024-01-30T19:34:25+00:00" + }, + { + "name": "doctrine/event-manager", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/750671534e0241a7c50ea5b43f67e23eb5c96f32", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8.8", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.28" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/2.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2022-10-12T20:59:15+00:00" + }, + { + "name": "doctrine/inflector", + "version": "2.0.10", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^11.0", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^8.5 || ^9.5", + "vimeo/psalm": "^4.25 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.0.10" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "time": "2024-02-18T20:23:39+00:00" + }, + { + "name": "doctrine/lexer", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", + "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "^1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^4.11 || ^5.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/2.1.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2024-02-05T11:35:39+00:00" + }, + { + "name": "dompdf/dompdf", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/dompdf/dompdf.git", + "reference": "093f2d9739cec57428e39ddadedfd4f3ae862c0f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/093f2d9739cec57428e39ddadedfd4f3ae862c0f", + "reference": "093f2d9739cec57428e39ddadedfd4f3ae862c0f", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "masterminds/html5": "^2.0", + "phenx/php-font-lib": ">=0.5.4 <1.0.0", + "phenx/php-svg-lib": ">=0.3.3 <1.0.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "ext-json": "*", + "ext-zip": "*", + "mockery/mockery": "^1.3", + "phpunit/phpunit": "^7.5 || ^8 || ^9", + "squizlabs/php_codesniffer": "^3.5" + }, + "suggest": { + "ext-gd": "Needed to process images", + "ext-gmagick": "Improves image processing performance", + "ext-imagick": "Improves image processing performance", + "ext-zlib": "Needed for pdf stream compression" + }, + "type": "library", + "autoload": { + "psr-4": { + "Dompdf\\": "src/" + }, + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "The Dompdf Community", + "homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md" + } + ], + "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", + "homepage": "https://github.com/dompdf/dompdf", + "support": { + "issues": "https://github.com/dompdf/dompdf/issues", + "source": "https://github.com/dompdf/dompdf/tree/v2.0.4" + }, + "time": "2023-12-12T20:19:39+00:00" + }, + { + "name": "dragonmantank/cron-expression", + "version": "v3.3.3", + "source": { + "type": "git", + "url": "https://github.com/dragonmantank/cron-expression.git", + "reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/adfb1f505deb6384dc8b39804c5065dd3c8c8c0a", + "reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "webmozart/assert": "^1.0" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-webmozart-assert": "^1.0", + "phpunit/phpunit": "^7.0|^8.0|^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cron\\": "src/Cron/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Tankersley", + "email": "chris@ctankersley.com", + "homepage": "https://github.com/dragonmantank" + } + ], + "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", + "keywords": [ + "cron", + "schedule" + ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.3" + }, + "funding": [ + { + "url": "https://github.com/dragonmantank", + "type": "github" + } + ], + "time": "2023-08-10T19:36:49+00:00" + }, + { + "name": "drewm/mailchimp-api", + "version": "v2.5.4", + "source": { + "type": "git", + "url": "https://github.com/drewm/mailchimp-api.git", + "reference": "c6cdfab4ca6ddbc3b260913470bd0a4a5cb84c7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/c6cdfab4ca6ddbc3b260913470bd0a4a5cb84c7a", + "reference": "c6cdfab4ca6ddbc3b260913470bd0a4a5cb84c7a", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "7.0.*", + "vlucas/phpdotenv": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "DrewM\\MailChimp\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Drew McLellan", + "email": "drew.mclellan@gmail.com", + "homepage": "http://allinthehead.com/" + } + ], + "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper", + "homepage": "https://github.com/drewm/mailchimp-api", + "support": { + "issues": "https://github.com/drewm/mailchimp-api/issues", + "source": "https://github.com/drewm/mailchimp-api/tree/master" + }, + "time": "2019-08-06T09:24:58+00:00" + }, + { + "name": "egulias/email-validator", + "version": "3.2.6", + "source": { + "type": "git", + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7", + "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^1.2|^2", + "php": ">=7.2", + "symfony/polyfill-intl-idn": "^1.15" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.8|^9.3.3", + "vimeo/psalm": "^4" + }, + "suggest": { + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Egulias\\EmailValidator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gulias Davis" + } + ], + "description": "A library for validating emails against several RFCs", + "homepage": "https://github.com/egulias/EmailValidator", + "keywords": [ + "email", + "emailvalidation", + "emailvalidator", + "validation", + "validator" + ], + "support": { + "issues": "https://github.com/egulias/EmailValidator/issues", + "source": "https://github.com/egulias/EmailValidator/tree/3.2.6" + }, + "funding": [ + { + "url": "https://github.com/egulias", + "type": "github" + } + ], + "time": "2023-06-01T07:04:22+00:00" + }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.17.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/bbc513d79acf6691fa9cf10f192c90dd2957f18c", + "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c", + "shasum": "" + }, + "require": { + "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" + }, + "require-dev": { + "cerdic/css-tidy": "^1.7 || ^2.0", + "simpletest/simpletest": "dev-master" + }, + "suggest": { + "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.", + "ext-bcmath": "Used for unit conversion and imagecrash protection", + "ext-iconv": "Converts text to and from non-UTF-8 encodings", + "ext-tidy": "Used for pretty-printing HTML" + }, + "type": "library", + "autoload": { + "files": [ + "library/HTMLPurifier.composer.php" + ], + "psr-0": { + "HTMLPurifier": "library/" + }, + "exclude-from-classmap": [ + "/library/HTMLPurifier/Language/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "support": { + "issues": "https://github.com/ezyang/htmlpurifier/issues", + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.17.0" + }, + "time": "2023-11-17T15:01:25+00:00" + }, + { + "name": "firebase/php-jwt", + "version": "v6.10.0", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "a49db6f0a5033aef5143295342f1c95521b075ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/a49db6f0a5033aef5143295342f1c95521b075ff", + "reference": "a49db6f0a5033aef5143295342f1c95521b075ff", + "shasum": "" + }, + "require": { + "php": "^7.4||^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.5||^7.4", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "psr/cache": "^1.0||^2.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-sodium": "Support EdDSA (Ed25519) signatures", + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" + }, + "type": "library", + "autoload": { + "psr-4": { + "Firebase\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" + }, + { + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" + } + ], + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", + "keywords": [ + "jwt", + "php" + ], + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v6.10.0" + }, + "time": "2023-12-01T16:26:39+00:00" + }, + { + "name": "fruitcake/php-cors", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/fruitcake/php-cors.git", + "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/3d158f36e7875e2f040f37bc0573956240a5a38b", + "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0", + "symfony/http-foundation": "^4.4|^5.4|^6|^7" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^9", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Fruitcake\\Cors\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fruitcake", + "homepage": "https://fruitcake.nl" + }, + { + "name": "Barryvdh", + "email": "barryvdh@gmail.com" + } + ], + "description": "Cross-origin resource sharing library for the Symfony HttpFoundation", + "homepage": "https://github.com/fruitcake/php-cors", + "keywords": [ + "cors", + "laravel", + "symfony" + ], + "support": { + "issues": "https://github.com/fruitcake/php-cors/issues", + "source": "https://github.com/fruitcake/php-cors/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2023-10-12T05:21:21+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.1.2", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/fbd48bce38f73f8a4ec8583362e732e4095e5862", + "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2023-11-12T22:16:48+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.8.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "ext-curl": "*", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2023-08-27T10:20:53+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.36 || ^9.6.15" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2023-12-03T20:19:20+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.6.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.36 || ^9.6.15" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.6.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2023-12-03T20:05:35+00:00" + }, + { + "name": "guzzlehttp/uri-template", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/uri-template.git", + "reference": "ecea8feef63bd4fef1f037ecb288386999ecc11c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/ecea8feef63bd4fef1f037ecb288386999ecc11c", + "reference": "ecea8feef63bd4fef1f037ecb288386999ecc11c", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "symfony/polyfill-php80": "^1.24" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "uri-template/tests": "1.0.0" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\UriTemplate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + } + ], + "description": "A polyfill class for uri_template of PHP", + "keywords": [ + "guzzlehttp", + "uri-template" + ], + "support": { + "issues": "https://github.com/guzzle/uri-template/issues", + "source": "https://github.com/guzzle/uri-template/tree/v1.0.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/uri-template", + "type": "tidelift" + } + ], + "time": "2023-12-03T19:50:20+00:00" + }, + { + "name": "haydenpierce/class-finder", + "version": "0.4.4", + "source": { + "type": "git", + "url": "git@gitlab.com:hpierce1102/ClassFinder.git", + "reference": "94c602870ddf8d4fa2d67fb9bae637d88f9bd76e" + }, + "dist": { + "type": "zip", + "url": "https://gitlab.com/api/v4/projects/hpierce1102%2FClassFinder/repository/archive.zip?sha=94c602870ddf8d4fa2d67fb9bae637d88f9bd76e", + "reference": "94c602870ddf8d4fa2d67fb9bae637d88f9bd76e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "~9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "HaydenPierce\\ClassFinder\\": "src/", + "HaydenPierce\\ClassFinder\\UnitTest\\": "test/unit" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Hayden Pierce", + "email": "hayden@haydenpierce.com" + } + ], + "description": "A library that can provide of a list of classes in a given namespace", + "time": "2022-09-26T22:42:59+00:00" + }, + { + "name": "intervention/image", + "version": "2.7.2", + "source": { + "type": "git", + "url": "https://github.com/Intervention/image.git", + "reference": "04be355f8d6734c826045d02a1079ad658322dad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/image/zipball/04be355f8d6734c826045d02a1079ad658322dad", + "reference": "04be355f8d6734c826045d02a1079ad658322dad", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "guzzlehttp/psr7": "~1.1 || ^2.0", + "php": ">=5.4.0" + }, + "require-dev": { + "mockery/mockery": "~0.9.2", + "phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15" + }, + "suggest": { + "ext-gd": "to use GD library based image processing.", + "ext-imagick": "to use Imagick based image processing.", + "intervention/imagecache": "Caching extension for the Intervention Image library" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + }, + "laravel": { + "providers": [ + "Intervention\\Image\\ImageServiceProvider" + ], + "aliases": { + "Image": "Intervention\\Image\\Facades\\Image" + } + } + }, + "autoload": { + "psr-4": { + "Intervention\\Image\\": "src/Intervention/Image" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@intervention.io", + "homepage": "https://intervention.io/" + } + ], + "description": "Image handling and manipulation library with support for Laravel integration", + "homepage": "http://image.intervention.io/", + "keywords": [ + "gd", + "image", + "imagick", + "laravel", + "thumbnail", + "watermark" + ], + "support": { + "issues": "https://github.com/Intervention/image/issues", + "source": "https://github.com/Intervention/image/tree/2.7.2" + }, + "funding": [ + { + "url": "https://paypal.me/interventionio", + "type": "custom" + }, + { + "url": "https://github.com/Intervention", + "type": "github" + } + ], + "time": "2022-05-21T17:30:32+00:00" + }, + { + "name": "iyzico/iyzipay-php", + "version": "v2.0.54", + "source": { + "type": "git", + "url": "https://github.com/iyzico/iyzipay-php.git", + "reference": "4a5874a63582e92338662782887da757de62c646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/iyzico/iyzipay-php/zipball/4a5874a63582e92338662782887da757de62c646", + "reference": "4a5874a63582e92338662782887da757de62c646", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "~0.6.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Iyzipay\\": "src/Iyzipay/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "iyzico and contributors", + "homepage": "https://github.com/iyzico/iyzipay-php/contributors" + } + ], + "description": "iyzipay api php client", + "homepage": "https://www.iyzico.com", + "keywords": [ + "iyzico", + "iyzico.com", + "iyzipay", + "iyzipay api", + "iyzipay api php", + "iyzipay api php client", + "iyzipay php", + "payment processing" + ], + "support": { + "issues": "https://github.com/iyzico/iyzipay-php/issues", + "source": "https://github.com/iyzico/iyzipay-php/tree/v2.0.54" + }, + "time": "2023-08-25T08:49:48+00:00" + }, + { + "name": "karim007/laravel-bkash-tokenize", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/CodersFaruk/laravel-bkash-tokenize.git", + "reference": "785338254a632518f0090b3725d171c5c16eeb60" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CodersFaruk/laravel-bkash-tokenize/zipball/785338254a632518f0090b3725d171c5c16eeb60", + "reference": "785338254a632518f0090b3725d171c5c16eeb60", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "illuminate/support": "~6|~7|~8|~9|~10", + "php": "^7.4|^8.0|^8.1" + }, + "default-branch": true, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Karim007\\LaravelBkashTokenize\\BkashTokenizeServiceProvider" + ], + "aliases": { + "LaravelBkashTokenize": "Karim007\\LaravelBkashTokenize\\LaravelBkashTokenize" + } + } + }, + "autoload": { + "psr-4": { + "Karim007\\LaravelBkashTokenize\\": "src/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Md abdul karim", + "email": "karim.cse007@gmail.com" + } + ], + "description": "This is bKash tokenize payment gateway for laravel", + "keywords": [ + "bkash", + "bkash-payment", + "bkash-payment-gateway", + "laravel-bkash", + "laravel-bkash-payment", + "laravel-bkash-payment-tokenize" + ], + "support": { + "source": "https://github.com/CodersFaruk/laravel-bkash-tokenize/tree/main" + }, + "time": "2023-04-04T05:18:26+00:00" + }, + { + "name": "kingflamez/laravelrave", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/CodersFaruk/laravel-flutterwave.git", + "reference": "f13187d29c37ee6159ee7df2c7b087f00230f93c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CodersFaruk/laravel-flutterwave/zipball/f13187d29c37ee6159ee7df2c7b087f00230f93c", + "reference": "f13187d29c37ee6159ee7df2c7b087f00230f93c", + "shasum": "" + }, + "require": { + "illuminate/support": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0", + "php": "^7.2|^8.0|^8.3" + }, + "require-dev": { + "mockery/mockery": ">1.2", + "orchestra/testbench": ">4.0", + "phpunit/phpunit": "^8.3", + "satooshi/php-coveralls": ">0.7", + "scrutinizer/ocular": "^1.1" + }, + "default-branch": true, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "KingFlamez\\Rave\\RaveServiceProvider" + ], + "aliases": { + "Rave": "KingFlamez\\Rave\\Facades\\Rave" + } + } + }, + "autoload": { + "classmap": [ + "src/Rave.php" + ], + "psr-4": { + "KingFlamez\\Rave\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + } + }, + "scripts": { + "tests": [ + "vendor/bin/phpunit --coverage-clover=\"clover.xml\"" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "kingflamez", + "email": "flamekeed@gmail.com" + } + ], + "description": "A Laravel 5 Package for Flutterwave Rave", + "keywords": [ + "Flutterwave", + "Flutterwave Rave", + "Open Source", + "github", + "kingflamez", + "laravel", + "laravel 5", + "payments", + "php", + "rave", + "ravepay.co" + ], + "support": { + "source": "https://github.com/CodersFaruk/laravel-flutterwave/tree/master" + }, + "time": "2023-03-17T09:01:13+00:00" + }, + { + "name": "kodeine/laravel-meta", + "version": "2.2.1", + "source": { + "type": "git", + "url": "https://github.com/kodeine/laravel-meta.git", + "reference": "fcdfb7b9ba79e310badd3d904b508bf8cdc57234" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kodeine/laravel-meta/zipball/fcdfb7b9ba79e310badd3d904b508bf8cdc57234", + "reference": "fcdfb7b9ba79e310badd3d904b508bf8cdc57234", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/database": "^8.0|^9.0|^10.0", + "illuminate/events": "^8.0|^9.0|^10.0", + "illuminate/support": "^8.0|^9.0|^10.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "Kodeine\\Metable\\": "src/" + }, + "classmap": [] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ahsen M.", + "homepage": "https://github.com/kodeine", + "role": "Developer" + } + ], + "description": "Fluent Meta Data for Eloquent Models, as if it is a property on your model.", + "keywords": [ + "data", + "eloquent", + "kodeine", + "laravel", + "meta", + "meta data", + "metable", + "metadata", + "metas", + "model" + ], + "support": { + "issues": "https://github.com/kodeine/laravel-meta/issues", + "source": "https://github.com/kodeine/laravel-meta/tree/2.2.1" + }, + "time": "2023-07-05T20:54:23+00:00" + }, + { + "name": "laminas/laminas-code", + "version": "4.13.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-code.git", + "reference": "7353d4099ad5388e84737dd16994316a04f48dbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-code/zipball/7353d4099ad5388e84737dd16994316a04f48dbf", + "reference": "7353d4099ad5388e84737dd16994316a04f48dbf", + "shasum": "" + }, + "require": { + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0.1", + "ext-phar": "*", + "laminas/laminas-coding-standard": "^2.5.0", + "laminas/laminas-stdlib": "^3.17.0", + "phpunit/phpunit": "^10.3.3", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.15.0" + }, + "suggest": { + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", + "laminas/laminas-stdlib": "Laminas\\Stdlib component" + }, + "type": "library", + "autoload": { + "psr-4": { + "Laminas\\Code\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Extensions to the PHP Reflection API, static code scanning, and code generation", + "homepage": "https://laminas.dev", + "keywords": [ + "code", + "laminas", + "laminasframework" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-code/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-code/issues", + "rss": "https://github.com/laminas/laminas-code/releases.atom", + "source": "https://github.com/laminas/laminas-code" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2023-10-18T10:00:55+00:00" + }, + { + "name": "laragraph/utils", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/laragraph/utils.git", + "reference": "802c2c27076842fee491587ba6abeec9f0c5e271" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laragraph/utils/zipball/802c2c27076842fee491587ba6abeec9f0c5e271", + "reference": "802c2c27076842fee491587ba6abeec9f0c5e271", + "shasum": "" + }, + "require": { + "illuminate/contracts": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "illuminate/http": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "php": "^7.2 || ^8", + "thecodingmachine/safe": "^1.1 || ^2", + "webonyx/graphql-php": "^0.13.2 || ^14 || ^15" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.11", + "jangregor/phpstan-prophecy": "^1", + "mll-lab/php-cs-fixer-config": "^4.4", + "orchestra/testbench": "3.6.* || 3.7.* || 3.8.* || 3.9.* || ^4 || ^5 || ^6 || ^7 || ^8", + "phpstan/extension-installer": "^1", + "phpstan/phpstan": "^1", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9", + "thecodingmachine/phpstan-safe-rule": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Laragraph\\Utils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Benedikt Franke", + "email": "benedikt@franke.tech" + } + ], + "description": "Utilities for using GraphQL with Laravel", + "homepage": "https://github.com/laragraph/utils", + "support": { + "issues": "https://github.com/laragraph/utils/issues", + "source": "https://github.com/laragraph/utils" + }, + "time": "2023-01-31T11:37:28+00:00" + }, + { + "name": "laravel/framework", + "version": "v10.30.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/framework.git", + "reference": "7a2da50258c4d0f693b738d3f3c69b2693aea6c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/framework/zipball/7a2da50258c4d0f693b738d3f3c69b2693aea6c1", + "reference": "7a2da50258c4d0f693b738d3f3c69b2693aea6c1", + "shasum": "" + }, + "require": { + "brick/math": "^0.9.3|^0.10.2|^0.11", + "composer-runtime-api": "^2.2", + "doctrine/inflector": "^2.0.5", + "dragonmantank/cron-expression": "^3.3.2", + "egulias/email-validator": "^3.2.1|^4.0", + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-session": "*", + "ext-tokenizer": "*", + "fruitcake/php-cors": "^1.2", + "guzzlehttp/uri-template": "^1.0", + "laravel/prompts": "^0.1.9", + "laravel/serializable-closure": "^1.3", + "league/commonmark": "^2.2.1", + "league/flysystem": "^3.8.0", + "monolog/monolog": "^3.0", + "nesbot/carbon": "^2.67", + "nunomaduro/termwind": "^1.13", + "php": "^8.1", + "psr/container": "^1.1.1|^2.0.1", + "psr/log": "^1.0|^2.0|^3.0", + "psr/simple-cache": "^1.0|^2.0|^3.0", + "ramsey/uuid": "^4.7", + "symfony/console": "^6.2", + "symfony/error-handler": "^6.2", + "symfony/finder": "^6.2", + "symfony/http-foundation": "^6.3", + "symfony/http-kernel": "^6.2", + "symfony/mailer": "^6.2", + "symfony/mime": "^6.2", + "symfony/process": "^6.2", + "symfony/routing": "^6.2", + "symfony/uid": "^6.2", + "symfony/var-dumper": "^6.2", + "tijsverkoyen/css-to-inline-styles": "^2.2.5", + "vlucas/phpdotenv": "^5.4.1", + "voku/portable-ascii": "^2.0" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "provide": { + "psr/container-implementation": "1.1|2.0", + "psr/simple-cache-implementation": "1.0|2.0|3.0" + }, + "replace": { + "illuminate/auth": "self.version", + "illuminate/broadcasting": "self.version", + "illuminate/bus": "self.version", + "illuminate/cache": "self.version", + "illuminate/collections": "self.version", + "illuminate/conditionable": "self.version", + "illuminate/config": "self.version", + "illuminate/console": "self.version", + "illuminate/container": "self.version", + "illuminate/contracts": "self.version", + "illuminate/cookie": "self.version", + "illuminate/database": "self.version", + "illuminate/encryption": "self.version", + "illuminate/events": "self.version", + "illuminate/filesystem": "self.version", + "illuminate/hashing": "self.version", + "illuminate/http": "self.version", + "illuminate/log": "self.version", + "illuminate/macroable": "self.version", + "illuminate/mail": "self.version", + "illuminate/notifications": "self.version", + "illuminate/pagination": "self.version", + "illuminate/pipeline": "self.version", + "illuminate/process": "self.version", + "illuminate/queue": "self.version", + "illuminate/redis": "self.version", + "illuminate/routing": "self.version", + "illuminate/session": "self.version", + "illuminate/support": "self.version", + "illuminate/testing": "self.version", + "illuminate/translation": "self.version", + "illuminate/validation": "self.version", + "illuminate/view": "self.version" + }, + "require-dev": { + "ably/ably-php": "^1.0", + "aws/aws-sdk-php": "^3.235.5", + "doctrine/dbal": "^3.5.1", + "ext-gmp": "*", + "fakerphp/faker": "^1.21", + "guzzlehttp/guzzle": "^7.5", + "league/flysystem-aws-s3-v3": "^3.0", + "league/flysystem-ftp": "^3.0", + "league/flysystem-path-prefixing": "^3.3", + "league/flysystem-read-only": "^3.3", + "league/flysystem-sftp-v3": "^3.0", + "mockery/mockery": "^1.5.1", + "nyholm/psr7": "^1.2", + "orchestra/testbench-core": "^8.12", + "pda/pheanstalk": "^4.0", + "phpstan/phpstan": "^1.4.7", + "phpunit/phpunit": "^10.0.7", + "predis/predis": "^2.0.2", + "symfony/cache": "^6.2", + "symfony/http-client": "^6.2.4", + "symfony/psr-http-message-bridge": "^2.0" + }, + "suggest": { + "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", + "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.235.5).", + "brianium/paratest": "Required to run tests in parallel (^6.0).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^3.5.1).", + "ext-apcu": "Required to use the APC cache driver.", + "ext-fileinfo": "Required to use the Filesystem class.", + "ext-ftp": "Required to use the Flysystem FTP driver.", + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", + "ext-memcached": "Required to use the memcache cache driver.", + "ext-pcntl": "Required to use all features of the queue worker and console signal trapping.", + "ext-pdo": "Required to use all database features.", + "ext-posix": "Required to use all features of the queue worker.", + "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).", + "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", + "filp/whoops": "Required for friendly error pages in development (^2.14.3).", + "guzzlehttp/guzzle": "Required to use the HTTP Client and the ping methods on schedules (^7.5).", + "laravel/tinker": "Required to use the tinker console command (^2.0).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", + "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", + "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.3).", + "league/flysystem-read-only": "Required to use read-only disks (^3.3)", + "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", + "mockery/mockery": "Required to use mocking (^1.5.1).", + "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", + "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", + "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8|^10.0.7).", + "predis/predis": "Required to use the predis connector (^2.0.2).", + "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^6.2).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^6.2).", + "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.2).", + "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.2).", + "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.2).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "10.x-dev" + } + }, + "autoload": { + "files": [ + "src/Illuminate/Collections/helpers.php", + "src/Illuminate/Events/functions.php", + "src/Illuminate/Foundation/helpers.php", + "src/Illuminate/Support/helpers.php" + ], + "psr-4": { + "Illuminate\\": "src/Illuminate/", + "Illuminate\\Support\\": [ + "src/Illuminate/Macroable/", + "src/Illuminate/Collections/", + "src/Illuminate/Conditionable/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Laravel Framework.", + "homepage": "https://laravel.com", + "keywords": [ + "framework", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2023-11-01T13:52:17+00:00" + }, + { + "name": "laravel/legacy-factories", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/laravel/legacy-factories.git", + "reference": "cc6720da81094c82ea9f4737d615dd3d71f7f43d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/legacy-factories/zipball/cc6720da81094c82ea9f4737d615dd3d71f7f43d", + "reference": "cc6720da81094c82ea9f4737d615dd3d71f7f43d", + "shasum": "" + }, + "require": { + "illuminate/macroable": "^8.0|^9.0|^10.0", + "php": "^7.3|^8.0", + "symfony/finder": "^3.4|^4.0|^5.0|^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "laravel": { + "providers": [ + "Illuminate\\Database\\Eloquent\\LegacyFactoryServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "helpers.php" + ], + "psr-4": { + "Illuminate\\Database\\Eloquent\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The legacy version of the Laravel Eloquent factories.", + "homepage": "http://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2023-01-09T14:49:00+00:00" + }, + { + "name": "laravel/prompts", + "version": "v0.1.15", + "source": { + "type": "git", + "url": "https://github.com/laravel/prompts.git", + "reference": "d814a27514d99b03c85aa42b22cfd946568636c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/prompts/zipball/d814a27514d99b03c85aa42b22cfd946568636c1", + "reference": "d814a27514d99b03c85aa42b22cfd946568636c1", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "illuminate/collections": "^10.0|^11.0", + "php": "^8.1", + "symfony/console": "^6.2|^7.0" + }, + "conflict": { + "illuminate/console": ">=10.17.0 <10.25.0", + "laravel/framework": ">=10.17.0 <10.25.0" + }, + "require-dev": { + "mockery/mockery": "^1.5", + "pestphp/pest": "^2.3", + "phpstan/phpstan": "^1.11", + "phpstan/phpstan-mockery": "^1.1" + }, + "suggest": { + "ext-pcntl": "Required for the spinner to be animated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.1.x-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Laravel\\Prompts\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "support": { + "issues": "https://github.com/laravel/prompts/issues", + "source": "https://github.com/laravel/prompts/tree/v0.1.15" + }, + "time": "2023-12-29T22:37:42+00:00" + }, + { + "name": "laravel/sanctum", + "version": "v3.3.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/sanctum.git", + "reference": "338f633e6487e76b255470d3373fbc29228aa971" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/sanctum/zipball/338f633e6487e76b255470d3373fbc29228aa971", + "reference": "338f633e6487e76b255470d3373fbc29228aa971", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/console": "^9.21|^10.0", + "illuminate/contracts": "^9.21|^10.0", + "illuminate/database": "^9.21|^10.0", + "illuminate/support": "^9.21|^10.0", + "php": "^8.0.2" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "orchestra/testbench": "^7.28.2|^8.8.3", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Sanctum\\SanctumServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Sanctum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.", + "keywords": [ + "auth", + "laravel", + "sanctum" + ], + "support": { + "issues": "https://github.com/laravel/sanctum/issues", + "source": "https://github.com/laravel/sanctum" + }, + "time": "2023-09-07T15:46:33+00:00" + }, + { + "name": "laravel/serializable-closure", + "version": "v1.3.3", + "source": { + "type": "git", + "url": "https://github.com/laravel/serializable-closure.git", + "reference": "3dbf8a8e914634c48d389c1234552666b3d43754" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/3dbf8a8e914634c48d389c1234552666b3d43754", + "reference": "3dbf8a8e914634c48d389c1234552666b3d43754", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "nesbot/carbon": "^2.61", + "pestphp/pest": "^1.21.3", + "phpstan/phpstan": "^1.8.2", + "symfony/var-dumper": "^5.4.11" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\SerializableClosure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "nuno@laravel.com" + } + ], + "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", + "keywords": [ + "closure", + "laravel", + "serializable" + ], + "support": { + "issues": "https://github.com/laravel/serializable-closure/issues", + "source": "https://github.com/laravel/serializable-closure" + }, + "time": "2023-11-08T14:08:06+00:00" + }, + { + "name": "laravel/socialite", + "version": "v5.10.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/socialite.git", + "reference": "f376b6eda9084899e37ac08bafd64a95edf9c6c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/socialite/zipball/f376b6eda9084899e37ac08bafd64a95edf9c6c0", + "reference": "f376b6eda9084899e37ac08bafd64a95edf9c6c0", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/guzzle": "^6.0|^7.0", + "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/http": "^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0", + "league/oauth1-client": "^1.10.1", + "php": "^7.2|^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.0|^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Socialite\\SocialiteServiceProvider" + ], + "aliases": { + "Socialite": "Laravel\\Socialite\\Facades\\Socialite" + } + } + }, + "autoload": { + "psr-4": { + "Laravel\\Socialite\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel wrapper around OAuth 1 & OAuth 2 libraries.", + "homepage": "https://laravel.com", + "keywords": [ + "laravel", + "oauth" + ], + "support": { + "issues": "https://github.com/laravel/socialite/issues", + "source": "https://github.com/laravel/socialite" + }, + "time": "2023-10-30T22:09:58+00:00" + }, + { + "name": "laravel/tinker", + "version": "v2.8.2", + "source": { + "type": "git", + "url": "https://github.com/laravel/tinker.git", + "reference": "b936d415b252b499e8c3b1f795cd4fc20f57e1f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/tinker/zipball/b936d415b252b499e8c3b1f795cd4fc20f57e1f3", + "reference": "b936d415b252b499e8c3b1f795cd4fc20f57e1f3", + "shasum": "" + }, + "require": { + "illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0", + "php": "^7.2.5|^8.0", + "psy/psysh": "^0.10.4|^0.11.1", + "symfony/var-dumper": "^4.3.4|^5.0|^6.0" + }, + "require-dev": { + "mockery/mockery": "~1.3.3|^1.4.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5.8|^9.3.3" + }, + "suggest": { + "illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0|^9.0|^10.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Tinker\\TinkerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Tinker\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Powerful REPL for the Laravel framework.", + "keywords": [ + "REPL", + "Tinker", + "laravel", + "psysh" + ], + "support": { + "issues": "https://github.com/laravel/tinker/issues", + "source": "https://github.com/laravel/tinker/tree/v2.8.2" + }, + "time": "2023-08-15T14:27:00+00:00" + }, + { + "name": "league/commonmark", + "version": "2.4.2", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "91c24291965bd6d7c46c46a12ba7492f83b1cadf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/91c24291965bd6d7c46c46a12ba7492f83b1cadf", + "reference": "91c24291965bd6d7c46c46a12ba7492f83b1cadf", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "league/config": "^1.1.1", + "php": "^7.4 || ^8.0", + "psr/event-dispatcher": "^1.0", + "symfony/deprecation-contracts": "^2.1 || ^3.0", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "cebe/markdown": "^1.0", + "commonmark/cmark": "0.30.3", + "commonmark/commonmark.js": "0.30.0", + "composer/package-versions-deprecated": "^1.8", + "embed/embed": "^4.4", + "erusev/parsedown": "^1.0", + "ext-json": "*", + "github/gfm": "0.29.0", + "michelf/php-markdown": "^1.4 || ^2.0", + "nyholm/psr7": "^1.5", + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0", + "scrutinizer/ocular": "^1.8.1", + "symfony/finder": "^5.3 | ^6.0 || ^7.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 || ^7.0", + "unleashedtech/php-coding-standard": "^3.1.1", + "vimeo/psalm": "^4.24.0 || ^5.0.0" + }, + "suggest": { + "symfony/yaml": "v2.3+ required if using the Front Matter extension" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + } + }, + "autoload": { + "psr-4": { + "League\\CommonMark\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)", + "homepage": "https://commonmark.thephpleague.com", + "keywords": [ + "commonmark", + "flavored", + "gfm", + "github", + "github-flavored", + "markdown", + "md", + "parser" + ], + "support": { + "docs": "https://commonmark.thephpleague.com/", + "forum": "https://github.com/thephpleague/commonmark/discussions", + "issues": "https://github.com/thephpleague/commonmark/issues", + "rss": "https://github.com/thephpleague/commonmark/releases.atom", + "source": "https://github.com/thephpleague/commonmark" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/commonmark", + "type": "tidelift" + } + ], + "time": "2024-02-02T11:59:32+00:00" + }, + { + "name": "league/config", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/config.git", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^3.0.1", + "nette/schema": "^1.2", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.5", + "scrutinizer/ocular": "^1.8.1", + "unleashedtech/php-coding-standard": "^3.1", + "vimeo/psalm": "^4.7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Define configuration arrays with strict schemas and access values with dot notation", + "homepage": "https://config.thephpleague.com", + "keywords": [ + "array", + "config", + "configuration", + "dot", + "dot-access", + "nested", + "schema" + ], + "support": { + "docs": "https://config.thephpleague.com/", + "issues": "https://github.com/thephpleague/config/issues", + "rss": "https://github.com/thephpleague/config/releases.atom", + "source": "https://github.com/thephpleague/config" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + } + ], + "time": "2022-12-11T20:36:23+00:00" + }, + { + "name": "league/flysystem", + "version": "3.24.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "b25a361508c407563b34fac6f64a8a17a8819675" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/b25a361508c407563b34fac6f64a8a17a8819675", + "reference": "b25a361508c407563b34fac6f64a8a17a8819675", + "shasum": "" + }, + "require": { + "league/flysystem-local": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "conflict": { + "async-aws/core": "<1.19.0", + "async-aws/s3": "<1.14.0", + "aws/aws-sdk-php": "3.209.31 || 3.210.0", + "guzzlehttp/guzzle": "<7.0", + "guzzlehttp/ringphp": "<1.1.1", + "phpseclib/phpseclib": "3.0.15", + "symfony/http-client": "<5.2" + }, + "require-dev": { + "async-aws/s3": "^1.5 || ^2.0", + "async-aws/simple-s3": "^1.1 || ^2.0", + "aws/aws-sdk-php": "^3.295.10", + "composer/semver": "^3.0", + "ext-fileinfo": "*", + "ext-ftp": "*", + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.5", + "google/cloud-storage": "^1.23", + "microsoft/azure-storage-blob": "^1.1", + "phpseclib/phpseclib": "^3.0.34", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.11|^10.0", + "sabre/dav": "^4.6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "File storage abstraction for PHP", + "keywords": [ + "WebDAV", + "aws", + "cloud", + "file", + "files", + "filesystem", + "filesystems", + "ftp", + "s3", + "sftp", + "storage" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/3.24.0" + }, + "funding": [ + { + "url": "https://ecologi.com/frankdejonge", + "type": "custom" + }, + { + "url": "https://github.com/frankdejonge", + "type": "github" + } + ], + "time": "2024-02-04T12:10:17+00:00" + }, + { + "name": "league/flysystem-aws-s3-v3", + "version": "3.16.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git", + "reference": "ded9ba346bb01cb9cc4cc7f2743c2c0e14d18e1c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/ded9ba346bb01cb9cc4cc7f2743c2c0e14d18e1c", + "reference": "ded9ba346bb01cb9cc4cc7f2743c2c0e14d18e1c", + "shasum": "" + }, + "require": { + "aws/aws-sdk-php": "^3.220.0", + "league/flysystem": "^3.10.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "conflict": { + "guzzlehttp/guzzle": "<7.0", + "guzzlehttp/ringphp": "<1.1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\AwsS3V3\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "AWS S3 filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "aws", + "file", + "files", + "filesystem", + "s3", + "storage" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues", + "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.16.0" + }, + "funding": [ + { + "url": "https://ecologi.com/frankdejonge", + "type": "custom" + }, + { + "url": "https://github.com/frankdejonge", + "type": "github" + } + ], + "time": "2023-08-30T10:14:57+00:00" + }, + { + "name": "league/flysystem-local", + "version": "3.23.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-local.git", + "reference": "b884d2bf9b53bb4804a56d2df4902bb51e253f00" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/b884d2bf9b53bb4804a56d2df4902bb51e253f00", + "reference": "b884d2bf9b53bb4804a56d2df4902bb51e253f00", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/flysystem": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\Local\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Local filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "file", + "files", + "filesystem", + "local" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem-local/issues", + "source": "https://github.com/thephpleague/flysystem-local/tree/3.23.1" + }, + "funding": [ + { + "url": "https://ecologi.com/frankdejonge", + "type": "custom" + }, + { + "url": "https://github.com/frankdejonge", + "type": "github" + } + ], + "time": "2024-01-26T18:25:23+00:00" + }, + { + "name": "league/glide", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/glide.git", + "reference": "2ff92c8f1edc80b74e2d3c5efccfc7223f74d407" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/glide/zipball/2ff92c8f1edc80b74e2d3c5efccfc7223f74d407", + "reference": "2ff92c8f1edc80b74e2d3c5efccfc7223f74d407", + "shasum": "" + }, + "require": { + "intervention/image": "^2.7", + "league/flysystem": "^2.0|^3.0", + "php": "^7.2|^8.0", + "psr/http-message": "^1.0|^2.0" + }, + "require-dev": { + "mockery/mockery": "^1.3.3", + "phpunit/php-token-stream": "^3.1|^4.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Glide\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Reinink", + "email": "jonathan@reinink.ca", + "homepage": "http://reinink.ca" + }, + { + "name": "Titouan Galopin", + "email": "galopintitouan@gmail.com", + "homepage": "https://titouangalopin.com" + } + ], + "description": "Wonderfully easy on-demand image manipulation library with an HTTP based API.", + "homepage": "http://glide.thephpleague.com", + "keywords": [ + "ImageMagick", + "editing", + "gd", + "image", + "imagick", + "league", + "manipulation", + "processing" + ], + "support": { + "issues": "https://github.com/thephpleague/glide/issues", + "source": "https://github.com/thephpleague/glide/tree/2.3.0" + }, + "time": "2023-07-08T06:26:07+00:00" + }, + { + "name": "league/mime-type-detection", + "version": "1.15.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" + }, + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2024-01-28T23:22:08+00:00" + }, + { + "name": "league/oauth1-client", + "version": "v1.10.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/oauth1-client.git", + "reference": "d6365b901b5c287dd41f143033315e2f777e1167" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/d6365b901b5c287dd41f143033315e2f777e1167", + "reference": "d6365b901b5c287dd41f143033315e2f777e1167", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-openssl": "*", + "guzzlehttp/guzzle": "^6.0|^7.0", + "guzzlehttp/psr7": "^1.7|^2.0", + "php": ">=7.1||>=8.0" + }, + "require-dev": { + "ext-simplexml": "*", + "friendsofphp/php-cs-fixer": "^2.17", + "mockery/mockery": "^1.3.3", + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5||9.5" + }, + "suggest": { + "ext-simplexml": "For decoding XML-based responses." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev", + "dev-develop": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "League\\OAuth1\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Corlett", + "email": "bencorlett@me.com", + "homepage": "http://www.webcomm.com.au", + "role": "Developer" + } + ], + "description": "OAuth 1.0 Client Library", + "keywords": [ + "Authentication", + "SSO", + "authorization", + "bitbucket", + "identity", + "idp", + "oauth", + "oauth1", + "single sign on", + "trello", + "tumblr", + "twitter" + ], + "support": { + "issues": "https://github.com/thephpleague/oauth1-client/issues", + "source": "https://github.com/thephpleague/oauth1-client/tree/v1.10.1" + }, + "time": "2022-04-15T14:02:14+00:00" + }, + { + "name": "luigel/laravel-paymongo", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/luigel/laravel-paymongo.git", + "reference": "1c826daebb3fca1248327a34e35c89bcae72f912" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/luigel/laravel-paymongo/zipball/1c826daebb3fca1248327a34e35c89bcae72f912", + "reference": "1c826daebb3fca1248327a34e35c89bcae72f912", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^7.0", + "illuminate/support": "^8.0|^9.0|^10.0", + "php": "^8.0" + }, + "require-dev": { + "orchestra/testbench": "^6.0|^7.0|^8.0", + "pestphp/pest": "^1.20", + "pestphp/pest-plugin-parallel": "^1.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Luigel\\Paymongo\\PaymongoServiceProvider" + ], + "aliases": { + "Paymongo": "Luigel\\Paymongo\\Facades\\Paymongo" + } + } + }, + "autoload": { + "psr-4": { + "Luigel\\Paymongo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rigel Kent Carbonel", + "email": "rigel20.kent@gmail.com", + "role": "Developer" + } + ], + "description": "A laravel wrapper for Paymongo API", + "homepage": "https://github.com/luigel/laravel-paymongo", + "keywords": [ + "credit-cards", + "debit-cards", + "gcash", + "grabcar", + "laravel", + "laravel-paymongo", + "luigel", + "payment-gateway", + "paymongo" + ], + "support": { + "issues": "https://github.com/luigel/laravel-paymongo/issues", + "source": "https://github.com/luigel/laravel-paymongo/tree/v2.4.0" + }, + "time": "2023-05-22T04:08:03+00:00" + }, + { + "name": "maatwebsite/excel", + "version": "3.1.48", + "source": { + "type": "git", + "url": "https://github.com/SpartnerNL/Laravel-Excel.git", + "reference": "6d0fe2a1d195960c7af7bf0de760582da02a34b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/6d0fe2a1d195960c7af7bf0de760582da02a34b9", + "reference": "6d0fe2a1d195960c7af7bf0de760582da02a34b9", + "shasum": "" + }, + "require": { + "composer/semver": "^3.3", + "ext-json": "*", + "illuminate/support": "5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0", + "php": "^7.0|^8.0", + "phpoffice/phpspreadsheet": "^1.18", + "psr/simple-cache": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "orchestra/testbench": "^6.0|^7.0|^8.0", + "predis/predis": "^1.1" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Maatwebsite\\Excel\\ExcelServiceProvider" + ], + "aliases": { + "Excel": "Maatwebsite\\Excel\\Facades\\Excel" + } + } + }, + "autoload": { + "psr-4": { + "Maatwebsite\\Excel\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Patrick Brouwers", + "email": "patrick@spartner.nl" + } + ], + "description": "Supercharged Excel exports and imports in Laravel", + "keywords": [ + "PHPExcel", + "batch", + "csv", + "excel", + "export", + "import", + "laravel", + "php", + "phpspreadsheet" + ], + "support": { + "issues": "https://github.com/SpartnerNL/Laravel-Excel/issues", + "source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.48" + }, + "funding": [ + { + "url": "https://laravel-excel.com/commercial-support", + "type": "custom" + }, + { + "url": "https://github.com/patrickbrouwers", + "type": "github" + } + ], + "time": "2023-02-22T21:01:38+00:00" + }, + { + "name": "maennchen/zipstream-php", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/maennchen/ZipStream-PHP.git", + "reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/b8174494eda667f7d13876b4a7bfef0f62a7c0d1", + "reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-zlib": "*", + "php-64bit": "^8.1" + }, + "require-dev": { + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.16", + "guzzlehttp/guzzle": "^7.5", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.5", + "phpunit/phpunit": "^10.0", + "vimeo/psalm": "^5.0" + }, + "suggest": { + "guzzlehttp/psr7": "^2.4", + "psr/http-message": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ZipStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paul Duncan", + "email": "pabs@pablotron.org" + }, + { + "name": "Jonatan Männchen", + "email": "jonatan@maennchen.ch" + }, + { + "name": "Jesse Donat", + "email": "donatj@gmail.com" + }, + { + "name": "András Kolesár", + "email": "kolesar@kolesar.hu" + } + ], + "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.", + "keywords": [ + "stream", + "zip" + ], + "support": { + "issues": "https://github.com/maennchen/ZipStream-PHP/issues", + "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.0" + }, + "funding": [ + { + "url": "https://github.com/maennchen", + "type": "github" + }, + { + "url": "https://opencollective.com/zipstream", + "type": "open_collective" + } + ], + "time": "2023-06-21T14:59:35+00:00" + }, + { + "name": "markbaker/complex", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPComplex/issues", + "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2" + }, + "time": "2022-12-06T16:21:08+00:00" + }, + { + "name": "markbaker/matrix", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPMatrix.git", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "^4.0", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "sebastian/phpcpd": "^4.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Matrix\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@demon-angel.eu" + } + ], + "description": "PHP Class for working with matrices", + "homepage": "https://github.com/MarkBaker/PHPMatrix", + "keywords": [ + "mathematics", + "matrix", + "vector" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPMatrix/issues", + "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1" + }, + "time": "2022-12-02T22:17:43+00:00" + }, + { + "name": "marvel/shop", + "version": "dev-master", + "dist": { + "type": "path", + "url": "packages/marvel", + "reference": "2970130a1ed0be9a74a3599ad31507daf00b6f35" + }, + "require": { + "bensampo/laravel-enum": "6.6.4", + "cknow/laravel-money": "7.2.0", + "cviebrock/eloquent-sluggable": "10.0.0", + "dgvai/laravel-sslcommerz": "^1.0", + "drewm/mailchimp-api": "^2.5", + "illuminate/support": "~9|~10", + "iyzico/iyzipay-php": "^2.0", + "kodeine/laravel-meta": "2.2.1", + "laravel/legacy-factories": "1.3.2", + "laravel/sanctum": "3.3.1", + "league/flysystem-aws-s3-v3": "3.16.0", + "luigel/laravel-paymongo": "^2.4", + "maatwebsite/excel": "3.1.48", + "mll-lab/graphql-php-scalars": "5.4.1", + "mll-lab/laravel-graphiql": "^3.1", + "mollie/laravel-mollie": "2.25.0", + "nuwave/lighthouse": "5.71.0", + "openai-php/client": "^0.7.4", + "php-http/guzzle7-adapter": "1.0.0", + "prettus/l5-repository": "2.9.0", + "pusher/pusher-php-server": "^7.2", + "razorpay/razorpay": "2.8.7", + "spatie/laravel-medialibrary": "10.14.0", + "spatie/laravel-newsletter": "5.1.1", + "spatie/laravel-permission": "6.0.0", + "spatie/period": "2.4.0", + "srmklive/paypal": "3.0.19", + "stripe/stripe-php": "13.1.0", + "twilio/sdk": "7.12.0", + "unicodeveloper/laravel-paystack": "1.1.0", + "xendit/xendit-php": "^3.0.0" + }, + "require-dev": { + "mockery/mockery": "1.5.1", + "orchestra/testbench": "8.0.4", + "phpunit/phpunit": "10.0.13", + "sempro/phpunit-pretty-print": "1.4.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Marvel\\ShopServiceProvider" + ], + "aliases": { + "Shop": "Marvel\\Facades\\Shop" + } + } + }, + "autoload": { + "classmap": [ + "src", + "stubs" + ] + }, + "autoload-dev": { + "psr-4": { + "Marvel\\Tests\\": "tests" + } + }, + "license": [ + "license" + ], + "authors": [ + { + "name": "RedQ", + "email": "support@redqteam.com", + "homepage": "https://redq.io" + } + ], + "description": ":package_description", + "homepage": "https://github.com/marvel/gateway", + "keywords": [ + "Laravel", + "Shop" + ], + "transport-options": { + "relative": true + } + }, + { + "name": "masterminds/html5", + "version": "2.8.1", + "source": { + "type": "git", + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "f47dcf3c70c584de14f21143c55d9939631bc6cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f47dcf3c70c584de14f21143c55d9939631bc6cf", + "reference": "f47dcf3c70c584de14f21143c55d9939631bc6cf", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Masterminds\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Butcher", + "email": "technosophos@gmail.com" + }, + { + "name": "Matt Farina", + "email": "matt@mattfarina.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + } + ], + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", + "keywords": [ + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" + ], + "support": { + "issues": "https://github.com/Masterminds/html5-php/issues", + "source": "https://github.com/Masterminds/html5-php/tree/2.8.1" + }, + "time": "2023-05-10T11:58:31+00:00" + }, + { + "name": "messagebird/php-rest-api", + "version": "v3.1.4", + "source": { + "type": "git", + "url": "https://github.com/messagebird/php-rest-api.git", + "reference": "b3f192471c31a84a05081d5ba750a958db6cfc38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/messagebird/php-rest-api/zipball/b3f192471c31a84a05081d5ba750a958db6cfc38", + "reference": "b3f192471c31a84a05081d5ba750a958db6cfc38", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "firebase/php-jwt": "^5.5.1|^6.2", + "php": ">=7.3|~8.0.0|~8.1.0|~8.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5.14", + "vimeo/psalm": "4.18.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "MessageBird\\": "src/MessageBird/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "MessageBird", + "email": "info@messagebird.com" + } + ], + "description": "MessageBird REST API client for PHP", + "homepage": "https://github.com/messagebird/php-rest-api", + "support": { + "docs": "https://developers.messagebird.com/api", + "issues": "https://github.com/messagebird/php-rest-api/issues", + "source": "https://github.com/messagebird/php-rest-api" + }, + "time": "2023-01-16T19:22:44+00:00" + }, + { + "name": "mll-lab/graphql-php-scalars", + "version": "v5.4.1", + "source": { + "type": "git", + "url": "https://github.com/mll-lab/graphql-php-scalars.git", + "reference": "0e71c350f1192819f603db783b92598e00c80549" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mll-lab/graphql-php-scalars/zipball/0e71c350f1192819f603db783b92598e00c80549", + "reference": "0e71c350f1192819f603db783b92598e00c80549", + "shasum": "" + }, + "require": { + "egulias/email-validator": "^2.1.17 || ^3", + "ext-json": "*", + "php": "^7.4 || ^8", + "spatie/regex": "^1.4 || ^2 || ^3", + "thecodingmachine/safe": "^1.3 || ^2", + "webonyx/graphql-php": "^0.13.9 || ^14" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.16", + "friendsofphp/php-cs-fixer": "3.4.*", + "mll-lab/php-cs-fixer-config": "^4.3", + "phpstan/extension-installer": "^1", + "phpstan/phpstan": "^1", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1", + "phpunit/phpunit": "^9", + "symfony/var-dumper": "^5.4 || ^6", + "thecodingmachine/phpstan-safe-rule": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "MLL\\GraphQLScalars\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Benedikt Franke", + "email": "benedikt@franke.tech" + } + ], + "description": "A collection of custom scalar types for usage with https://github.com/webonyx/graphql-php", + "keywords": [ + "graphql", + "php" + ], + "support": { + "issues": "https://github.com/mll-lab/graphql-php-scalars/issues", + "source": "https://github.com/mll-lab/graphql-php-scalars/tree/v5.4.1" + }, + "time": "2022-10-20T19:34:29+00:00" + }, + { + "name": "mll-lab/laravel-graphiql", + "version": "v3.1.0", + "source": { + "type": "git", + "url": "https://github.com/mll-lab/laravel-graphiql.git", + "reference": "54d7dbe5376ab87a6ea83be11b1431d0af9e2f6c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mll-lab/laravel-graphiql/zipball/54d7dbe5376ab87a6ea83be11b1431d0af9e2f6c", + "reference": "54d7dbe5376ab87a6ea83be11b1431d0af9e2f6c", + "shasum": "" + }, + "require": { + "illuminate/console": "^9 || ^10", + "illuminate/contracts": "^9 || ^10", + "illuminate/support": "^9 || ^10", + "php": "^8" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.29", + "laravel/lumen-framework": "^9 || ^10", + "mll-lab/php-cs-fixer-config": "^5", + "nunomaduro/larastan": "^2.5.2", + "orchestra/testbench": "^7.7 || ^8.8", + "phpstan/extension-installer": "^1", + "phpstan/phpstan": "^1.10.15", + "phpstan/phpstan-mockery": "^1.1.1", + "phpstan/phpstan-phpunit": "^1.3.11" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "MLL\\GraphiQL\\GraphiQLServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "MLL\\GraphiQL\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Benedikt Franke", + "email": "benedikt@franke.tech" + } + ], + "description": "Easily integrate GraphiQL into your Laravel project", + "keywords": [ + "graphiql", + "graphql", + "laravel" + ], + "support": { + "issues": "https://github.com/mll-lab/laravel-graphiql/issues", + "source": "https://github.com/mll-lab/laravel-graphiql/tree/v3.1.0" + }, + "time": "2023-07-04T13:58:40+00:00" + }, + { + "name": "mollie/laravel-mollie", + "version": "v2.25.0", + "source": { + "type": "git", + "url": "https://github.com/mollie/laravel-mollie.git", + "reference": "d71e4764d7daaa8b6f1b3152f97ab73679278e0f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mollie/laravel-mollie/zipball/d71e4764d7daaa8b6f1b3152f97ab73679278e0f", + "reference": "d71e4764d7daaa8b6f1b3152f97ab73679278e0f", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/support": "^9.0|^10.0", + "mollie/mollie-api-php": "^2.60", + "php": "^8.0" + }, + "require-dev": { + "laravel/pint": "^1.1", + "laravel/socialite": "^5.5", + "mockery/mockery": "^1.4", + "orchestra/testbench": "^7.18|^8.0", + "phpunit/phpunit": "^9.0|^10.0" + }, + "suggest": { + "laravel/socialite": "Use Mollie Connect (OAuth) to authenticate via Laravel Socialite with the Mollie API. This is needed for some endpoints." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Mollie\\Laravel\\MollieServiceProvider" + ], + "aliases": { + "Mollie": "Mollie\\Laravel\\Facades\\Mollie" + } + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Mollie\\Laravel\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Mollie B.V.", + "email": "info@mollie.com" + } + ], + "description": "Mollie API client wrapper for Laravel & Mollie Connect provider for Laravel Socialite", + "homepage": "https://github.com/mollie/laravel-mollie", + "keywords": [ + "Apple Pay", + "Przelewy24", + "api", + "bancontact", + "banktransfer", + "belfius", + "belfius direct net", + "charges", + "creditcard", + "direct debit", + "gateway", + "ideal", + "laravel", + "lumen", + "mistercash", + "mollie", + "payment", + "payments", + "paypal", + "paysafecard", + "podiumcadeaukaart", + "recurring", + "refunds", + "sepa", + "service", + "socialite", + "sofort", + "sofortbanking", + "subscriptions" + ], + "support": { + "issues": "https://github.com/mollie/laravel-mollie/issues", + "source": "https://github.com/mollie/laravel-mollie/tree/v2.25.0" + }, + "time": "2023-07-31T13:36:56+00:00" + }, + { + "name": "mollie/mollie-api-php", + "version": "v2.65.0", + "source": { + "type": "git", + "url": "https://github.com/mollie/mollie-api-php.git", + "reference": "3920816c311ec785f47f160204296d1b7f918da5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/3920816c311ec785f47f160204296d1b7f918da5", + "reference": "3920816c311ec785f47f160204296d1b7f918da5", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.2", + "ext-curl": "*", + "ext-json": "*", + "ext-openssl": "*", + "php": "^7.2|^8.0" + }, + "require-dev": { + "eloquent/liberator": "^2.0||^3.0", + "friendsofphp/php-cs-fixer": "^3.0", + "guzzlehttp/guzzle": "^6.3 || ^7.0", + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^8.5 || ^9.5" + }, + "suggest": { + "mollie/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://docs.mollie.com/ for more information." + }, + "type": "library", + "autoload": { + "psr-4": { + "Mollie\\Api\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Mollie B.V.", + "email": "info@mollie.com" + } + ], + "description": "Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.", + "homepage": "https://www.mollie.com/en/developers", + "keywords": [ + "Apple Pay", + "CBC", + "Przelewy24", + "api", + "bancontact", + "banktransfer", + "belfius", + "belfius direct net", + "charges", + "creditcard", + "direct debit", + "fashioncheque", + "gateway", + "gift cards", + "ideal", + "inghomepay", + "intersolve", + "kbc", + "klarna", + "mistercash", + "mollie", + "paylater", + "payment", + "payments", + "paypal", + "paysafecard", + "podiumcadeaukaart", + "recurring", + "refunds", + "sepa", + "service", + "sliceit", + "sofort", + "sofortbanking", + "subscriptions" + ], + "support": { + "issues": "https://github.com/mollie/mollie-api-php/issues", + "source": "https://github.com/mollie/mollie-api-php/tree/v2.65.0" + }, + "time": "2024-01-23T12:39:48+00:00" + }, + { + "name": "moneyphp/money", + "version": "v4.5.0", + "source": { + "type": "git", + "url": "https://github.com/moneyphp/money.git", + "reference": "a1daa7daf159b4044e3d0c34c41fe2be5860e850" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/moneyphp/money/zipball/a1daa7daf159b4044e3d0c34c41fe2be5860e850", + "reference": "a1daa7daf159b4044e3d0c34c41fe2be5860e850", + "shasum": "" + }, + "require": { + "ext-bcmath": "*", + "ext-filter": "*", + "ext-json": "*", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + }, + "require-dev": { + "cache/taggable-cache": "^1.1.0", + "doctrine/coding-standard": "^12.0", + "doctrine/instantiator": "^1.5.0 || ^2.0", + "ext-gmp": "*", + "ext-intl": "*", + "florianv/exchanger": "^2.8.1", + "florianv/swap": "^4.3.0", + "moneyphp/crypto-currencies": "^1.1.0", + "moneyphp/iso-currencies": "^3.4", + "php-http/message": "^1.16.0", + "php-http/mock-client": "^1.6.0", + "phpbench/phpbench": "^1.2.5", + "phpunit/phpunit": "^10.5.9", + "psalm/plugin-phpunit": "^0.18.4", + "psr/cache": "^1.0.1 || ^2.0 || ^3.0", + "vimeo/psalm": "~5.20.0" + }, + "suggest": { + "ext-gmp": "Calculate without integer limits", + "ext-intl": "Format Money objects with intl", + "florianv/exchanger": "Exchange rates library for PHP", + "florianv/swap": "Exchange rates library for PHP", + "psr/cache-implementation": "Used for Currency caching" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Money\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mathias Verraes", + "email": "mathias@verraes.net", + "homepage": "http://verraes.net" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "Frederik Bosch", + "email": "f.bosch@genkgo.nl" + } + ], + "description": "PHP implementation of Fowler's Money pattern", + "homepage": "http://moneyphp.org", + "keywords": [ + "Value Object", + "money", + "vo" + ], + "support": { + "issues": "https://github.com/moneyphp/money/issues", + "source": "https://github.com/moneyphp/money/tree/v4.5.0" + }, + "time": "2024-02-15T19:47:21+00:00" + }, + { + "name": "monolog/monolog", + "version": "3.5.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c915e2634718dbc8a4a15c61b0e62e7a44e14448", + "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2 || ^2.0", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-strict-rules": "^1.4", + "phpunit/phpunit": "^10.1", + "predis/predis": "^1.1 || ^2", + "ruflin/elastica": "^7", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/3.5.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2023-10-27T15:32:31+00:00" + }, + { + "name": "mtdowling/jmespath.php", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/jmespath/jmespath.php.git", + "reference": "bbb69a935c2cbb0c03d7f481a238027430f6440b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/bbb69a935c2cbb0c03d7f481a238027430f6440b", + "reference": "bbb69a935c2cbb0c03d7f481a238027430f6440b", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "symfony/polyfill-mbstring": "^1.17" + }, + "require-dev": { + "composer/xdebug-handler": "^3.0.3", + "phpunit/phpunit": "^8.5.33" + }, + "bin": [ + "bin/jp.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "files": [ + "src/JmesPath.php" + ], + "psr-4": { + "JmesPath\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Declaratively specify how to extract elements from a JSON document", + "keywords": [ + "json", + "jsonpath" + ], + "support": { + "issues": "https://github.com/jmespath/jmespath.php/issues", + "source": "https://github.com/jmespath/jmespath.php/tree/2.7.0" + }, + "time": "2023-08-25T10:54:48+00:00" + }, + { + "name": "nesbot/carbon", + "version": "2.72.3", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "0c6fd108360c562f6e4fd1dedb8233b423e91c83" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/0c6fd108360c562f6e4fd1dedb8233b423e91c83", + "reference": "0c6fd108360c562f6e4fd1dedb8233b423e91c83", + "shasum": "" + }, + "require": { + "carbonphp/carbon-doctrine-types": "*", + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "psr/clock": "^1.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0", + "doctrine/orm": "^2.7 || ^3.0", + "friendsofphp/php-cs-fixer": "^3.0", + "kylekatarnls/multi-tester": "^2.0", + "ondrejmirtes/better-reflection": "*", + "phpmd/phpmd": "^2.9", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.99 || ^1.7.14", + "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", + "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", + "squizlabs/php_codesniffer": "^3.4" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.x-dev", + "dev-master": "2.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "time": "2024-01-25T10:35:09+00:00" + }, + { + "name": "nette/schema", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/nette/schema.git", + "reference": "a6d3a6d1f545f01ef38e60f375d1cf1f4de98188" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/schema/zipball/a6d3a6d1f545f01ef38e60f375d1cf1f4de98188", + "reference": "a6d3a6d1f545f01ef38e60f375d1cf1f4de98188", + "shasum": "" + }, + "require": { + "nette/utils": "^4.0", + "php": "8.1 - 8.3" + }, + "require-dev": { + "nette/tester": "^2.4", + "phpstan/phpstan-nette": "^1.0", + "tracy/tracy": "^2.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "📐 Nette Schema: validating data structures against a given Schema.", + "homepage": "https://nette.org", + "keywords": [ + "config", + "nette" + ], + "support": { + "issues": "https://github.com/nette/schema/issues", + "source": "https://github.com/nette/schema/tree/v1.3.0" + }, + "time": "2023-12-11T11:54:22+00:00" + }, + { + "name": "nette/utils", + "version": "v4.0.4", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/d3ad0aa3b9f934602cb3e3902ebccf10be34d218", + "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218", + "shasum": "" + }, + "require": { + "php": ">=8.0 <8.4" + }, + "conflict": { + "nette/finder": "<3", + "nette/schema": "<1.2.2" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "dev-master", + "nette/tester": "^2.5", + "phpstan/phpstan": "^1.0", + "tracy/tracy": "^2.9" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v4.0.4" + }, + "time": "2024-01-17T16:50:36+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.18.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" + }, + "time": "2023-12-10T21:03:43+00:00" + }, + { + "name": "nunomaduro/termwind", + "version": "v1.15.1", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/8ab0b32c8caa4a2e09700ea32925441385e4a5dc", + "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^8.0", + "symfony/console": "^5.3.0|^6.0.0" + }, + "require-dev": { + "ergebnis/phpstan-rules": "^1.0.", + "illuminate/console": "^8.0|^9.0", + "illuminate/support": "^8.0|^9.0", + "laravel/pint": "^1.0.0", + "pestphp/pest": "^1.21.0", + "pestphp/pest-plugin-mock": "^1.0", + "phpstan/phpstan": "^1.4.6", + "phpstan/phpstan-strict-rules": "^1.1.0", + "symfony/var-dumper": "^5.2.7|^6.0.0", + "thecodingmachine/phpstan-strict-rules": "^1.0.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Termwind\\Laravel\\TermwindServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Termwind\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Its like Tailwind CSS, but for the console.", + "keywords": [ + "cli", + "console", + "css", + "package", + "php", + "style" + ], + "support": { + "issues": "https://github.com/nunomaduro/termwind/issues", + "source": "https://github.com/nunomaduro/termwind/tree/v1.15.1" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://github.com/xiCO2k", + "type": "github" + } + ], + "time": "2023-02-08T01:06:31+00:00" + }, + { + "name": "nuwave/lighthouse", + "version": "v5.71.0", + "source": { + "type": "git", + "url": "https://github.com/nuwave/lighthouse.git", + "reference": "d325357f2d0f30c9503ac1898dc7ae53eb0d9275" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nuwave/lighthouse/zipball/d325357f2d0f30c9503ac1898dc7ae53eb0d9275", + "reference": "d325357f2d0f30c9503ac1898dc7ae53eb0d9275", + "shasum": "" + }, + "require": { + "ext-json": "*", + "haydenpierce/class-finder": "^0.4", + "illuminate/auth": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "illuminate/bus": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "illuminate/contracts": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "illuminate/http": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "illuminate/pagination": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "illuminate/queue": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "illuminate/routing": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "illuminate/support": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "illuminate/validation": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "laragraph/utils": "^1", + "php": ">= 7.2", + "thecodingmachine/safe": "^1 || ^2", + "webonyx/graphql-php": "^14.7" + }, + "require-dev": { + "algolia/algoliasearch-client-php": "^3 || ^4", + "bensampo/laravel-enum": "^1.28.3 || ^2 || ^3 || ^4 || ^5 || ^6", + "ergebnis/composer-normalize": "^2.2.2", + "laravel/framework": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10", + "laravel/legacy-factories": "^1", + "laravel/lumen-framework": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10 || dev-master", + "laravel/scout": "^7 || ^8 || ^9", + "mll-lab/graphql-php-scalars": "^4 || ^5", + "mll-lab/php-cs-fixer-config": "^4.4.1", + "mockery/mockery": "^1", + "nunomaduro/larastan": "^0.6 || ^0.7 || ^1 || ^2", + "orchestra/testbench": "3.6.* || 3.7.* || 3.8.* || 3.9.* || ^4 || ^5 || ^6 || ^7 || ^8", + "phpbench/phpbench": "^1", + "phpstan/phpstan": "~0.12 || ^1", + "phpstan/phpstan-mockery": "~0.12 || ^1", + "phpstan/phpstan-phpunit": "~0.12 || ^1", + "phpunit/phpunit": "^7.5 || ^8.4 || ^9", + "predis/predis": "^1.1", + "pusher/pusher-php-server": "^4 || ^5 || ^6 || ^7", + "rector/rector": "^0.12", + "thecodingmachine/phpstan-safe-rule": "^1" + }, + "suggest": { + "bensampo/laravel-enum": "Convenient enum definitions that can easily be registered in your Schema", + "laravel/scout": "Required for the @search directive", + "mll-lab/graphql-php-scalars": "Useful scalar types, required for @whereConditions", + "mll-lab/laravel-graphiql": "A graphical interactive in-browser GraphQL IDE - integrated with Laravel", + "pusher/pusher-php-server": "Required when using the Pusher Subscriptions driver" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "graphql": "Nuwave\\Lighthouse\\GraphQL" + }, + "providers": [ + "Nuwave\\Lighthouse\\LighthouseServiceProvider", + "Nuwave\\Lighthouse\\Auth\\AuthServiceProvider", + "Nuwave\\Lighthouse\\Cache\\CacheServiceProvider", + "Nuwave\\Lighthouse\\GlobalId\\GlobalIdServiceProvider", + "Nuwave\\Lighthouse\\OrderBy\\OrderByServiceProvider", + "Nuwave\\Lighthouse\\Pagination\\PaginationServiceProvider", + "Nuwave\\Lighthouse\\Scout\\ScoutServiceProvider", + "Nuwave\\Lighthouse\\SoftDeletes\\SoftDeletesServiceProvider", + "Nuwave\\Lighthouse\\Validation\\ValidationServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Nuwave\\Lighthouse\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christopher Moore", + "email": "chris@nuwavecommerce.com", + "homepage": "https://www.nuwavecommerce.com" + }, + { + "name": "Benedikt Franke", + "email": "benedikt@franke.tech", + "homepage": "https://franke.tech" + } + ], + "description": "A framework for serving GraphQL from Laravel", + "homepage": "https://lighthouse-php.com", + "keywords": [ + "graphql", + "laravel", + "laravel-graphql" + ], + "support": { + "issues": "https://github.com/nuwave/lighthouse/issues", + "source": "https://github.com/nuwave/lighthouse" + }, + "funding": [ + { + "url": "https://github.com/spawnia", + "type": "github" + }, + { + "url": "https://issuehunt.io/r/nuwave/lighthouse", + "type": "issuehunt" + }, + { + "url": "https://www.patreon.com/lighthouse_php", + "type": "patreon" + } + ], + "time": "2023-02-24T10:47:56+00:00" + }, + { + "name": "openai-php/client", + "version": "v0.7.10", + "source": { + "type": "git", + "url": "https://github.com/openai-php/client.git", + "reference": "f9af25d7d7bd8e58f60ada6c30f1c93d65c73833" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/openai-php/client/zipball/f9af25d7d7bd8e58f60ada6c30f1c93d65c73833", + "reference": "f9af25d7d7bd8e58f60ada6c30f1c93d65c73833", + "shasum": "" + }, + "require": { + "php": "^8.1.0", + "php-http/discovery": "^1.19.1", + "php-http/multipart-stream-builder": "^1.3.0", + "psr/http-client": "^1.0.3", + "psr/http-client-implementation": "^1.0.1", + "psr/http-factory-implementation": "*", + "psr/http-message": "^1.1.0|^2.0.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.8.0", + "guzzlehttp/psr7": "^2.6.1", + "laravel/pint": "^1.13.2", + "nunomaduro/collision": "^7.9.0", + "pestphp/pest": "^2.19.2", + "pestphp/pest-plugin-arch": "^2.3.3", + "pestphp/pest-plugin-mock": "^2.0.0", + "pestphp/pest-plugin-type-coverage": "^2.2.0", + "phpstan/phpstan": "^1.10.35", + "rector/rector": "^0.16.0", + "symfony/var-dumper": "^6.3.4" + }, + "type": "library", + "autoload": { + "files": [ + "src/OpenAI.php" + ], + "psr-4": { + "OpenAI\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + }, + { + "name": "Sandro Gehri" + } + ], + "description": "OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API", + "keywords": [ + "GPT-3", + "api", + "client", + "codex", + "dall-e", + "language", + "natural", + "openai", + "php", + "processing", + "sdk" + ], + "support": { + "issues": "https://github.com/openai-php/client/issues", + "source": "https://github.com/openai-php/client/tree/v0.7.10" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/gehrisandro", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2023-11-14T13:39:26+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" + }, + { + "name": "paragonie/sodium_compat", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/sodium_compat.git", + "reference": "e592a3e06d1fa0d43988c7c7d9948ca836f644b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/e592a3e06d1fa0d43988c7c7d9948ca836f644b6", + "reference": "e592a3e06d1fa0d43988c7c7d9948ca836f644b6", + "shasum": "" + }, + "require": { + "paragonie/random_compat": ">=1", + "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" + }, + "suggest": { + "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", + "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." + }, + "type": "library", + "autoload": { + "files": [ + "autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com" + }, + { + "name": "Frank Denis", + "email": "jedisct1@pureftpd.org" + } + ], + "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", + "keywords": [ + "Authentication", + "BLAKE2b", + "ChaCha20", + "ChaCha20-Poly1305", + "Chapoly", + "Curve25519", + "Ed25519", + "EdDSA", + "Edwards-curve Digital Signature Algorithm", + "Elliptic Curve Diffie-Hellman", + "Poly1305", + "Pure-PHP cryptography", + "RFC 7748", + "RFC 8032", + "Salpoly", + "Salsa20", + "X25519", + "XChaCha20-Poly1305", + "XSalsa20-Poly1305", + "Xchacha20", + "Xsalsa20", + "aead", + "cryptography", + "ecdh", + "elliptic curve", + "elliptic curve cryptography", + "encryption", + "libsodium", + "php", + "public-key cryptography", + "secret-key cryptography", + "side-channel resistant" + ], + "support": { + "issues": "https://github.com/paragonie/sodium_compat/issues", + "source": "https://github.com/paragonie/sodium_compat/tree/v1.20.0" + }, + "time": "2023-04-30T00:54:53+00:00" + }, + { + "name": "phenx/php-font-lib", + "version": "0.5.6", + "source": { + "type": "git", + "url": "https://github.com/dompdf/php-font-lib.git", + "reference": "a1681e9793040740a405ac5b189275059e2a9863" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/a1681e9793040740a405ac5b189275059e2a9863", + "reference": "a1681e9793040740a405ac5b189275059e2a9863", + "shasum": "" + }, + "require": { + "ext-mbstring": "*" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3 || ^4 || ^5 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "FontLib\\": "src/FontLib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Fabien Ménager", + "email": "fabien.menager@gmail.com" + } + ], + "description": "A library to read, parse, export and make subsets of different types of font files.", + "homepage": "https://github.com/PhenX/php-font-lib", + "support": { + "issues": "https://github.com/dompdf/php-font-lib/issues", + "source": "https://github.com/dompdf/php-font-lib/tree/0.5.6" + }, + "time": "2024-01-29T14:45:26+00:00" + }, + { + "name": "phenx/php-svg-lib", + "version": "0.5.2", + "source": { + "type": "git", + "url": "https://github.com/dompdf/php-svg-lib.git", + "reference": "732faa9fb4309221e2bd9b2fda5de44f947133aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/732faa9fb4309221e2bd9b2fda5de44f947133aa", + "reference": "732faa9fb4309221e2bd9b2fda5de44f947133aa", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1 || ^8.0", + "sabberworm/php-css-parser": "^8.4" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Svg\\": "src/Svg" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0" + ], + "authors": [ + { + "name": "Fabien Ménager", + "email": "fabien.menager@gmail.com" + } + ], + "description": "A library to read, parse and export to PDF SVG files.", + "homepage": "https://github.com/PhenX/php-svg-lib", + "support": { + "issues": "https://github.com/dompdf/php-svg-lib/issues", + "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.2" + }, + "time": "2024-02-07T12:49:40+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.19.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "61e1a1eb69c92741f5896d9e05fb8e9d7e8bb0cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/61e1a1eb69c92741f5896d9e05fb8e9d7e8bb0cb", + "reference": "61e1a1eb69c92741f5896d9e05fb8e9d7e8bb0cb", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0|^2.0", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "*", + "psr/http-factory-implementation": "*", + "psr/http-message-implementation": "*" + }, + "require-dev": { + "composer/composer": "^1.0.2|^2.0", + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", + "symfony/phpunit-bridge": "^6.2" + }, + "type": "composer-plugin", + "extra": { + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr17", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.19.2" + }, + "time": "2023-11-30T16:49:05+00:00" + }, + { + "name": "php-http/guzzle7-adapter", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/guzzle7-adapter.git", + "reference": "fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/guzzle7-adapter/zipball/fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01", + "reference": "fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^7.0", + "php": "^7.2 | ^8.0", + "php-http/httplug": "^2.0", + "psr/http-client": "^1.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0", + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.0|^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Adapter\\Guzzle7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "description": "Guzzle 7 HTTP Adapter", + "homepage": "http://httplug.io", + "keywords": [ + "Guzzle", + "http" + ], + "support": { + "issues": "https://github.com/php-http/guzzle7-adapter/issues", + "source": "https://github.com/php-http/guzzle7-adapter/tree/1.0.0" + }, + "time": "2021-03-09T07:35:15+00:00" + }, + { + "name": "php-http/httplug", + "version": "2.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "625ad742c360c8ac580fcc647a1541d29e257f67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67", + "reference": "625ad742c360c8ac580fcc647a1541d29e257f67", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "support": { + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/2.4.0" + }, + "time": "2023-04-14T15:10:03+00:00" + }, + { + "name": "php-http/multipart-stream-builder", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/multipart-stream-builder.git", + "reference": "f5938fd135d9fa442cc297dc98481805acfe2b6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/f5938fd135d9fa442cc297dc98481805acfe2b6a", + "reference": "f5938fd135d9fa442cc297dc98481805acfe2b6a", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/discovery": "^1.15", + "psr/http-factory-implementation": "^1.0" + }, + "require-dev": { + "nyholm/psr7": "^1.0", + "php-http/message": "^1.5", + "php-http/message-factory": "^1.0.2", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Message\\MultipartStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "description": "A builder class that help you create a multipart stream", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "multipart stream", + "stream" + ], + "support": { + "issues": "https://github.com/php-http/multipart-stream-builder/issues", + "source": "https://github.com/php-http/multipart-stream-builder/tree/1.3.0" + }, + "time": "2023-04-28T14:10:22+00:00" + }, + { + "name": "php-http/promise", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "2916a606d3b390f4e9e8e2b8dd68581508be0f07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/2916a606d3b390f4e9e8e2b8dd68581508be0f07", + "reference": "2916a606d3b390f4e9e8e2b8dd68581508be0f07", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3", + "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.3.0" + }, + "time": "2024-01-04T18:49:48+00:00" + }, + { + "name": "phpoffice/phpspreadsheet", + "version": "1.29.0", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", + "reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/fde2ccf55eaef7e86021ff1acce26479160a0fa0", + "reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-fileinfo": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "ext-xmlreader": "*", + "ext-xmlwriter": "*", + "ext-zip": "*", + "ext-zlib": "*", + "ezyang/htmlpurifier": "^4.15", + "maennchen/zipstream-php": "^2.1 || ^3.0", + "markbaker/complex": "^3.0", + "markbaker/matrix": "^3.0", + "php": "^7.4 || ^8.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-main", + "dompdf/dompdf": "^1.0 || ^2.0", + "friendsofphp/php-cs-fixer": "^3.2", + "mitoteam/jpgraph": "^10.3", + "mpdf/mpdf": "^8.1.1", + "phpcompatibility/php-compatibility": "^9.3", + "phpstan/phpstan": "^1.1", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^8.5 || ^9.0 || ^10.0", + "squizlabs/php_codesniffer": "^3.7", + "tecnickcom/tcpdf": "^6.5" + }, + "suggest": { + "dompdf/dompdf": "Option for rendering PDF with PDF Writer", + "ext-intl": "PHP Internationalization Functions", + "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", + "mpdf/mpdf": "Option for rendering PDF with PDF Writer", + "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "https://blog.maartenballiauw.be" + }, + { + "name": "Mark Baker", + "homepage": "https://markbakeruk.net" + }, + { + "name": "Franck Lefevre", + "homepage": "https://rootslabs.net" + }, + { + "name": "Erik Tilt" + }, + { + "name": "Adrien Crivelli" + } + ], + "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", + "keywords": [ + "OpenXML", + "excel", + "gnumeric", + "ods", + "php", + "spreadsheet", + "xls", + "xlsx" + ], + "support": { + "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.0" + }, + "time": "2023-06-14T22:48:31+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.9.2", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/80735db690fe4fc5c76dfa7f9b770634285fa820", + "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": true + }, + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "support": { + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.9.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2023-11-12T21:59:55+00:00" + }, + { + "name": "prettus/l5-repository", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/andersao/l5-repository.git", + "reference": "a9b4e7255988ea9f18b016b96e16967891dbfef6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/andersao/l5-repository/zipball/a9b4e7255988ea9f18b016b96e16967891dbfef6", + "reference": "a9b4e7255988ea9f18b016b96e16967891dbfef6", + "shasum": "" + }, + "require": { + "illuminate/config": "~5.0|~6.0|~7.0|^8.0|^9.0|^10.0", + "illuminate/console": "~5.0|~6.0|~7.0|^8.0|^9.0|^10.0", + "illuminate/database": "~5.0|~6.0|~7.0|^8.0|^9.0|^10.0", + "illuminate/filesystem": "~5.0|~6.0|~7.0|^8.0|^9.0|^10.0", + "illuminate/http": "~5.0|~6.0|~7.0|^8.0|^9.0|^10.0", + "illuminate/pagination": "~5.0|~6.0|~7.0|^8.0|^9.0|^10.0", + "illuminate/support": "~5.0|~6.0|~7.0|^8.0|^9.0|^10.0", + "illuminate/validation": "~5.0|~6.0|~7.0|^8.0|^9.0|^10.0", + "prettus/laravel-validation": "~1.1|~1.2|~1.3|~1.4" + }, + "suggest": { + "league/fractal": "Required to use the Fractal Presenter (0.12.*).", + "prettus/laravel-validation": "Required to provide easy validation with the repository (1.1.*)", + "robclancy/presenter": "Required to use the Presenter Model (1.3.*)" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Prettus\\Repository\\Providers\\RepositoryServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Prettus\\Repository\\": "src/Prettus/Repository/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anderson Andrade", + "email": "contato@andersonandra.de", + "homepage": "http://andersonandra.de", + "role": "Developer" + } + ], + "description": "Laravel 5|6|7|8|9|10 - Repositories to the database layer", + "homepage": "http://andersao.github.io/l5-repository", + "keywords": [ + "cache", + "eloquent", + "laravel", + "model", + "repository" + ], + "support": { + "docs": "http://andersao.github.io/l5-repository", + "email": "contato@andersonandra.de", + "issues": "https://github.com/andersao/l5-repository/issues", + "source": "https://github.com/andersao/l5-repository", + "wiki": "https://github.com/andersao/l5-repository" + }, + "time": "2023-02-22T02:22:15+00:00" + }, + { + "name": "prettus/laravel-validation", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/andersao/laravel-validator.git", + "reference": "5af73c58801fdd0344dd6281d0ae5ae7df248ec3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/andersao/laravel-validator/zipball/5af73c58801fdd0344dd6281d0ae5ae7df248ec3", + "reference": "5af73c58801fdd0344dd6281d0ae5ae7df248ec3", + "shasum": "" + }, + "require": { + "illuminate/support": "~5.4|^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/validation": "~5.4|^6.0|^7.0|^8.0|^9.0|^10.0", + "php": ">=5.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Prettus\\Validator\\": "src/Prettus/Validator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "authors": [ + { + "name": "Anderson Andrade", + "email": "contato@andersonandra.de", + "homepage": "http://andersonandra.de", + "role": "Developer" + } + ], + "description": "Laravel Validation Service", + "homepage": "http://andersao.github.io/laravel-validation", + "keywords": [ + "laravel", + "service", + "validation" + ], + "support": { + "docs": "http://andersao.github.io/laravel-validation", + "email": "contato@andersonandra.de", + "issues": "https://github.com/andersao/laravel-validation/issues", + "source": "https://github.com/andersao/laravel-validation", + "wiki": "https://github.com/andersao/laravel-validation" + }, + "time": "2023-02-22T13:20:29+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "e616d01114759c4c489f93b099585439f795fe35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + }, + "time": "2023-04-10T20:10:41+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.11.22", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/128fa1b608be651999ed9789c95e6e2a31b5802b", + "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "^4.0 || ^3.1", + "php": "^8.0 || ^7.0.8", + "symfony/console": "^6.0 || ^5.0 || ^4.0 || ^3.4", + "symfony/var-dumper": "^6.0 || ^5.0 || ^4.0 || ^3.4" + }, + "conflict": { + "symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2" + }, + "suggest": { + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-pdo-sqlite": "The doc command requires SQLite to work.", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", + "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history." + }, + "bin": [ + "bin/psysh" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-0.11": "0.11.x-dev" + }, + "bamarni-bin": { + "bin-links": false, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Psy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "An interactive shell for modern PHP.", + "homepage": "http://psysh.org", + "keywords": [ + "REPL", + "console", + "interactive", + "shell" + ], + "support": { + "issues": "https://github.com/bobthecow/psysh/issues", + "source": "https://github.com/bobthecow/psysh/tree/v0.11.22" + }, + "time": "2023-10-14T21:56:36+00:00" + }, + { + "name": "pusher/pusher-php-server", + "version": "7.2.4", + "source": { + "type": "git", + "url": "https://github.com/pusher/pusher-http-php.git", + "reference": "de2f72296808f9cafa6a4462b15a768ff130cddb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pusher/pusher-http-php/zipball/de2f72296808f9cafa6a4462b15a768ff130cddb", + "reference": "de2f72296808f9cafa6a4462b15a768ff130cddb", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "guzzlehttp/guzzle": "^7.2", + "paragonie/sodium_compat": "^1.6", + "php": "^7.3|^8.0", + "psr/log": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "overtrue/phplint": "^2.3", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Pusher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Library for interacting with the Pusher REST API", + "keywords": [ + "events", + "messaging", + "php-pusher-server", + "publish", + "push", + "pusher", + "real time", + "real-time", + "realtime", + "rest", + "trigger" + ], + "support": { + "issues": "https://github.com/pusher/pusher-http-php/issues", + "source": "https://github.com/pusher/pusher-http-php/tree/7.2.4" + }, + "time": "2023-12-15T10:58:53+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "ramsey/collection", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2022-12-31T21:50:55+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.7.5", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", + "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11", + "ext-json": "*", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.7.5" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2023-11-08T05:53:05+00:00" + }, + { + "name": "razorpay/razorpay", + "version": "2.8.7", + "source": { + "type": "git", + "url": "https://github.com/razorpay/razorpay-php.git", + "reference": "2180c8c3c39678623f5cb8f639c39a706de14c44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/razorpay/razorpay-php/zipball/2180c8c3c39678623f5cb8f639c39a706de14c44", + "reference": "2180c8c3c39678623f5cb8f639c39a706de14c44", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=7.3", + "rmccue/requests": "^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9", + "raveren/kint": "1.*" + }, + "type": "library", + "autoload": { + "files": [ + "Deprecated.php" + ], + "psr-4": { + "Razorpay\\Api\\": "src/", + "Razorpay\\Tests\\": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Abhay Rana", + "email": "nemo@razorpay.com", + "homepage": "https://captnemo.in", + "role": "Developer" + }, + { + "name": "Shashank Kumar", + "email": "shashank@razorpay.com", + "role": "Developer" + } + ], + "description": "Razorpay PHP Client Library", + "homepage": "https://docs.razorpay.com", + "keywords": [ + "api", + "client", + "php", + "razorpay" + ], + "support": { + "email": "contact@razorpay.com", + "issues": "https://github.com/Razorpay/razorpay-php/issues", + "source": "https://github.com/Razorpay/razorpay-php" + }, + "time": "2023-09-11T08:31:26+00:00" + }, + { + "name": "rmccue/requests", + "version": "v2.0.10", + "source": { + "type": "git", + "url": "https://github.com/WordPress/Requests.git", + "reference": "bcf1ac7fe8c0b2b18c1df6d24694cfc96b44b391" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/Requests/zipball/bcf1ac7fe8c0b2b18c1df6d24694cfc96b44b391", + "reference": "bcf1ac7fe8c0b2b18c1df6d24694cfc96b44b391", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.6" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0", + "requests/test-server": "dev-main", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.6", + "wp-coding-standards/wpcs": "^2.0", + "yoast/phpunit-polyfills": "^1.0.0" + }, + "suggest": { + "art4/requests-psr18-adapter": "For using Requests as a PSR-18 HTTP Client", + "ext-curl": "For improved performance", + "ext-openssl": "For secure transport support", + "ext-zlib": "For improved performance when decompressing encoded streams" + }, + "type": "library", + "autoload": { + "files": [ + "library/Deprecated.php" + ], + "psr-4": { + "WpOrg\\Requests\\": "src/" + }, + "classmap": [ + "library/Requests.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Ryan McCue", + "homepage": "https://rmccue.io/" + }, + { + "name": "Alain Schlesser", + "homepage": "https://github.com/schlessera" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl" + }, + { + "name": "Contributors", + "homepage": "https://github.com/WordPress/Requests/graphs/contributors" + } + ], + "description": "A HTTP library written in PHP, for human beings.", + "homepage": "https://requests.ryanmccue.info/", + "keywords": [ + "curl", + "fsockopen", + "http", + "idna", + "ipv6", + "iri", + "sockets" + ], + "support": { + "docs": "https://requests.ryanmccue.info/", + "issues": "https://github.com/WordPress/Requests/issues", + "source": "https://github.com/WordPress/Requests" + }, + "time": "2024-01-08T11:14:32+00:00" + }, + { + "name": "sabberworm/php-css-parser", + "version": "v8.5.1", + "source": { + "type": "git", + "url": "https://github.com/MyIntervals/PHP-CSS-Parser.git", + "reference": "4a3d572b0f8b28bb6fd016ae8bbfc445facef152" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/4a3d572b0f8b28bb6fd016ae8bbfc445facef152", + "reference": "4a3d572b0f8b28bb6fd016ae8bbfc445facef152", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=5.6.20" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "suggest": { + "ext-mbstring": "for parsing UTF-8 CSS" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "9.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Sabberworm\\CSS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raphael Schweikert" + }, + { + "name": "Oliver Klee", + "email": "github@oliverklee.de" + }, + { + "name": "Jake Hotson", + "email": "jake.github@qzdesign.co.uk" + } + ], + "description": "Parser for CSS Files written in PHP", + "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser", + "keywords": [ + "css", + "parser", + "stylesheet" + ], + "support": { + "issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues", + "source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v8.5.1" + }, + "time": "2024-02-15T16:41:13+00:00" + }, + { + "name": "spatie/image", + "version": "2.2.7", + "source": { + "type": "git", + "url": "https://github.com/spatie/image.git", + "reference": "2f802853aab017aa615224daae1588054b5ab20e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/image/zipball/2f802853aab017aa615224daae1588054b5ab20e", + "reference": "2f802853aab017aa615224daae1588054b5ab20e", + "shasum": "" + }, + "require": { + "ext-exif": "*", + "ext-json": "*", + "ext-mbstring": "*", + "league/glide": "^2.2.2", + "php": "^8.0", + "spatie/image-optimizer": "^1.7", + "spatie/temporary-directory": "^1.0|^2.0", + "symfony/process": "^3.0|^4.0|^5.0|^6.0" + }, + "require-dev": { + "pestphp/pest": "^1.22", + "phpunit/phpunit": "^9.5", + "symfony/var-dumper": "^4.0|^5.0|^6.0", + "vimeo/psalm": "^4.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Image\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Manipulate images with an expressive API", + "homepage": "https://github.com/spatie/image", + "keywords": [ + "image", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/image/tree/2.2.7" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2023-07-24T13:54:13+00:00" + }, + { + "name": "spatie/image-optimizer", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/spatie/image-optimizer.git", + "reference": "62f7463483d1bd975f6f06025d89d42a29608fe1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/62f7463483d1bd975f6f06025d89d42a29608fe1", + "reference": "62f7463483d1bd975f6f06025d89d42a29608fe1", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.3|^8.0", + "psr/log": "^1.0 | ^2.0 | ^3.0", + "symfony/process": "^4.2|^5.0|^6.0|^7.0" + }, + "require-dev": { + "pestphp/pest": "^1.21", + "phpunit/phpunit": "^8.5.21|^9.4.4", + "symfony/var-dumper": "^4.2|^5.0|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\ImageOptimizer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Easily optimize images using PHP", + "homepage": "https://github.com/spatie/image-optimizer", + "keywords": [ + "image-optimizer", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/image-optimizer/issues", + "source": "https://github.com/spatie/image-optimizer/tree/1.7.2" + }, + "time": "2023-11-03T10:08:02+00:00" + }, + { + "name": "spatie/laravel-medialibrary", + "version": "10.14.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-medialibrary.git", + "reference": "fde92469e37d580c001b9d146c9454643c6d6d57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/fde92469e37d580c001b9d146c9454643c6d6d57", + "reference": "fde92469e37d580c001b9d146c9454643c6d6d57", + "shasum": "" + }, + "require": { + "ext-exif": "*", + "ext-fileinfo": "*", + "ext-json": "*", + "illuminate/bus": "^9.18|^10.0", + "illuminate/conditionable": "^9.18|^10.0", + "illuminate/console": "^9.18|^10.0", + "illuminate/database": "^9.18|^10.0", + "illuminate/pipeline": "^9.18|^10.0", + "illuminate/support": "^9.18|^10.0", + "maennchen/zipstream-php": "^2.0|^3.0", + "php": "^8.0", + "spatie/image": "^2.2.7", + "spatie/temporary-directory": "^2.0", + "symfony/console": "^6.0" + }, + "conflict": { + "php-ffmpeg/php-ffmpeg": "<0.6.1" + }, + "require-dev": { + "aws/aws-sdk-php": "^3.133.11", + "doctrine/dbal": "^2.13", + "ext-imagick": "*", + "ext-pdo_sqlite": "*", + "ext-zip": "*", + "guzzlehttp/guzzle": "^7.4", + "league/flysystem-aws-s3-v3": "^3.0", + "mockery/mockery": "^1.4", + "nunomaduro/larastan": "^2.0", + "orchestra/testbench": "^7.0|^8.0", + "pestphp/pest": "^1.21", + "phpstan/extension-installer": "^1.1", + "spatie/laravel-ray": "^1.28", + "spatie/pdf-to-image": "^2.1", + "spatie/phpunit-snapshot-assertions": "^4.2" + }, + "suggest": { + "league/flysystem-aws-s3-v3": "Required to use AWS S3 file storage", + "php-ffmpeg/php-ffmpeg": "Required for generating video thumbnails", + "spatie/pdf-to-image": "Required for generating thumbnails of PDFs and SVGs" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\MediaLibrary\\MediaLibraryServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Spatie\\MediaLibrary\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Associate files with Eloquent models", + "homepage": "https://github.com/spatie/laravel-medialibrary", + "keywords": [ + "cms", + "conversion", + "downloads", + "images", + "laravel", + "laravel-medialibrary", + "media", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-medialibrary/issues", + "source": "https://github.com/spatie/laravel-medialibrary/tree/10.14.0" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2023-10-25T11:26:54+00:00" + }, + { + "name": "spatie/laravel-newsletter", + "version": "5.1.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-newsletter.git", + "reference": "825fb94ded624934eaaf2a0707e4ae2417f11a6c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-newsletter/zipball/825fb94ded624934eaaf2a0707e4ae2417f11a6c", + "reference": "825fb94ded624934eaaf2a0707e4ae2417f11a6c", + "shasum": "" + }, + "require": { + "php": "^8.1", + "spatie/laravel-package-tools": "^1.13" + }, + "require-dev": { + "drewm/mailchimp-api": "^2.5", + "guzzlehttp/guzzle": "^7.5|^7.2", + "mockery/mockery": "^1.4", + "orchestra/testbench": "^7.11|^8.0", + "pestphp/pest": "^1.20", + "phpstan/phpstan": "^1.9", + "phpunit/phpunit": "^9.5", + "spatie/mailcoach-sdk-php": "^1.0", + "spatie/ray": "^1.28" + }, + "suggest": { + "drewm/mailchimp-api": "For working with MailChimp", + "spatie/mailcoach-sdk-php": "For working with Mailcoach" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\Newsletter\\NewsletterServiceProvider" + ], + "aliases": { + "Newsletter": "Spatie\\Newsletter\\Facades\\Newsletter" + } + } + }, + "autoload": { + "psr-4": { + "Spatie\\Newsletter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Manage Mailcoach and MailChimp newsletters in Laravel", + "homepage": "https://github.com/spatie/laravel-newsletter", + "keywords": [ + "laravel", + "mailchimp", + "mailcoach", + "newsletter" + ], + "support": { + "issues": "https://github.com/spatie/laravel-newsletter/issues", + "source": "https://github.com/spatie/laravel-newsletter/tree/5.1.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + } + ], + "time": "2023-02-09T13:52:08+00:00" + }, + { + "name": "spatie/laravel-package-tools", + "version": "1.16.2", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-package-tools.git", + "reference": "e62eeb1fe8a8a0b2e83227a6c279c8c59f7d3a15" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/e62eeb1fe8a8a0b2e83227a6c279c8c59f7d3a15", + "reference": "e62eeb1fe8a8a0b2e83227a6c279c8c59f7d3a15", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^9.28|^10.0|^11.0", + "php": "^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.5", + "orchestra/testbench": "^7.7|^8.0", + "pestphp/pest": "^1.22", + "phpunit/phpunit": "^9.5.24", + "spatie/pest-plugin-test-time": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\LaravelPackageTools\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "role": "Developer" + } + ], + "description": "Tools for creating Laravel packages", + "homepage": "https://github.com/spatie/laravel-package-tools", + "keywords": [ + "laravel-package-tools", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-package-tools/issues", + "source": "https://github.com/spatie/laravel-package-tools/tree/1.16.2" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2024-01-11T08:43:00+00:00" + }, + { + "name": "spatie/laravel-permission", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-permission.git", + "reference": "095821962f8f287f0ce1d6265fc7aa7070dacf12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/095821962f8f287f0ce1d6265fc7aa7070dacf12", + "reference": "095821962f8f287f0ce1d6265fc7aa7070dacf12", + "shasum": "" + }, + "require": { + "illuminate/auth": "^8.12|^9.0|^10.0", + "illuminate/container": "^8.12|^9.0|^10.0", + "illuminate/contracts": "^8.12|^9.0|^10.0", + "illuminate/database": "^8.12|^9.0|^10.0", + "php": "^8.0" + }, + "require-dev": { + "laravel/passport": "^11.0", + "orchestra/testbench": "^6.23|^7.0|^8.0", + "phpunit/phpunit": "^9.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.x-dev", + "dev-master": "6.x-dev" + }, + "laravel": { + "providers": [ + "Spatie\\Permission\\PermissionServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Spatie\\Permission\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Permission handling for Laravel 8.0 and up", + "homepage": "https://github.com/spatie/laravel-permission", + "keywords": [ + "acl", + "laravel", + "permission", + "permissions", + "rbac", + "roles", + "security", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-permission/issues", + "source": "https://github.com/spatie/laravel-permission/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2023-10-25T05:25:50+00:00" + }, + { + "name": "spatie/period", + "version": "2.4.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/period.git", + "reference": "85fbbea7b24fdff0c924aeed5b109be93c025850" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/period/zipball/85fbbea7b24fdff0c924aeed5b109be93c025850", + "reference": "85fbbea7b24fdff0c924aeed5b109be93c025850", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "larapack/dd": "^1.1", + "nesbot/carbon": "^2.63", + "pestphp/pest": "^1.22", + "phpunit/phpunit": "^9.5", + "spatie/ray": "^1.31" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Period\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brent Roose", + "email": "brent@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Complex period comparisons", + "homepage": "https://github.com/spatie/period", + "keywords": [ + "period", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/period/issues", + "source": "https://github.com/spatie/period/tree/2.4.0" + }, + "time": "2023-02-20T14:31:09+00:00" + }, + { + "name": "spatie/regex", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/regex.git", + "reference": "d543de2019a0068e7b80da0ba24f1c51c7469303" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/regex/zipball/d543de2019a0068e7b80da0ba24f1c51c7469303", + "reference": "d543de2019a0068e7b80da0ba24f1c51c7469303", + "shasum": "" + }, + "require": { + "php": "^8.0|^8.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Regex\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sebastian De Deyne", + "email": "sebastian@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A sane interface for php's built in preg_* functions", + "homepage": "https://github.com/spatie/regex", + "keywords": [ + "expression", + "expressions", + "regex", + "regular", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/regex/issues", + "source": "https://github.com/spatie/regex/tree/3.1.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2021-11-30T21:13:59+00:00" + }, + { + "name": "spatie/temporary-directory", + "version": "2.2.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/temporary-directory.git", + "reference": "76949fa18f8e1a7f663fd2eaa1d00e0bcea0752a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/76949fa18f8e1a7f663fd2eaa1d00e0bcea0752a", + "reference": "76949fa18f8e1a7f663fd2eaa1d00e0bcea0752a", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\TemporaryDirectory\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alex Vanderbist", + "email": "alex@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Easily create, use and destroy temporary directories", + "homepage": "https://github.com/spatie/temporary-directory", + "keywords": [ + "php", + "spatie", + "temporary-directory" + ], + "support": { + "issues": "https://github.com/spatie/temporary-directory/issues", + "source": "https://github.com/spatie/temporary-directory/tree/2.2.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2023-12-25T11:46:58+00:00" + }, + { + "name": "srmklive/paypal", + "version": "3.0.19", + "source": { + "type": "git", + "url": "https://github.com/srmklive/laravel-paypal.git", + "reference": "ece40beaa55153119be30e74fff71001882629ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/srmklive/laravel-paypal/zipball/ece40beaa55153119be30e74fff71001882629ce", + "reference": "ece40beaa55153119be30e74fff71001882629ce", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "guzzlehttp/guzzle": "~7.0", + "illuminate/support": "~6.0|~7.0|~8.0|~9.0|^10.0", + "nesbot/carbon": "~2.0", + "php": ">=7.2|^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0|^9.0", + "symfony/var-dumper": "~5.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Srmklive\\PayPal\\Providers\\PayPalServiceProvider" + ], + "aliases": { + "PayPal": "Srmklive\\PayPal\\Facades\\PayPal" + } + } + }, + "autoload": { + "psr-4": { + "Srmklive\\PayPal\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raza Mehdi", + "email": "srmk@outlook.com" + } + ], + "description": "Laravel plugin For Processing Payments Through Paypal Express Checkout. Can Be Used Independently With Other Applications.", + "keywords": [ + "http", + "laravel paypal", + "paypal", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/srmklive/laravel-paypal/issues", + "source": "https://github.com/srmklive/laravel-paypal/tree/3.0.19" + }, + "time": "2023-02-20T14:35:50+00:00" + }, + { + "name": "stevebauman/purify", + "version": "v6.0.2", + "source": { + "type": "git", + "url": "https://github.com/stevebauman/purify.git", + "reference": "ce8d10c0dfe804d90470ff819b84d891037cd6bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stevebauman/purify/zipball/ce8d10c0dfe804d90470ff819b84d891037cd6bc", + "reference": "ce8d10c0dfe804d90470ff819b84d891037cd6bc", + "shasum": "" + }, + "require": { + "ezyang/htmlpurifier": "^4.9.0", + "illuminate/contracts": "~7.0|~8.0|~9.0|~10.0", + "illuminate/support": "~7.0|~8.0|~9.0|~10.0", + "php": ">=7.4" + }, + "require-dev": { + "orchestra/testbench": "~5.0|~6.0|~7.0", + "phpunit/phpunit": "~8.0|~9.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Stevebauman\\Purify\\PurifyServiceProvider" + ], + "aliases": { + "Purify": "Stevebauman\\Purify\\Facades\\Purify" + } + } + }, + "autoload": { + "psr-4": { + "Stevebauman\\Purify\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Steve Bauman", + "email": "steven_bauman@outlook.com" + } + ], + "description": "An HTML Purifier / Sanitizer for Laravel", + "keywords": [ + "Purifier", + "clean", + "cleaner", + "html", + "laravel", + "purification", + "purify" + ], + "support": { + "issues": "https://github.com/stevebauman/purify/issues", + "source": "https://github.com/stevebauman/purify/tree/v6.0.2" + }, + "time": "2023-08-24T18:53:12+00:00" + }, + { + "name": "stripe/stripe-php", + "version": "v13.1.0", + "source": { + "type": "git", + "url": "https://github.com/stripe/stripe-php.git", + "reference": "8971caa149b4689e67c1123d3604e387c79ab543" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/8971caa149b4689e67c1123d3604e387c79ab543", + "reference": "8971caa149b4689e67c1123d3604e387c79ab543", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "php": ">=5.6.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "3.5.0", + "phpstan/phpstan": "^1.2", + "phpunit/phpunit": "^5.7 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Stripe\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stripe and contributors", + "homepage": "https://github.com/stripe/stripe-php/contributors" + } + ], + "description": "Stripe PHP Library", + "homepage": "https://stripe.com/", + "keywords": [ + "api", + "payment processing", + "stripe" + ], + "support": { + "issues": "https://github.com/stripe/stripe-php/issues", + "source": "https://github.com/stripe/stripe-php/tree/v13.1.0" + }, + "time": "2023-10-26T17:36:08+00:00" + }, + { + "name": "symfony/console", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "2aaf83b4de5b9d43b93e4aec6f2f8b676f7c567e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/2aaf83b4de5b9d43b93e4aec6f2f8b676f7c567e", + "reference": "2aaf83b4de5b9d43b93e4aec6f2f8b676f7c567e", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T14:51:35+00:00" + }, + { + "name": "symfony/css-selector", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "ee0f7ed5cf298cc019431bb3b3977ebc52b86229" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/ee0f7ed5cf298cc019431bb3b3977ebc52b86229", + "reference": "ee0f7ed5cf298cc019431bb3b3977ebc52b86229", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Converts CSS selectors to XPath expressions", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/css-selector/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T14:51:35+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/error-handler", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/error-handler.git", + "reference": "6dc3c76a278b77f01d864a6005d640822c6f26a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/6dc3c76a278b77f01d864a6005d640822c6f26a6", + "reference": "6dc3c76a278b77f01d864a6005d640822c6f26a6", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^1|^2|^3", + "symfony/var-dumper": "^5.4|^6.0|^7.0" + }, + "conflict": { + "symfony/deprecation-contracts": "<2.5", + "symfony/http-kernel": "<6.4" + }, + "require-dev": { + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/serializer": "^5.4|^6.0|^7.0" + }, + "bin": [ + "Resources/bin/patch-type-declarations" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\ErrorHandler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to manage errors and ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/error-handler/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T15:40:36+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "ae9d3a6f3003a6caf56acd7466d8d52378d44fef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ae9d3a6f3003a6caf56acd7466d8d52378d44fef", + "reference": "ae9d3a6f3003a6caf56acd7466d8d52378d44fef", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T14:51:35+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/finder", + "version": "v6.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "11d736e97f116ac375a81f96e662911a34cd50ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/11d736e97f116ac375a81f96e662911a34cd50ce", + "reference": "11d736e97f116ac375a81f96e662911a34cd50ce", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "symfony/filesystem": "^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v6.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-10-31T17:30:12+00:00" + }, + { + "name": "symfony/http-client", + "version": "v6.3.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client.git", + "reference": "cd67fcaf4524ec6ae5d9b2d9497682d7ad3ce57d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client/zipball/cd67fcaf4524ec6ae5d9b2d9497682d7ad3ce57d", + "reference": "cd67fcaf4524ec6ae5d9b2d9497682d7ad3ce57d", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-client-contracts": "^3", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "php-http/discovery": "<1.15", + "symfony/http-foundation": "<6.3" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "1.0", + "symfony/http-client-implementation": "3.0" + }, + "require-dev": { + "amphp/amp": "^2.5", + "amphp/http-client": "^4.2.1", + "amphp/http-tunnel": "^1.0", + "amphp/socket": "^1.1", + "guzzlehttp/promises": "^1.4", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/stopwatch": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", + "homepage": "https://symfony.com", + "keywords": [ + "http" + ], + "support": { + "source": "https://github.com/symfony/http-client/tree/v6.3.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-10-29T12:41:36+00:00" + }, + { + "name": "symfony/http-client-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "1ee70e699b41909c209a0c930f11034b93578654" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/1ee70e699b41909c209a0c930f11034b93578654", + "reference": "1ee70e699b41909c209a0c930f11034b93578654", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/http-client-contracts/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-30T20:28:31+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "5677bdf7cade4619cb17fc9e1e7b31ec392244a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5677bdf7cade4619cb17fc9e1e7b31ec392244a9", + "reference": "5677bdf7cade4619cb17fc9e1e7b31ec392244a9", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php83": "^1.27" + }, + "conflict": { + "symfony/cache": "<6.3" + }, + "require-dev": { + "doctrine/dbal": "^2.13.1|^3|^4", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^6.3|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4|^7.0", + "symfony/mime": "^5.4|^6.0|^7.0", + "symfony/rate-limiter": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T14:51:35+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "9c6ec4e543044f7568a53a76ab1484ecd30637a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9c6ec4e543044f7568a53a76ab1484ecd30637a2", + "reference": "9c6ec4e543044f7568a53a76ab1484ecd30637a2", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/error-handler": "^6.4|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/browser-kit": "<5.4", + "symfony/cache": "<5.4", + "symfony/config": "<6.1", + "symfony/console": "<5.4", + "symfony/dependency-injection": "<6.4", + "symfony/doctrine-bridge": "<5.4", + "symfony/form": "<5.4", + "symfony/http-client": "<5.4", + "symfony/http-client-contracts": "<2.5", + "symfony/mailer": "<5.4", + "symfony/messenger": "<5.4", + "symfony/translation": "<5.4", + "symfony/translation-contracts": "<2.5", + "symfony/twig-bridge": "<5.4", + "symfony/validator": "<6.4", + "symfony/var-dumper": "<6.3", + "twig/twig": "<2.13" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/clock": "^6.2|^7.0", + "symfony/config": "^6.1|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/dom-crawler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-client-contracts": "^2.5|^3", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4.5|^6.0.5|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.3|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/translation-contracts": "^2.5|^3", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/var-exporter": "^6.2|^7.0", + "twig/twig": "^2.13|^3.0.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a structured process for converting a Request into a Response", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-kernel/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-31T07:21:29+00:00" + }, + { + "name": "symfony/mailer", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/mailer.git", + "reference": "74412c62f88a85a41b61f0b71ab0afcaad6f03ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mailer/zipball/74412c62f88a85a41b61f0b71ab0afcaad6f03ee", + "reference": "74412c62f88a85a41b61f0b71ab0afcaad6f03ee", + "shasum": "" + }, + "require": { + "egulias/email-validator": "^2.1.10|^3|^4", + "php": ">=8.1", + "psr/event-dispatcher": "^1", + "psr/log": "^1|^2|^3", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/mime": "^6.2|^7.0", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<5.4", + "symfony/messenger": "<6.2", + "symfony/mime": "<6.2", + "symfony/twig-bridge": "<6.2.1" + }, + "require-dev": { + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/messenger": "^6.2|^7.0", + "symfony/twig-bridge": "^6.2|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mailer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps sending emails", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/mailer/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T15:01:07+00:00" + }, + { + "name": "symfony/mailgun-mailer", + "version": "v6.3.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/mailgun-mailer.git", + "reference": "8d9741467c53750dc8ccda23a1cdb91cda732571" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mailgun-mailer/zipball/8d9741467c53750dc8ccda23a1cdb91cda732571", + "reference": "8d9741467c53750dc8ccda23a1cdb91cda732571", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/mailer": "^5.4.21|^6.2.7" + }, + "conflict": { + "symfony/http-foundation": "<6.2" + }, + "require-dev": { + "symfony/http-client": "^5.4|^6.0", + "symfony/webhook": "^6.3" + }, + "type": "symfony-mailer-bridge", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mailer\\Bridge\\Mailgun\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Mailgun Mailer Bridge", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/mailgun-mailer/tree/v6.3.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-10-12T13:32:47+00:00" + }, + { + "name": "symfony/mime", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/mime.git", + "reference": "5017e0a9398c77090b7694be46f20eb796262a34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mime/zipball/5017e0a9398c77090b7694be46f20eb796262a34", + "reference": "5017e0a9398c77090b7694be46f20eb796262a34", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "egulias/email-validator": "~3.0.0", + "phpdocumentor/reflection-docblock": "<3.2.2", + "phpdocumentor/type-resolver": "<1.4.0", + "symfony/mailer": "<5.4", + "symfony/serializer": "<6.3.2" + }, + "require-dev": { + "egulias/email-validator": "^2.1.10|^3.1|^4", + "league/html-to-markdown": "^5.0", + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.3.2|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mime\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows manipulating MIME messages", + "homepage": "https://symfony.com", + "keywords": [ + "mime", + "mime-type" + ], + "support": { + "source": "https://github.com/symfony/mime/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-30T08:32:12+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "a287ed7475f85bf6f61890146edbc932c0fff919" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a287ed7475f85bf6f61890146edbc932c0fff919", + "reference": "a287ed7475f85bf6f61890146edbc932c0fff919", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25", + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-php83", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "86fcae159633351e5fd145d1c47de6c528f8caff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/86fcae159633351e5fd145d1c47de6c528f8caff", + "reference": "86fcae159633351e5fd145d1c47de6c528f8caff", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-php80": "^1.14" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-uuid", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-uuid.git", + "reference": "3abdd21b0ceaa3000ee950097bc3cf9efc137853" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/3abdd21b0ceaa3000ee950097bc3cf9efc137853", + "reference": "3abdd21b0ceaa3000ee950097bc3cf9efc137853", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-uuid": "*" + }, + "suggest": { + "ext-uuid": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Uuid\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for uuid functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/process", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "31642b0818bfcff85930344ef93193f8c607e0a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/31642b0818bfcff85930344ef93193f8c607e0a3", + "reference": "31642b0818bfcff85930344ef93193f8c607e0a3", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T14:51:35+00:00" + }, + { + "name": "symfony/routing", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "3b2957ad54902f0f544df83e3d58b38d7e8e5842" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/3b2957ad54902f0f544df83e3d58b38d7e8e5842", + "reference": "3b2957ad54902f0f544df83e3d58b38d7e8e5842", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "doctrine/annotations": "<1.12", + "symfony/config": "<6.2", + "symfony/dependency-injection": "<5.4", + "symfony/yaml": "<5.4" + }, + "require-dev": { + "doctrine/annotations": "^1.12|^2", + "psr/log": "^1|^2|^3", + "symfony/config": "^6.2|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Maps an HTTP request to a set of configuration variables", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "support": { + "source": "https://github.com/symfony/routing/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-30T13:55:02+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.4.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.4.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-12-26T14:02:43+00:00" + }, + { + "name": "symfony/string", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "7a14736fb179876575464e4658fce0c304e8c15b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/7a14736fb179876575464e4658fce0c304e8c15b", + "reference": "7a14736fb179876575464e4658fce0c304e8c15b", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-25T09:26:29+00:00" + }, + { + "name": "symfony/translation", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "637c51191b6b184184bbf98937702bcf554f7d04" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/637c51191b6b184184bbf98937702bcf554f7d04", + "reference": "637c51191b6b184184bbf98937702bcf554f7d04", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^2.5|^3.0" + }, + "conflict": { + "symfony/config": "<5.4", + "symfony/console": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<5.4", + "symfony/service-contracts": "<2.5", + "symfony/twig-bundle": "<5.4", + "symfony/yaml": "<5.4" + }, + "provide": { + "symfony/translation-implementation": "2.3|3.0" + }, + "require-dev": { + "nikic/php-parser": "^4.18|^5.0", + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/intl": "^5.4|^6.0|^7.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T13:11:52+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v3.4.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "06450585bf65e978026bda220cdebca3f867fde7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/06450585bf65e978026bda220cdebca3f867fde7", + "reference": "06450585bf65e978026bda220cdebca3f867fde7", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v3.4.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-12-26T14:02:43+00:00" + }, + { + "name": "symfony/uid", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/uid.git", + "reference": "1d31267211cc3a2fff32bcfc7c1818dac41b6fc0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/uid/zipball/1d31267211cc3a2fff32bcfc7c1818dac41b6fc0", + "reference": "1d31267211cc3a2fff32bcfc7c1818dac41b6fc0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-uuid": "^1.15" + }, + "require-dev": { + "symfony/console": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Uid\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to generate and represent UIDs", + "homepage": "https://symfony.com", + "keywords": [ + "UID", + "ulid", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/uid/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T14:51:35+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "0435a08f69125535336177c29d56af3abc1f69da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0435a08f69125535336177c29d56af3abc1f69da", + "reference": "0435a08f69125535336177c29d56af3abc1f69da", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/console": "<5.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^6.3|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/uid": "^5.4|^6.0|^7.0", + "twig/twig": "^2.13|^3.0.4" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T14:53:30+00:00" + }, + { + "name": "thecodingmachine/safe", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/safe.git", + "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/3115ecd6b4391662b4931daac4eba6b07a2ac1f0", + "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.5", + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "^3.2", + "thecodingmachine/phpstan-strict-rules": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "files": [ + "deprecated/apc.php", + "deprecated/array.php", + "deprecated/datetime.php", + "deprecated/libevent.php", + "deprecated/misc.php", + "deprecated/password.php", + "deprecated/mssql.php", + "deprecated/stats.php", + "deprecated/strings.php", + "lib/special_cases.php", + "deprecated/mysqli.php", + "generated/apache.php", + "generated/apcu.php", + "generated/array.php", + "generated/bzip2.php", + "generated/calendar.php", + "generated/classobj.php", + "generated/com.php", + "generated/cubrid.php", + "generated/curl.php", + "generated/datetime.php", + "generated/dir.php", + "generated/eio.php", + "generated/errorfunc.php", + "generated/exec.php", + "generated/fileinfo.php", + "generated/filesystem.php", + "generated/filter.php", + "generated/fpm.php", + "generated/ftp.php", + "generated/funchand.php", + "generated/gettext.php", + "generated/gmp.php", + "generated/gnupg.php", + "generated/hash.php", + "generated/ibase.php", + "generated/ibmDb2.php", + "generated/iconv.php", + "generated/image.php", + "generated/imap.php", + "generated/info.php", + "generated/inotify.php", + "generated/json.php", + "generated/ldap.php", + "generated/libxml.php", + "generated/lzf.php", + "generated/mailparse.php", + "generated/mbstring.php", + "generated/misc.php", + "generated/mysql.php", + "generated/network.php", + "generated/oci8.php", + "generated/opcache.php", + "generated/openssl.php", + "generated/outcontrol.php", + "generated/pcntl.php", + "generated/pcre.php", + "generated/pgsql.php", + "generated/posix.php", + "generated/ps.php", + "generated/pspell.php", + "generated/readline.php", + "generated/rpminfo.php", + "generated/rrd.php", + "generated/sem.php", + "generated/session.php", + "generated/shmop.php", + "generated/sockets.php", + "generated/sodium.php", + "generated/solr.php", + "generated/spl.php", + "generated/sqlsrv.php", + "generated/ssdeep.php", + "generated/ssh2.php", + "generated/stream.php", + "generated/strings.php", + "generated/swoole.php", + "generated/uodbc.php", + "generated/uopz.php", + "generated/url.php", + "generated/var.php", + "generated/xdiff.php", + "generated/xml.php", + "generated/xmlrpc.php", + "generated/yaml.php", + "generated/yaz.php", + "generated/zip.php", + "generated/zlib.php" + ], + "classmap": [ + "lib/DateTime.php", + "lib/DateTimeImmutable.php", + "lib/Exceptions/", + "deprecated/Exceptions/", + "generated/Exceptions/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP core functions that throw exceptions instead of returning FALSE on error", + "support": { + "issues": "https://github.com/thecodingmachine/safe/issues", + "source": "https://github.com/thecodingmachine/safe/tree/v2.5.0" + }, + "time": "2023-04-05T11:54:14+00:00" + }, + { + "name": "tijsverkoyen/css-to-inline-styles", + "version": "v2.2.7", + "source": { + "type": "git", + "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", + "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/83ee6f38df0a63106a9e4536e3060458b74ccedb", + "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "php": "^5.5 || ^7.0 || ^8.0", + "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5 || ^8.5.21 || ^9.5.10" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "TijsVerkoyen\\CssToInlineStyles\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Tijs Verkoyen", + "email": "css_to_inline_styles@verkoyen.eu", + "role": "Developer" + } + ], + "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", + "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", + "support": { + "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.2.7" + }, + "time": "2023-12-08T13:03:43+00:00" + }, + { + "name": "twilio/sdk", + "version": "7.12.0", + "source": { + "type": "git", + "url": "git@github.com:twilio/twilio-php.git", + "reference": "f281d7b793f02377ab0f38e7166e16820acc3eae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twilio/twilio-php/zipball/f281d7b793f02377ab0f38e7166e16820acc3eae", + "reference": "f281d7b793f02377ab0f38e7166e16820acc3eae", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.3 || ^7.0", + "phpunit/phpunit": ">=7.0 < 10" + }, + "suggest": { + "guzzlehttp/guzzle": "An HTTP client to execute the API requests" + }, + "type": "library", + "autoload": { + "psr-4": { + "Twilio\\": "src/Twilio/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Twilio API Team", + "email": "api@twilio.com" + } + ], + "description": "A PHP wrapper for Twilio's API", + "homepage": "https://github.com/twilio/twilio-php", + "keywords": [ + "api", + "sms", + "twilio" + ], + "time": "2023-10-19T11:57:30+00:00" + }, + { + "name": "unicodeveloper/laravel-paystack", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/unicodeveloper/laravel-paystack.git", + "reference": "4c50abd6902463c7688a51efaef3c2a2147f6860" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/unicodeveloper/laravel-paystack/zipball/4c50abd6902463c7688a51efaef3c2a2147f6860", + "reference": "4c50abd6902463c7688a51efaef3c2a2147f6860", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~6|~7|~8|~9", + "illuminate/support": "~6|~7|~8|~9|^10.0", + "php": "^7.2|^8.0|^8.1" + }, + "require-dev": { + "mockery/mockery": "^1.3", + "php-coveralls/php-coveralls": "^2.0", + "phpunit/phpunit": "^8.4|^9.0", + "scrutinizer/ocular": "~1.1" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Unicodeveloper\\Paystack\\PaystackServiceProvider" + ], + "aliases": { + "Paystack": "Unicodeveloper\\Paystack\\Facades\\Paystack" + } + } + }, + "autoload": { + "files": [ + "src/Support/helpers.php" + ], + "psr-4": { + "Unicodeveloper\\Paystack\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "unicodeveloper", + "email": "prosperotemuyiwa@gmail.com" + }, + { + "name": "iamfunsho", + "email": "info@devfunsho.com" + } + ], + "description": "A Laravel Package for Paystack", + "keywords": [ + "github", + "laravel", + "laravel 6", + "laravel 7", + "laravel 8", + "open source", + "payments", + "paystack", + "paystack.co", + "php", + "subscription" + ], + "support": { + "issues": "https://github.com/unicodeveloper/laravel-paystack/issues", + "source": "https://github.com/unicodeveloper/laravel-paystack/tree/1.1.0" + }, + "time": "2023-03-17T08:56:13+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v5.6.0", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", + "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "graham-campbell/result-type": "^1.1.2", + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.2", + "symfony/polyfill-ctype": "^1.24", + "symfony/polyfill-mbstring": "^1.24", + "symfony/polyfill-php80": "^1.24" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-filter": "*", + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + }, + "suggest": { + "ext-filter": "Required to use the boolean validator." + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": true + }, + "branch-alias": { + "dev-master": "5.6-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "https://github.com/vlucas" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "support": { + "issues": "https://github.com/vlucas/phpdotenv/issues", + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], + "time": "2023-11-12T22:43:29+00:00" + }, + { + "name": "voku/portable-ascii", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "b56450eed252f6801410d810c8e1727224ae0743" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", + "reference": "b56450eed252f6801410d810c8e1727224ae0743", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "type": "library", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "http://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/2.0.1" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "time": "2022-03-08T17:03:00+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "php": "^7.2 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, + "time": "2022-06-03T18:03:27+00:00" + }, + { + "name": "webonyx/graphql-php", + "version": "v14.11.10", + "source": { + "type": "git", + "url": "https://github.com/webonyx/graphql-php.git", + "reference": "d9c2fdebc6aa01d831bc2969da00e8588cffef19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/d9c2fdebc6aa01d831bc2969da00e8588cffef19", + "reference": "d9c2fdebc6aa01d831bc2969da00e8588cffef19", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "php": "^7.1 || ^8" + }, + "require-dev": { + "amphp/amp": "^2.3", + "doctrine/coding-standard": "^6.0", + "nyholm/psr7": "^1.2", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "0.12.82", + "phpstan/phpstan-phpunit": "0.12.18", + "phpstan/phpstan-strict-rules": "0.12.9", + "phpunit/phpunit": "^7.2 || ^8.5", + "psr/http-message": "^1.0", + "react/promise": "2.*", + "simpod/php-coveralls-mirror": "^3.0" + }, + "suggest": { + "psr/http-message": "To use standard GraphQL server", + "react/promise": "To leverage async resolving on React PHP platform" + }, + "type": "library", + "autoload": { + "psr-4": { + "GraphQL\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP port of GraphQL reference implementation", + "homepage": "https://github.com/webonyx/graphql-php", + "keywords": [ + "api", + "graphql" + ], + "support": { + "issues": "https://github.com/webonyx/graphql-php/issues", + "source": "https://github.com/webonyx/graphql-php/tree/v14.11.10" + }, + "funding": [ + { + "url": "https://opencollective.com/webonyx-graphql-php", + "type": "open_collective" + } + ], + "time": "2023-07-05T14:23:37+00:00" + }, + { + "name": "xendit/xendit-php", + "version": "3.7.0", + "source": { + "type": "git", + "url": "https://github.com/xendit/xendit-php.git", + "reference": "cbbffbdfec3feedb1d5176c5bb0e1d0e7d12f451" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/xendit/xendit-php/zipball/cbbffbdfec3feedb1d5176c5bb0e1d0e7d12f451", + "reference": "cbbffbdfec3feedb1d5176c5bb0e1d0e7d12f451", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^1.7 || ^2.0", + "php": "^7.4 || ^8.0", + "vlucas/phpdotenv": "^5.5" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.5", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Xendit\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "unlicense" + ], + "authors": [ + { + "name": "OpenAPI-Generator contributors", + "homepage": "https://openapi-generator.tech" + } + ], + "description": "Xendit PHP SDK", + "homepage": "https://openapi-generator.tech", + "keywords": [ + "api", + "openapi", + "openapi-generator", + "openapitools", + "php", + "rest", + "sdk" + ], + "support": { + "issues": "https://github.com/xendit/xendit-php/issues", + "source": "https://github.com/xendit/xendit-php/tree/3.7.0" + }, + "time": "2023-11-29T07:18:13+00:00" + } + ], + "packages-dev": [ + { + "name": "fakerphp/faker", + "version": "v1.21.0", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/92efad6a967f0b79c499705c69b662f738cc9e4d", + "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "doctrine/persistence": "^1.3 || ^2.0", + "ext-intl": "*", + "phpunit/phpunit": "^9.5.26", + "symfony/phpunit-bridge": "^5.4.16" + }, + "suggest": { + "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "v1.21-dev" + } + }, + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v1.21.0" + }, + "time": "2022-12-13T13:54:32+00:00" + }, + { + "name": "filp/whoops", + "version": "2.15.4", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/a139776fa3f5985a50b509f2a02ff0f709d2a546", + "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546", + "shasum": "" + }, + "require": { + "php": "^5.5.9 || ^7.0 || ^8.0", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "require-dev": { + "mockery/mockery": "^0.9 || ^1.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" + ], + "support": { + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.15.4" + }, + "funding": [ + { + "url": "https://github.com/denis-sokolov", + "type": "github" + } + ], + "time": "2023-11-03T12:00:00+00:00" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0|^8.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "support": { + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + }, + "time": "2020-07-09T08:09:16+00:00" + }, + { + "name": "laravel/sail", + "version": "v1.21.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/sail.git", + "reference": "758a914fc4da41f3f6ca5522c85902181b228bd1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/sail/zipball/758a914fc4da41f3f6ca5522c85902181b228bd1", + "reference": "758a914fc4da41f3f6ca5522c85902181b228bd1", + "shasum": "" + }, + "require": { + "illuminate/console": "^8.0|^9.0|^10.0", + "illuminate/contracts": "^8.0|^9.0|^10.0", + "illuminate/support": "^8.0|^9.0|^10.0", + "php": "^7.3|^8.0", + "symfony/yaml": "^6.0" + }, + "bin": [ + "bin/sail" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Sail\\SailServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Sail\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Docker files for running a basic Laravel application.", + "keywords": [ + "docker", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/sail/issues", + "source": "https://github.com/laravel/sail" + }, + "time": "2023-02-16T19:16:27+00:00" + }, + { + "name": "mockery/mockery", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/e92dcc83d5a51851baf5f5591d32cb2b16e3684e", + "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "^2.0.1", + "lib-pcre": ">=7.0", + "php": "^7.3 || ^8.0" + }, + "conflict": { + "phpunit/phpunit": "<8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5 || ^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mockery": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "support": { + "issues": "https://github.com/mockery/mockery/issues", + "source": "https://github.com/mockery/mockery/tree/1.5.1" + }, + "time": "2022-09-07T15:32:08+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "nunomaduro/collision", + "version": "v7.0.5", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/collision.git", + "reference": "5c654ee5fa187cf2f4cb226d773582ec6d402a55" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/5c654ee5fa187cf2f4cb226d773582ec6d402a55", + "reference": "5c654ee5fa187cf2f4cb226d773582ec6d402a55", + "shasum": "" + }, + "require": { + "filp/whoops": "^2.14.6", + "nunomaduro/termwind": "^1.15.1", + "php": "^8.1.0", + "symfony/console": "^6.2.5" + }, + "require-dev": { + "laravel/framework": "^10.0.3", + "laravel/pint": "^1.5.0", + "laravel/sail": "^1.20.2", + "laravel/sanctum": "^3.2.1", + "laravel/tinker": "^2.8.0", + "nunomaduro/larastan": "^2.4.1", + "orchestra/testbench-core": "^8.0.1", + "pestphp/pest": "^2.0.0", + "phpunit/phpunit": "^10.0.9", + "sebastian/environment": "^6.0.0", + "spatie/laravel-ignition": "^2.0.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], + "psr-4": { + "NunoMaduro\\Collision\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Cli error handling for console/command-line PHP applications.", + "keywords": [ + "artisan", + "cli", + "command-line", + "console", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" + ], + "support": { + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2023-02-19T16:25:13+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "10.1.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "78c3b7625965c2513ee96569a4dbb62601784145" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/78c3b7625965c2513ee96569a4dbb62601784145", + "reference": "78c3b7625965c2513ee96569a4dbb62601784145", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.11" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T15:38:30+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T06:24:48+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:56:09+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T14:07:24+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:57:52+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "10.0.13", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "c37a88d7a905266eab6498817a1bf1170043313f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c37a88d7a905266eab6498817a1bf1170043313f", + "reference": "c37a88d7a905266eab6498817a1bf1170043313f", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.0", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.0", + "sebastian/global-state": "^6.0", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" + }, + "suggest": { + "ext-soap": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.0-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.13" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2023-02-27T13:07:57+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:15+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:43+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:59:15+00:00" + }, + { + "name": "sebastian/comparator", + "version": "5.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-14T13:18:12+00:00" + }, + { + "name": "sebastian/complexity", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "68ff824baeae169ec9f2137158ee529584553799" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:37:17+00:00" + }, + { + "name": "sebastian/diff", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T10:55:06+00:00" + }, + { + "name": "sebastian/environment", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-04-11T05:39:26+00:00" + }, + { + "name": "sebastian/exporter", + "version": "5.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-09-24T13:22:09+00:00" + }, + { + "name": "sebastian/global-state", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-07-19T07:19:23+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:38:20+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:08:32+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:06:18+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:05:40+00:00" + }, + { + "name": "sebastian/type", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:10:45+00:00" + }, + { + "name": "sebastian/version", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-07T11:34:05+00:00" + }, + { + "name": "spatie/backtrace", + "version": "1.5.3", + "source": { + "type": "git", + "url": "https://github.com/spatie/backtrace.git", + "reference": "483f76a82964a0431aa836b6ed0edde0c248e3ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/backtrace/zipball/483f76a82964a0431aa836b6ed0edde0c248e3ab", + "reference": "483f76a82964a0431aa836b6ed0edde0c248e3ab", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "ext-json": "*", + "phpunit/phpunit": "^9.3", + "spatie/phpunit-snapshot-assertions": "^4.2", + "symfony/var-dumper": "^5.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Backtrace\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van de Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A better backtrace", + "homepage": "https://github.com/spatie/backtrace", + "keywords": [ + "Backtrace", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/backtrace/tree/1.5.3" + }, + "funding": [ + { + "url": "https://github.com/sponsors/spatie", + "type": "github" + }, + { + "url": "https://spatie.be/open-source/support-us", + "type": "other" + } + ], + "time": "2023-06-28T12:59:17+00:00" + }, + { + "name": "spatie/flare-client-php", + "version": "1.4.4", + "source": { + "type": "git", + "url": "https://github.com/spatie/flare-client-php.git", + "reference": "17082e780752d346c2db12ef5d6bee8e835e399c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/17082e780752d346c2db12ef5d6bee8e835e399c", + "reference": "17082e780752d346c2db12ef5d6bee8e835e399c", + "shasum": "" + }, + "require": { + "illuminate/pipeline": "^8.0|^9.0|^10.0|^11.0", + "php": "^8.0", + "spatie/backtrace": "^1.5.2", + "symfony/http-foundation": "^5.2|^6.0|^7.0", + "symfony/mime": "^5.2|^6.0|^7.0", + "symfony/process": "^5.2|^6.0|^7.0", + "symfony/var-dumper": "^5.2|^6.0|^7.0" + }, + "require-dev": { + "dms/phpunit-arraysubset-asserts": "^0.5.0", + "pestphp/pest": "^1.20|^2.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "spatie/phpunit-snapshot-assertions": "^4.0|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.3.x-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Spatie\\FlareClient\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Send PHP errors to Flare", + "homepage": "https://github.com/spatie/flare-client-php", + "keywords": [ + "exception", + "flare", + "reporting", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/flare-client-php/issues", + "source": "https://github.com/spatie/flare-client-php/tree/1.4.4" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2024-01-31T14:18:45+00:00" + }, + { + "name": "spatie/ignition", + "version": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/ignition.git", + "reference": "5b6f801c605a593106b623e45ca41496a6e7d56d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/ignition/zipball/5b6f801c605a593106b623e45ca41496a6e7d56d", + "reference": "5b6f801c605a593106b623e45ca41496a6e7d56d", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "php": "^8.0", + "spatie/backtrace": "^1.5.3", + "spatie/flare-client-php": "^1.4.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" + }, + "require-dev": { + "illuminate/cache": "^9.52|^10.0|^11.0", + "mockery/mockery": "^1.4", + "pestphp/pest": "^1.20|^2.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "psr/simple-cache-implementation": "*", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "vlucas/phpdotenv": "^5.5" + }, + "suggest": { + "openai-php/client": "Require get solutions from OpenAI", + "simple-cache-implementation": "To cache solutions from OpenAI" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Spatie\\Ignition\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Spatie", + "email": "info@spatie.be", + "role": "Developer" + } + ], + "description": "A beautiful error page for PHP applications.", + "homepage": "https://flareapp.io/ignition", + "keywords": [ + "error", + "flare", + "laravel", + "page" + ], + "support": { + "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction", + "forum": "https://twitter.com/flareappio", + "issues": "https://github.com/spatie/ignition/issues", + "source": "https://github.com/spatie/ignition" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2024-01-03T15:49:39+00:00" + }, + { + "name": "spatie/laravel-ignition", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-ignition.git", + "reference": "70c0e2a22c5c4b691a34db8c98bd6d695660a97a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/70c0e2a22c5c4b691a34db8c98bd6d695660a97a", + "reference": "70c0e2a22c5c4b691a34db8c98bd6d695660a97a", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "illuminate/support": "^10.0", + "php": "^8.1", + "spatie/flare-client-php": "^1.3.5", + "spatie/ignition": "^1.4.3", + "symfony/console": "^6.2.3", + "symfony/var-dumper": "^6.2.3" + }, + "require-dev": { + "livewire/livewire": "^2.11", + "mockery/mockery": "^1.5.1", + "orchestra/testbench": "^8.0", + "pestphp/pest": "^1.22.3", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan-deprecation-rules": "^1.1.1", + "phpstan/phpstan-phpunit": "^1.3.3" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\LaravelIgnition\\IgnitionServiceProvider" + ], + "aliases": { + "Flare": "Spatie\\LaravelIgnition\\Facades\\Flare" + } + }, + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Spatie\\LaravelIgnition\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Spatie", + "email": "info@spatie.be", + "role": "Developer" + } + ], + "description": "A beautiful error page for Laravel applications.", + "homepage": "https://flareapp.io/ignition", + "keywords": [ + "error", + "flare", + "laravel", + "page" + ], + "support": { + "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction", + "forum": "https://twitter.com/flareappio", + "issues": "https://github.com/spatie/laravel-ignition/issues", + "source": "https://github.com/spatie/laravel-ignition" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2023-01-24T07:20:39+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.7.2", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2023-02-22T23:07:41+00:00" + }, + { + "name": "symfony/yaml", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "d75715985f0f94f978e3a8fa42533e10db921b90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/d75715985f0f94f978e3a8fa42533e10db921b90", + "reference": "d75715985f0f94f978e3a8fa42533e10db921b90", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<5.4" + }, + "require-dev": { + "symfony/console": "^5.4|^6.0|^7.0" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v6.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T14:51:35+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2023-11-20T00:12:19+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": { + "karim007/laravel-bkash-tokenize": 20, + "marvel/shop": 20, + "kingflamez/laravelrave": 20 + }, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": "^8.0|^8.1" + }, + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/config/app.php b/config/app.php new file mode 100644 index 0000000..729bbd6 --- /dev/null +++ b/config/app.php @@ -0,0 +1,231 @@ + env('APP_NAME', 'Laravel'), + + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services the application utilizes. Set this in your ".env" file. + | + */ + + 'env' => env('APP_ENV', 'production'), + + /* + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | + */ + + 'debug' => (bool) env('APP_DEBUG', false), + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | + */ + + 'url' => env('APP_URL', 'http://localhost'), + + 'asset_url' => env('ASSET_URL', null), + + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. We have gone + | ahead and set this to a sensible default for you out of the box. + | + */ + + 'timezone' => 'UTC', + + /* + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by the translation service provider. You are free to set this value + | to any of the locales which will be supported by the application. + | + */ + + 'locale' => 'en', + + /* + |-------------------------------------------------------------------------- + | Application Fallback Locale + |-------------------------------------------------------------------------- + | + | The fallback locale determines the locale to use when the current one + | is not available. You may change the value to correspond to any of + | the language folders that are provided through your application. + | + */ + + 'fallback_locale' => 'en', + + /* + |-------------------------------------------------------------------------- + | Faker Locale + |-------------------------------------------------------------------------- + | + | This locale will be used by the Faker PHP library when generating fake + | data for your database seeds. For example, this will be used to get + | localized telephone numbers, street address information and more. + | + */ + + 'faker_locale' => 'en_US', + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | + */ + + 'key' => env('APP_KEY'), + + 'cipher' => 'AES-256-CBC', + + /* + |-------------------------------------------------------------------------- + | Autoloaded Service Providers + |-------------------------------------------------------------------------- + | + | The service providers listed here will be automatically loaded on the + | request to your application. Feel free to add your own services to + | this array to grant expanded functionality to your applications. + | + */ + + 'providers' => [ + + /* + * Laravel Framework Service Providers... + */ + Illuminate\Auth\AuthServiceProvider::class, + Illuminate\Broadcasting\BroadcastServiceProvider::class, + Illuminate\Bus\BusServiceProvider::class, + Illuminate\Cache\CacheServiceProvider::class, + Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, + Illuminate\Cookie\CookieServiceProvider::class, + Illuminate\Database\DatabaseServiceProvider::class, + Illuminate\Encryption\EncryptionServiceProvider::class, + Illuminate\Filesystem\FilesystemServiceProvider::class, + Illuminate\Foundation\Providers\FoundationServiceProvider::class, + Illuminate\Hashing\HashServiceProvider::class, + Illuminate\Mail\MailServiceProvider::class, + Illuminate\Notifications\NotificationServiceProvider::class, + Illuminate\Pagination\PaginationServiceProvider::class, + Illuminate\Pipeline\PipelineServiceProvider::class, + Illuminate\Queue\QueueServiceProvider::class, + Illuminate\Redis\RedisServiceProvider::class, + Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, + Illuminate\Session\SessionServiceProvider::class, + Illuminate\Translation\TranslationServiceProvider::class, + Illuminate\Validation\ValidationServiceProvider::class, + Illuminate\View\ViewServiceProvider::class, + + /* + * Package Service Providers... + */ + + /* + * Application Service Providers... + */ + App\Providers\AppServiceProvider::class, + App\Providers\AuthServiceProvider::class, + App\Providers\BroadcastServiceProvider::class, + App\Providers\EventServiceProvider::class, + App\Providers\RouteServiceProvider::class, + ], + + /* + |-------------------------------------------------------------------------- + | Class Aliases + |-------------------------------------------------------------------------- + | + | This array of class aliases will be registered when this application + | is started. However, feel free to register as many as you wish as + | the aliases are "lazy" loaded so they don't hinder performance. + | + */ + + 'aliases' => [ + + 'App' => Illuminate\Support\Facades\App::class, + 'Arr' => Illuminate\Support\Arr::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + 'File' => Illuminate\Support\Facades\File::class, + 'Gate' => Illuminate\Support\Facades\Gate::class, + 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Http' => Illuminate\Support\Facades\Http::class, + 'Lang' => Illuminate\Support\Facades\Lang::class, + 'Log' => Illuminate\Support\Facades\Log::class, + 'Mail' => Illuminate\Support\Facades\Mail::class, + 'Notification' => Illuminate\Support\Facades\Notification::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + // 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'Str' => Illuminate\Support\Str::class, + 'URL' => Illuminate\Support\Facades\URL::class, + 'Validator' => Illuminate\Support\Facades\Validator::class, + 'View' => Illuminate\Support\Facades\View::class, + + ], + +]; diff --git a/config/auth.php b/config/auth.php new file mode 100644 index 0000000..ba1a4d8 --- /dev/null +++ b/config/auth.php @@ -0,0 +1,117 @@ + [ + 'guard' => 'web', + 'passwords' => 'users', + ], + + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session", "token" + | + */ + + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + + 'api' => [ + 'driver' => 'token', + 'provider' => 'users', + 'hash' => false, + ], + ], + + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | + */ + + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => App\Models\User::class, + ], + + // 'users' => [ + // 'driver' => 'database', + // 'table' => 'users', + // ], + ], + + /* + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | You may specify multiple password reset configurations if you have more + | than one user table or model in the application and you want to have + | separate password reset settings based on the specific user types. + | + | The expire time is the number of minutes that the reset token should be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + */ + + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'table' => 'password_resets', + 'expire' => 60, + 'throttle' => 60, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the amount of seconds before a password confirmation + | times out and the user is prompted to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | + */ + + 'password_timeout' => 10800, + +]; diff --git a/config/broadcasting.php b/config/broadcasting.php new file mode 100644 index 0000000..ef20859 --- /dev/null +++ b/config/broadcasting.php @@ -0,0 +1,64 @@ + env('BROADCAST_DRIVER', 'null'), + + /* + |-------------------------------------------------------------------------- + | Broadcast Connections + |-------------------------------------------------------------------------- + | + | Here you may define all of the broadcast connections that will be used + | to broadcast events to other systems or over websockets. Samples of + | each available type of connection are provided inside this array. + | + */ + + 'connections' => [ + + 'pusher' => [ + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), + 'options' => [ + 'cluster' => env('PUSHER_APP_CLUSTER'), + 'useTLS' => true, + ], + ], + + 'ably' => [ + 'driver' => 'ably', + 'key' => env('ABLY_KEY'), + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + ], + + 'log' => [ + 'driver' => 'log', + ], + + 'null' => [ + 'driver' => 'null', + ], + + ], + +]; diff --git a/config/cache.php b/config/cache.php new file mode 100644 index 0000000..9473acc --- /dev/null +++ b/config/cache.php @@ -0,0 +1,104 @@ + env('CACHE_DRIVER', 'file'), + + /* + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | + | Supported drivers: "apc", "array", "database", "file", + | "memcached", "redis", "dynamodb", "null" + | + */ + + 'stores' => [ + + 'apc' => [ + 'driver' => 'apc', + ], + + 'array' => [ + 'driver' => 'array', + 'serialize' => false, + ], + + 'database' => [ + 'driver' => 'database', + 'table' => 'cache', + 'connection' => null, + ], + + 'file' => [ + 'driver' => 'file', + 'path' => storage_path('framework/cache/data'), + ], + + 'memcached' => [ + 'driver' => 'memcached', + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), + 'sasl' => [ + env('MEMCACHED_USERNAME'), + env('MEMCACHED_PASSWORD'), + ], + 'options' => [ + // Memcached::OPT_CONNECT_TIMEOUT => 2000, + ], + 'servers' => [ + [ + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), + 'weight' => 100, + ], + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'cache', + ], + + 'dynamodb' => [ + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing a RAM based store such as APC or Memcached, there might + | be other applications utilizing the same cache. So, we'll specify a + | value to get prefixed to all our keys so we can avoid collisions. + | + */ + + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), + +]; diff --git a/config/cors.php b/config/cors.php new file mode 100644 index 0000000..8a39e6d --- /dev/null +++ b/config/cors.php @@ -0,0 +1,34 @@ + ['api/*', 'sanctum/csrf-cookie'], + + 'allowed_methods' => ['*'], + + 'allowed_origins' => ['*'], + + 'allowed_origins_patterns' => [], + + 'allowed_headers' => ['*'], + + 'exposed_headers' => [], + + 'max_age' => 0, + + 'supports_credentials' => false, + +]; diff --git a/config/database.php b/config/database.php new file mode 100644 index 0000000..d5a7215 --- /dev/null +++ b/config/database.php @@ -0,0 +1,147 @@ + env('DB_CONNECTION', 'mysql'), + + /* + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Here are each of the database connections setup for your application. + | Of course, examples of configuring each database platform that is + | supported by Laravel is shown below to make development simple. + | + | + | All database work in Laravel is done through the PHP PDO facilities + | so make sure you have the driver for your particular database of + | choice installed on your machine before you begin development. + | + */ + + 'connections' => [ + + 'sqlite' => [ + 'driver' => 'sqlite', + 'url' => env('DATABASE_URL'), + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', + 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), + ], + + 'mysql' => [ + 'driver' => 'mysql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => false, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + + 'pgsql' => [ + 'driver' => 'pgsql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', + 'prefix_indexes' => true, + 'schema' => 'public', + 'sslmode' => 'prefer', + ], + + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', + 'prefix_indexes' => true, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk haven't actually been run in the database. + | + */ + + 'migrations' => 'migrations', + + /* + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer body of commands than a typical key-value system + | such as APC or Memcached. Laravel makes it easy to dig right in. + | + */ + + 'redis' => [ + + 'client' => env('REDIS_CLIENT', 'phpredis'), + + 'options' => [ + 'cluster' => env('REDIS_CLUSTER', 'redis'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), + ], + + 'default' => [ + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'password' => env('REDIS_PASSWORD', null), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_DB', '0'), + ], + + 'cache' => [ + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'password' => env('REDIS_PASSWORD', null), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_CACHE_DB', '1'), + ], + + ], + +]; diff --git a/config/filesystems.php b/config/filesystems.php new file mode 100644 index 0000000..9a02201 --- /dev/null +++ b/config/filesystems.php @@ -0,0 +1,73 @@ + env('FILESYSTEM_DISK', 'local'), + + /* + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Here you may configure as many filesystem "disks" as you wish, and you + | may even configure multiple disks of the same driver. Defaults have + | been setup for each driver as an example of the required options. + | + | Supported Drivers: "local", "ftp", "sftp", "s3" + | + */ + + 'disks' => [ + + 'local' => [ + 'driver' => 'local', + 'root' => storage_path('app'), + ], + + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL') . '/storage', + 'visibility' => 'public', + ], + + 's3' => [ + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + 'endpoint' => env('AWS_ENDPOINT'), + 'visibility' => 'public', + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Symbolic Links + |-------------------------------------------------------------------------- + | + | Here you may configure the symbolic links that will be created when the + | `storage:link` Artisan command is executed. The array keys should be + | the locations of the links and the values should be their targets. + | + */ + + 'links' => [ + public_path('storage') => storage_path('app/public'), + ], + +]; diff --git a/config/flutterwave.php b/config/flutterwave.php new file mode 100644 index 0000000..f3af081 --- /dev/null +++ b/config/flutterwave.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + + /** + * Public Key: Your Rave publicKey. Sign up on https://dashboard.flutterwave.com/ to get one from your settings page + * + */ + 'publicKey' => env('FLW_PUBLIC_KEY'), + + /** + * Secret Key: Your Rave secretKey. Sign up on https://dashboard.flutterwave.com/ to get one from your settings page + * + */ + 'secretKey' => env('FLW_SECRET_KEY'), + + /** + * Prefix: Secret hash for webhook + * + */ + 'secretHash' => env('FLW_SECRET_HASH', ''), +]; diff --git a/config/hashing.php b/config/hashing.php new file mode 100644 index 0000000..8425770 --- /dev/null +++ b/config/hashing.php @@ -0,0 +1,52 @@ + 'bcrypt', + + /* + |-------------------------------------------------------------------------- + | Bcrypt Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Bcrypt algorithm. This will allow you + | to control the amount of time it takes to hash the given password. + | + */ + + 'bcrypt' => [ + 'rounds' => env('BCRYPT_ROUNDS', 10), + ], + + /* + |-------------------------------------------------------------------------- + | Argon Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Argon algorithm. These will allow you + | to control the amount of time it takes to hash the given password. + | + */ + + 'argon' => [ + 'memory' => 1024, + 'threads' => 2, + 'time' => 2, + ], + +]; diff --git a/config/logging.php b/config/logging.php new file mode 100644 index 0000000..6aa77fe --- /dev/null +++ b/config/logging.php @@ -0,0 +1,104 @@ + env('LOG_CHANNEL', 'stack'), + + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Out of + | the box, Laravel uses the Monolog PHP logging library. This gives + | you a variety of powerful log handlers / formatters to utilize. + | + | Available Drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", + | "custom", "stack" + | + */ + + 'channels' => [ + 'stack' => [ + 'driver' => 'stack', + 'channels' => ['single'], + 'ignore_exceptions' => false, + ], + + 'single' => [ + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + ], + + 'daily' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'days' => 14, + ], + + 'slack' => [ + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'username' => 'Laravel Log', + 'emoji' => ':boom:', + 'level' => env('LOG_LEVEL', 'critical'), + ], + + 'papertrail' => [ + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => SyslogUdpHandler::class, + 'handler_with' => [ + 'host' => env('PAPERTRAIL_URL'), + 'port' => env('PAPERTRAIL_PORT'), + ], + ], + + 'stderr' => [ + 'driver' => 'monolog', + 'handler' => StreamHandler::class, + 'formatter' => env('LOG_STDERR_FORMATTER'), + 'with' => [ + 'stream' => 'php://stderr', + ], + ], + + 'syslog' => [ + 'driver' => 'syslog', + 'level' => env('LOG_LEVEL', 'debug'), + ], + + 'errorlog' => [ + 'driver' => 'errorlog', + 'level' => env('LOG_LEVEL', 'debug'), + ], + + 'null' => [ + 'driver' => 'monolog', + 'handler' => NullHandler::class, + ], + + 'emergency' => [ + 'path' => storage_path('logs/laravel.log'), + ], + ], + +]; diff --git a/config/mail.php b/config/mail.php new file mode 100644 index 0000000..54299aa --- /dev/null +++ b/config/mail.php @@ -0,0 +1,110 @@ + env('MAIL_MAILER', 'smtp'), + + /* + |-------------------------------------------------------------------------- + | Mailer Configurations + |-------------------------------------------------------------------------- + | + | Here you may configure all of the mailers used by your application plus + | their respective settings. Several examples have been configured for + | you and you are free to add your own as your application requires. + | + | Laravel supports a variety of mail "transport" drivers to be used while + | sending an e-mail. You will specify which one you are using for your + | mailers below. You are free to add additional mailers as required. + | + | Supported: "smtp", "sendmail", "mailgun", "ses", + | "postmark", "log", "array" + | + */ + + 'mailers' => [ + 'smtp' => [ + 'transport' => 'smtp', + 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), + 'port' => env('MAIL_PORT', 587), + 'encryption' => env('MAIL_ENCRYPTION', 'tls'), + 'username' => env('MAIL_USERNAME'), + 'password' => env('MAIL_PASSWORD'), + 'timeout' => null, + 'auth_mode' => null, + ], + + 'ses' => [ + 'transport' => 'ses', + ], + + 'mailgun' => [ + 'transport' => 'mailgun', + ], + + 'postmark' => [ + 'transport' => 'postmark', + ], + + 'sendmail' => [ + 'transport' => 'sendmail', + 'path' => '/usr/sbin/sendmail -bs', + ], + + 'log' => [ + 'transport' => 'log', + 'channel' => env('MAIL_LOG_CHANNEL'), + ], + + 'array' => [ + 'transport' => 'array', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all e-mails sent by your application to be sent from + | the same address. Here, you may specify a name and address that is + | used globally for all e-mails that are sent by your application. + | + */ + + 'from' => [ + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), + 'name' => env('MAIL_FROM_NAME', 'Example'), + ], + + /* + |-------------------------------------------------------------------------- + | Markdown Mail Settings + |-------------------------------------------------------------------------- + | + | If you are using Markdown based email rendering, you may configure your + | theme and component paths here, allowing you to customize the design + | of the emails. Or, you may simply stick with the Laravel defaults! + | + */ + + 'markdown' => [ + 'theme' => 'default', + + 'paths' => [ + resource_path('views/vendor/mail'), + ], + ], + +]; diff --git a/config/money.php b/config/money.php new file mode 100644 index 0000000..04ce3d6 --- /dev/null +++ b/config/money.php @@ -0,0 +1,21 @@ + config('app.locale', 'en_US'), + 'defaultCurrency' => config('app.currency', 'USD'), + 'defaultFormatter' => null, + 'isoCurrenciesPath' => __DIR__.'/../vendor/moneyphp/money/resources/currency.php', + 'currencies' => [ + 'iso' => 'all', + 'bitcoin' => 'all', + 'custom' => [ + // 'MY1' => 2, + // 'MY2' => 3 + ], + ], +]; diff --git a/config/pdf.php b/config/pdf.php new file mode 100644 index 0000000..74afe79 --- /dev/null +++ b/config/pdf.php @@ -0,0 +1,26 @@ + 'utf-8', + 'format' => 'A4', + 'author' => '', + 'subject' => '', + 'keywords' => '', + 'creator' => 'Laravel Pdf', + 'display_mode' => 'fullpage', + 'tempDir' => storage_path('app/temp'), // base_path(storage_path('app/public')), + 'pdf_a' => false, + 'pdf_a_auto' => false, + 'icc_profile_path' => '', + 'font_path' => base_path('resources/fonts/'), + 'font_data' => [ + 'bangla' => [ + 'R' => 'SolaimanLipi.ttf', // regular font + 'B' => 'SolaimanLipi.ttf', // optional: bold font + 'I' => 'SolaimanLipi.ttf', // optional: italic font + 'BI' => 'SolaimanLipi.ttf', // optional: bold-italic font + 'useOTL' => 0xFF, + 'useKashida' => 75, + ] + ], +]; diff --git a/config/purify.php b/config/purify.php new file mode 100644 index 0000000..70a0999 --- /dev/null +++ b/config/purify.php @@ -0,0 +1,86 @@ + 'default', + + /* + |-------------------------------------------------------------------------- + | Config sets + |-------------------------------------------------------------------------- + | + | Here you may configure various sets of configuration for differentiated use of HTMLPurifier. + | A specific set of configuration can be applied by calling the "config($name)" method on + | a Purify instance. Feel free to add/remove/customize these attributes as you wish. + | + | Documentation: http://htmlpurifier.org/live/configdoc/plain.html + | + | Core.Encoding The encoding to convert input to. + | HTML.Doctype Doctype to use during filtering. + | HTML.Allowed The allowed HTML Elements with their allowed attributes. + | HTML.ForbiddenElements The forbidden HTML elements. Elements that are listed in this + | string will be removed, however their content will remain. + | CSS.AllowedProperties The Allowed CSS properties. + | AutoFormat.AutoParagraph Newlines are converted in to paragraphs whenever possible. + | AutoFormat.RemoveEmpty Remove empty elements that contribute no semantic information to the document. + | + */ + + 'configs' => [ + + 'default' => [ + 'Core.Encoding' => 'utf-8', + 'HTML.Doctype' => 'HTML 4.01 Transitional', + 'HTML.Allowed' => 'h1,h2,h3,h4,h5,h6,b,strong,i,em,s,del,a[href|title],ul,ol,li,p[style],br,span,img[width|height|alt|src]', + 'HTML.ForbiddenElements' => '', + 'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align', + 'AutoFormat.AutoParagraph' => false, + 'AutoFormat.RemoveEmpty' => false, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | HTMLPurifier definitions + |-------------------------------------------------------------------------- + | + | Here you may specify a class that augments the HTML definitions used by + | HTMLPurifier. Additional HTML5 definitions are provided out of the box. + | When specifying a custom class, make sure it implements the interface: + | + | \Stevebauman\Purify\Definitions\Definition + | + | Note that these definitions are applied to every Purifier instance. + | + | Documentation: http://htmlpurifier.org/docs/enduser-customize.html + | + */ + + 'definitions' => Html5Definition::class, + + /* + |-------------------------------------------------------------------------- + | Serializer location + |-------------------------------------------------------------------------- + | + | The location where HTMLPurifier can store its temporary serializer files. + | The filepath should be accessible and writable by the web server. + | A good place for this is in the framework's own storage path. + | + */ + + 'serializer' => storage_path('app/purify'), + +]; diff --git a/config/queue.php b/config/queue.php new file mode 100644 index 0000000..1222296 --- /dev/null +++ b/config/queue.php @@ -0,0 +1,89 @@ + env('QUEUE_CONNECTION', 'sync'), + + /* + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection information for each server that + | is used by your application. A default configuration has been added + | for each back-end shipped with Laravel. You are free to add more. + | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" + | + */ + + 'connections' => [ + + 'sync' => [ + 'driver' => 'sync', + ], + + 'database' => [ + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', + 'retry_after' => 90, + ], + + 'beanstalkd' => [ + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', + 'retry_after' => 90, + 'block_for' => 0, + ], + + 'sqs' => [ + 'driver' => 'sqs', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), + 'queue' => env('SQS_QUEUE', 'your-queue-name'), + 'suffix' => env('SQS_SUFFIX'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => env('REDIS_QUEUE', 'default'), + 'retry_after' => 90, + 'block_for' => null, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control which database and table are used to store the jobs that + | have failed. You may change them to any database / table you wish. + | + */ + + 'failed' => [ + 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), + 'database' => env('DB_CONNECTION', 'mysql'), + 'table' => 'failed_jobs', + ], + +]; diff --git a/config/services.php b/config/services.php new file mode 100644 index 0000000..2a1d616 --- /dev/null +++ b/config/services.php @@ -0,0 +1,33 @@ + [ + 'domain' => env('MAILGUN_DOMAIN'), + 'secret' => env('MAILGUN_SECRET'), + 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), + ], + + 'postmark' => [ + 'token' => env('POSTMARK_TOKEN'), + ], + + 'ses' => [ + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + ], + +]; diff --git a/config/session.php b/config/session.php new file mode 100644 index 0000000..4e0f66c --- /dev/null +++ b/config/session.php @@ -0,0 +1,201 @@ + env('SESSION_DRIVER', 'file'), + + /* + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to immediately expire on the browser closing, set that option. + | + */ + + 'lifetime' => env('SESSION_LIFETIME', 120), + + 'expire_on_close' => false, + + /* + |-------------------------------------------------------------------------- + | Session Encryption + |-------------------------------------------------------------------------- + | + | This option allows you to easily specify that all of your session data + | should be encrypted before it is stored. All encryption will be run + | automatically by Laravel and you can use the Session like normal. + | + */ + + 'encrypt' => false, + + /* + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When using the native session driver, we need a location where session + | files may be stored. A default has been set for you but a different + | location may be specified. This is only needed for file sessions. + | + */ + + 'files' => storage_path('framework/sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | + */ + + 'connection' => env('SESSION_CONNECTION', null), + + /* + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table we + | should use to manage the sessions. Of course, a sensible default is + | provided for you; however, you are free to change this as needed. + | + */ + + 'table' => 'sessions', + + /* + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | While using one of the framework's cache driven session backends you may + | list a cache store that should be used for these sessions. This value + | must match with one of the application's configured cache "stores". + | + | Affects: "apc", "dynamodb", "memcached", "redis" + | + */ + + 'store' => env('SESSION_STORE', null), + + /* + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | + */ + + 'lottery' => [2, 100], + + /* + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the cookie used to identify a session + | instance by ID. The name specified here will get used every time a + | new session cookie is created by the framework for every driver. + | + */ + + 'cookie' => env( + 'SESSION_COOKIE', + Str::slug(env('APP_NAME', 'laravel'), '_').'_session' + ), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application but you are free to change this when necessary. + | + */ + + 'path' => '/', + + /* + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | Here you may change the domain of the cookie used to identify a session + | in your application. This will determine which domains the cookie is + | available to in your application. A sensible default has been set. + | + */ + + 'domain' => env('SESSION_DOMAIN', null), + + /* + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you if it can not be done securely. + | + */ + + 'secure' => env('SESSION_SECURE_COOKIE'), + + /* + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. You are free to modify this option if needed. + | + */ + + 'http_only' => true, + + /* + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | will set this value to "lax" since this is a secure default value. + | + | Supported: "lax", "strict", "none", null + | + */ + + 'same_site' => 'lax', + +]; diff --git a/config/sluggable.php b/config/sluggable.php new file mode 100644 index 0000000..8d4ac65 --- /dev/null +++ b/config/sluggable.php @@ -0,0 +1,141 @@ +name; + * + * Or it can be an array of fields, like ["name", "company"], which builds a slug from: + * + * $model->name . ' ' . $model->company; + * + * If you've defined custom getters in your model, you can use those too, + * since Eloquent will call them when you request a custom attribute. + * + * Defaults to null, which uses the toString() method on your model. + */ + + 'source' => null, + + /** + * The maximum length of a generated slug. Defaults to "null", which means + * no length restrictions are enforced. Set it to a positive integer if you + * want to make sure your slugs aren't too long. + */ + + 'maxLength' => null, + + /** + * If you are setting a maximum length on your slugs, you may not want the + * truncated string to split a word in half. The default setting of "true" + * will ensure this, e.g. with a maxLength of 12: + * + * "my source string" -> "my-source" + * + * Setting it to "false" will simply truncate the generated slug at the + * desired length, e.g.: + * + * "my source string" -> "my-source-st" + */ + + 'maxLengthKeepWords' => true, + + /** + * If left to "null", then use the cocur/slugify package to generate the slug + * (with the separator defined below). + * + * Set this to a closure that accepts two parameters (string and separator) + * to define a custom slugger. e.g.: + * + * 'method' => function( $string, $sep ) { + * return preg_replace('/[^a-z]+/i', $sep, $string); + * }, + * + * Otherwise, this will be treated as a callable to be used. e.g.: + * + * 'method' => array('Str','slug'), + */ + + 'method' => null, + + /** + * Separator to use when generating slugs. Defaults to a hyphen. + */ + + 'separator' => '-', + + /** + * Enforce uniqueness of slugs? Defaults to true. + * If a generated slug already exists, an incremental numeric + * value will be appended to the end until a unique slug is found. e.g.: + * + * my-slug + * my-slug-1 + * my-slug-2 + */ + + 'unique' => true, + + /** + * If you are enforcing unique slugs, the default is to add an + * incremental value to the end of the base slug. Alternatively, you + * can change this value to a closure that accepts three parameters: + * the base slug, the separator, and a Collection of the other + * "similar" slugs. The closure should return the new unique + * suffix to append to the slug. + */ + + 'uniqueSuffix' => null, + + /** + * Should we include the trashed items when generating a unique slug? + * This only applies if the softDelete property is set for the Eloquent model. + * If set to "false", then a new slug could duplicate one that exists on a trashed model. + * If set to "true", then uniqueness is enforced across trashed and existing models. + */ + + 'includeTrashed' => false, + + /** + * An array of slug names that can never be used for this model, + * e.g. to prevent collisions with existing routes or controller methods, etc.. + * Defaults to null (i.e. no reserved names). + * Can be a static array, e.g.: + * + * 'reserved' => array('add', 'delete'), + * + * or a closure that returns an array of reserved names. + * If using a closure, it will accept one parameter: the model itself, and should + * return an array of reserved names, or null. e.g. + * + * 'reserved' => function( Model $model) { + * return $model->some_method_that_returns_an_array(); + * } + * + * In the case of a slug that gets generated with one of these reserved names, + * we will do: + * + * $slug .= $separator + "1" + * + * and continue from there. + */ + + 'reserved' => null, + + /** + * Whether to update the slug value when a model is being + * re-saved (i.e. already exists). Defaults to false, which + * means slugs are not updated. + * + * Be careful! If you are using slugs to generate URLs, then + * updating your slug automatically might change your URLs which + * is probably not a good idea from an SEO point of view. + * Only set this to true if you understand the possible consequences. + */ + + 'onUpdate' => true, + +]; diff --git a/config/view.php b/config/view.php new file mode 100644 index 0000000..22b8a18 --- /dev/null +++ b/config/view.php @@ -0,0 +1,36 @@ + [ + resource_path('views'), + ], + + /* + |-------------------------------------------------------------------------- + | Compiled View Path + |-------------------------------------------------------------------------- + | + | This option determines where all the compiled Blade templates will be + | stored for your application. Typically, this is within the storage + | directory. However, as usual, you are free to change this value. + | + */ + + 'compiled' => env( + 'VIEW_COMPILED_PATH', + realpath(storage_path('framework/views')) + ), + +]; diff --git a/database/.gitignore b/database/.gitignore new file mode 100644 index 0000000..97fc976 --- /dev/null +++ b/database/.gitignore @@ -0,0 +1,2 @@ +*.sqlite +*.sqlite-journal diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php new file mode 100644 index 0000000..bdea1a3 --- /dev/null +++ b/database/factories/UserFactory.php @@ -0,0 +1,33 @@ + $this->faker->name, + 'email' => $this->faker->unique()->safeEmail, + 'email_verified_at' => now(), + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password + 'remember_token' => Str::random(10), + ]; + } +} diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php new file mode 100644 index 0000000..621a24e --- /dev/null +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -0,0 +1,36 @@ +id(); + $table->string('name'); + $table->string('email')->unique(); + $table->timestamp('email_verified_at')->nullable(); + $table->string('password'); + $table->rememberToken(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('users'); + } +} diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php new file mode 100644 index 0000000..0ee0a36 --- /dev/null +++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -0,0 +1,32 @@ +string('email')->index(); + $table->string('token'); + $table->timestamp('created_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('password_resets'); + } +} diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php new file mode 100644 index 0000000..6aa6d74 --- /dev/null +++ b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php @@ -0,0 +1,36 @@ +id(); + $table->string('uuid')->unique(); + $table->text('connection'); + $table->text('queue'); + $table->longText('payload'); + $table->longText('exception'); + $table->timestamp('failed_at')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('failed_jobs'); + } +} diff --git a/database/migrations/2022_04_11_094659_create_jobs_table.php b/database/migrations/2022_04_11_094659_create_jobs_table.php new file mode 100644 index 0000000..1be9e8a --- /dev/null +++ b/database/migrations/2022_04_11_094659_create_jobs_table.php @@ -0,0 +1,36 @@ +bigIncrements('id'); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedTinyInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('jobs'); + } +} diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php new file mode 100644 index 0000000..d243c50 --- /dev/null +++ b/database/seeders/DatabaseSeeder.php @@ -0,0 +1,29 @@ + /dev/null; do + printf "▇" + sleep 1 +done +echo "]" + +echo "Installing marvel dependncies..." +./vendor/bin/sail artisan marvel:install + +FILE=public/storage +if [ ! -h "$FILE" ]; then + echo "Linking storage path..." + ./vendor/bin/sail artisan storage:link +fi + +echo "Installation Successful!" + +echo "- GraphQL Playground Endpoint: http://localhost/playground" +echo "- Graphql Endpoint: http://localhost/graphql" +echo "- REST Endpoint: http://localhost/" diff --git a/lang/en/auth.php b/lang/en/auth.php new file mode 100644 index 0000000..6598e2c --- /dev/null +++ b/lang/en/auth.php @@ -0,0 +1,20 @@ + 'These credentials do not match our records.', + 'password' => 'The provided password is incorrect.', + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + +]; diff --git a/lang/en/pagination.php b/lang/en/pagination.php new file mode 100644 index 0000000..d481411 --- /dev/null +++ b/lang/en/pagination.php @@ -0,0 +1,19 @@ + '« Previous', + 'next' => 'Next »', + +]; diff --git a/lang/en/passwords.php b/lang/en/passwords.php new file mode 100644 index 0000000..2345a56 --- /dev/null +++ b/lang/en/passwords.php @@ -0,0 +1,22 @@ + 'Your password has been reset!', + 'sent' => 'We have emailed your password reset link!', + 'throttled' => 'Please wait before retrying.', + 'token' => 'This password reset token is invalid.', + 'user' => "We can't find a user with that email address.", + +]; diff --git a/lang/en/validation.php b/lang/en/validation.php new file mode 100644 index 0000000..2e2820b --- /dev/null +++ b/lang/en/validation.php @@ -0,0 +1,152 @@ + 'The :attribute must be accepted.', + 'active_url' => 'The :attribute is not a valid URL.', + 'after' => 'The :attribute must be a date after :date.', + 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', + 'alpha' => 'The :attribute may only contain letters.', + 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.', + 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'array' => 'The :attribute must be an array.', + 'before' => 'The :attribute must be a date before :date.', + 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', + 'between' => [ + 'numeric' => 'The :attribute must be between :min and :max.', + 'file' => 'The :attribute must be between :min and :max kilobytes.', + 'string' => 'The :attribute must be between :min and :max characters.', + 'array' => 'The :attribute must have between :min and :max items.', + ], + 'boolean' => 'The :attribute field must be true or false.', + 'confirmed' => 'The :attribute confirmation does not match.', + 'date' => 'The :attribute is not a valid date.', + 'date_equals' => 'The :attribute must be a date equal to :date.', + 'date_format' => 'The :attribute does not match the format :format.', + 'different' => 'The :attribute and :other must be different.', + 'digits' => 'The :attribute must be :digits digits.', + 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'email' => 'The :attribute must be a valid email address.', + 'ends_with' => 'The :attribute must end with one of the following: :values.', + 'exists' => 'The selected :attribute is invalid.', + 'file' => 'The :attribute must be a file.', + 'filled' => 'The :attribute field must have a value.', + 'gt' => [ + 'numeric' => 'The :attribute must be greater than :value.', + 'file' => 'The :attribute must be greater than :value kilobytes.', + 'string' => 'The :attribute must be greater than :value characters.', + 'array' => 'The :attribute must have more than :value items.', + ], + 'gte' => [ + 'numeric' => 'The :attribute must be greater than or equal :value.', + 'file' => 'The :attribute must be greater than or equal :value kilobytes.', + 'string' => 'The :attribute must be greater than or equal :value characters.', + 'array' => 'The :attribute must have :value items or more.', + ], + 'image' => 'The :attribute must be an image.', + 'in' => 'The selected :attribute is invalid.', + 'in_array' => 'The :attribute field does not exist in :other.', + 'integer' => 'The :attribute must be an integer.', + 'ip' => 'The :attribute must be a valid IP address.', + 'ipv4' => 'The :attribute must be a valid IPv4 address.', + 'ipv6' => 'The :attribute must be a valid IPv6 address.', + 'json' => 'The :attribute must be a valid JSON string.', + 'lt' => [ + 'numeric' => 'The :attribute must be less than :value.', + 'file' => 'The :attribute must be less than :value kilobytes.', + 'string' => 'The :attribute must be less than :value characters.', + 'array' => 'The :attribute must have less than :value items.', + ], + 'lte' => [ + 'numeric' => 'The :attribute must be less than or equal :value.', + 'file' => 'The :attribute must be less than or equal :value kilobytes.', + 'string' => 'The :attribute must be less than or equal :value characters.', + 'array' => 'The :attribute must not have more than :value items.', + ], + 'max' => [ + 'numeric' => 'The :attribute may not be greater than :max.', + 'file' => 'The :attribute may not be greater than :max kilobytes.', + 'string' => 'The :attribute may not be greater than :max characters.', + 'array' => 'The :attribute may not have more than :max items.', + ], + 'mimes' => 'The :attribute must be a file of type: :values.', + 'mimetypes' => 'The :attribute must be a file of type: :values.', + 'min' => [ + 'numeric' => 'The :attribute must be at least :min.', + 'file' => 'The :attribute must be at least :min kilobytes.', + 'string' => 'The :attribute must be at least :min characters.', + 'array' => 'The :attribute must have at least :min items.', + ], + 'multiple_of' => 'The :attribute must be a multiple of :value', + 'not_in' => 'The selected :attribute is invalid.', + 'not_regex' => 'The :attribute format is invalid.', + 'numeric' => 'The :attribute must be a number.', + 'password' => 'The password is incorrect.', + 'present' => 'The :attribute field must be present.', + 'regex' => 'The :attribute format is invalid.', + 'required' => 'The :attribute field is required.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_unless' => 'The :attribute field is required unless :other is in :values.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values are present.', + 'required_without' => 'The :attribute field is required when :values is not present.', + 'required_without_all' => 'The :attribute field is required when none of :values are present.', + 'same' => 'The :attribute and :other must match.', + 'size' => [ + 'numeric' => 'The :attribute must be :size.', + 'file' => 'The :attribute must be :size kilobytes.', + 'string' => 'The :attribute must be :size characters.', + 'array' => 'The :attribute must contain :size items.', + ], + 'starts_with' => 'The :attribute must start with one of the following: :values.', + 'string' => 'The :attribute must be a string.', + 'timezone' => 'The :attribute must be a valid zone.', + 'unique' => 'The :attribute has already been taken.', + 'uploaded' => 'The :attribute failed to upload.', + 'url' => 'The :attribute format is invalid.', + 'uuid' => 'The :attribute must be a valid UUID.', + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ + + 'custom' => [ + 'attribute-name' => [ + 'rule-name' => 'custom-message', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap our attribute placeholder + | with something more reader friendly such as "E-Mail Address" instead + | of "email". This simply helps us make our message more expressive. + | + */ + + 'attributes' => [], + +]; diff --git a/package.json b/package.json new file mode 100644 index 0000000..cbb6cc9 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "private": true, + "version": "6.6.0", + "scripts": { + "dev": "npm run development", + "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js", + "watch": "npm run development -- --watch", + "watch-poll": "npm run watch -- --watch-poll", + "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js", + "prod": "npm run production", + "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js" + }, + "devDependencies": { + "axios": "^0.19", + "cross-env": "^7.0", + "laravel-mix": "^5.0.1", + "lodash": "^4.17.19", + "resolve-url-loader": "^3.1.0", + "vue-template-compiler": "^2.6.14" + } +} diff --git a/packages/marvel/.gitignore b/packages/marvel/.gitignore new file mode 100644 index 0000000..c741e6f --- /dev/null +++ b/packages/marvel/.gitignore @@ -0,0 +1,14 @@ +/node_modules +/public/hot +/public/storage +/storage/*.key +/storage/framework/cache +/vendor +.env +.env.backup +.phpunit.result.cache +docker-compose.override.yml +Homestead.json +Homestead.yaml +npm-debug.log +yarn-error.log diff --git a/packages/marvel/.styleci.yml b/packages/marvel/.styleci.yml new file mode 100644 index 0000000..c3bb259 --- /dev/null +++ b/packages/marvel/.styleci.yml @@ -0,0 +1 @@ +preset: laravel \ No newline at end of file diff --git a/packages/marvel/composer.json b/packages/marvel/composer.json new file mode 100644 index 0000000..fb17c6b --- /dev/null +++ b/packages/marvel/composer.json @@ -0,0 +1,77 @@ +{ + "name": "marvel/shop", + "description": ":package_description", + "license": "license", + "authors": [ + { + "name": "RedQ", + "email": "support@redqteam.com", + "homepage": "https://redq.io" + } + ], + "homepage": "https://github.com/marvel/gateway", + "keywords": [ + "Laravel", + "Shop" + ], + "require": { + "illuminate/support": "~9|~10", + "nuwave/lighthouse": "5.71.0", + "laravel/legacy-factories": "1.3.2", + "cviebrock/eloquent-sluggable": "10.0.0", + "laravel/sanctum": "3.3.1", + "prettus/l5-repository": "2.9.0", + "spatie/laravel-medialibrary": "10.14.0", + "spatie/laravel-permission": "6.0.0", + "php-http/guzzle7-adapter": "1.0.0", + "bensampo/laravel-enum": "6.6.4", + "league/flysystem-aws-s3-v3": "3.16.0", + "drewm/mailchimp-api": "^2.5", + "spatie/laravel-newsletter": "5.1.1", + "spatie/period": "2.4.0", + "kodeine/laravel-meta": "2.2.1", + "maatwebsite/excel": "3.1.48", + "cknow/laravel-money": "7.2.0", + "mollie/laravel-mollie": "2.25.0", + "mll-lab/graphql-php-scalars": "5.4.1", + "razorpay/razorpay": "2.8.7", + "unicodeveloper/laravel-paystack": "1.1.0", + "stripe/stripe-php": "13.1.0", + "dgvai/laravel-sslcommerz": "^1.0", + "iyzico/iyzipay-php": "^2.0", + "luigel/laravel-paymongo": "^2.4", + "mll-lab/laravel-graphiql": "^3.1", + "pusher/pusher-php-server": "^7.2", + "openai-php/client": "^0.7.4", + "twilio/sdk": "7.12.0", + "xendit/xendit-php": "^3.0.0", + "srmklive/paypal": "3.0.19" + }, + "require-dev": { + "phpunit/phpunit": "10.0.13", + "mockery/mockery": "1.5.1", + "orchestra/testbench": "8.0.4", + "sempro/phpunit-pretty-print": "1.4.0" + }, + "autoload": { + "classmap": [ + "src", + "stubs" + ] + }, + "autoload-dev": { + "psr-4": { + "Marvel\\Tests\\": "tests" + } + }, + "extra": { + "laravel": { + "providers": [ + "Marvel\\ShopServiceProvider" + ], + "aliases": { + "Shop": "Marvel\\Facades\\Shop" + } + } + } +} diff --git a/packages/marvel/config/auth.php b/packages/marvel/config/auth.php new file mode 100644 index 0000000..a078aea --- /dev/null +++ b/packages/marvel/config/auth.php @@ -0,0 +1,133 @@ + [ + 'guard' => 'api', + 'passwords' => 'users', + ], + + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session", "token" + | + */ + + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + + 'api' => [ + 'driver' => 'sanctum', + 'provider' => 'users', + ], + 'sanctum' => [ + 'driver' => 'sanctum', + 'provider' => 'users', + ], + ], + + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | + */ + + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => \Marvel\Database\Models\User::class, + ], + + // 'users' => [ + // 'driver' => 'database', + // 'table' => 'users', + // ], + ], + + /* + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | You may specify multiple password reset configurations if you have more + | than one user table or model in the application and you want to have + | separate password reset settings based on the specific user types. + | + | The expire time is the number of minutes that the reset token should be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + */ + + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'table' => 'password_resets', + 'expire' => 60, + 'throttle' => 60, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the amount of seconds before a password confirmation + | times out and the user is prompted to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | + */ + + 'password_timeout' => 10800, + + + /* + |-------------------------------------------------------------------------- + | Active OTP Gateway + |-------------------------------------------------------------------------- + | + | Here active otp gateway value will be taken form the environment variables. + | values can be 'twilio'|'messagebird' + | + */ + + 'active_otp_gateway' => env('ACTIVE_OTP_GATEWAY', 'twilio'), + +]; diff --git a/packages/marvel/config/broadcasting.php b/packages/marvel/config/broadcasting.php new file mode 100644 index 0000000..6dd54c5 --- /dev/null +++ b/packages/marvel/config/broadcasting.php @@ -0,0 +1,64 @@ + env('BROADCAST_DRIVER', 'null'), + + /* + |-------------------------------------------------------------------------- + | Broadcast Connections + |-------------------------------------------------------------------------- + | + | Here you may define all of the broadcast connections that will be used + | to broadcast events to other systems or over websockets. Samples of + | each available type of connection are provided inside this array. + | + */ + + 'connections' => [ + + 'pusher' => [ + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), + 'options' => [ + 'cluster' => env('PUSHER_APP_CLUSTER'), + 'useTLS' => false, + ], + ], + + 'ably' => [ + 'driver' => 'ably', + 'key' => env('ABLY_KEY'), + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + ], + + 'log' => [ + 'driver' => 'log', + ], + + 'null' => [ + 'driver' => 'null', + ], + + ], + +]; diff --git a/packages/marvel/config/cache.php b/packages/marvel/config/cache.php new file mode 100644 index 0000000..3aefb75 --- /dev/null +++ b/packages/marvel/config/cache.php @@ -0,0 +1,105 @@ + env('CACHE_DRIVER', 'file'), + + /* + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | + | Supported drivers: "apc", "array", "database", "file", + | "memcached", "redis", "dynamodb", "null" + | + */ + + 'stores' => [ + + 'apc' => [ + 'driver' => 'apc', + ], + + 'array' => [ + 'driver' => 'array', + 'serialize' => false, + ], + + 'database' => [ + 'driver' => 'database', + 'table' => 'cache', + 'connection' => null, + ], + + 'file' => [ + 'driver' => 'file', + 'path' => storage_path('framework/cache/data'), + ], + + 'memcached' => [ + 'driver' => 'memcached', + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), + 'sasl' => [ + env('MEMCACHED_USERNAME'), + env('MEMCACHED_PASSWORD'), + ], + 'options' => [ + // Memcached::OPT_CONNECT_TIMEOUT => 2000, + ], + 'servers' => [ + [ + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), + 'weight' => 100, + ], + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'cache', + ], + + 'dynamodb' => [ + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing a RAM based store such as APC or Memcached, there might + | be other applications utilizing the same cache. So, we'll specify a + | value to get prefixed to all our keys so we can avoid collisions. + | + */ + + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'), + +]; diff --git a/packages/marvel/config/constants.php b/packages/marvel/config/constants.php new file mode 100644 index 0000000..93499cf --- /dev/null +++ b/packages/marvel/config/constants.php @@ -0,0 +1,71 @@ + ['api/*', '*', 'sanctum/csrf-cookie', 'graphql'], + + 'allowed_methods' => ['*'], + + 'allowed_origins' => ['*'], + + 'allowed_origins_patterns' => [], + + 'allowed_headers' => ['*'], + + 'exposed_headers' => [], + + 'max_age' => 0, + + 'supports_credentials' => false, + +]; diff --git a/packages/marvel/config/flutterwave.php b/packages/marvel/config/flutterwave.php new file mode 100644 index 0000000..f3af081 --- /dev/null +++ b/packages/marvel/config/flutterwave.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + + /** + * Public Key: Your Rave publicKey. Sign up on https://dashboard.flutterwave.com/ to get one from your settings page + * + */ + 'publicKey' => env('FLW_PUBLIC_KEY'), + + /** + * Secret Key: Your Rave secretKey. Sign up on https://dashboard.flutterwave.com/ to get one from your settings page + * + */ + 'secretKey' => env('FLW_SECRET_KEY'), + + /** + * Prefix: Secret hash for webhook + * + */ + 'secretHash' => env('FLW_SECRET_HASH', ''), +]; diff --git a/packages/marvel/config/graphiql.php b/packages/marvel/config/graphiql.php new file mode 100644 index 0000000..ea71096 --- /dev/null +++ b/packages/marvel/config/graphiql.php @@ -0,0 +1,64 @@ + [ + '/playground' => [ + 'name' => 'graphiql', + // 'middleware' => ['web'] + // 'prefix' => '', + // 'domain' => 'graphql.' . env('APP_DOMAIN', 'localhost'), + + /* + |-------------------------------------------------------------------------- + | Default GraphQL endpoint + |-------------------------------------------------------------------------- + | + | The default endpoint that the GraphiQL UI is set to. + | It assumes you are running GraphQL on the same domain + | as GraphiQL, but can be set to any URL. + | + */ + + 'endpoint' => '/graphql', + + /* + |-------------------------------------------------------------------------- + | Subscription endpoint + |-------------------------------------------------------------------------- + | + | The default subscription endpoint the GraphiQL UI uses to connect to. + | Tries to connect to the `endpoint` value if `null` as ws://{{endpoint}} + | + | Example: `ws://your-endpoint` or `wss://your-endpoint` + | + */ + + 'subscription-endpoint' => env('GRAPHIQL_SUBSCRIPTION_ENDPOINT', null), + ], + ], + + /* + |-------------------------------------------------------------------------- + | Control GraphiQL availability + |-------------------------------------------------------------------------- + | + | Control if the GraphiQL UI is accessible at all. + | This allows you to disable it in certain environments, + | for example you might not want it active in production. + | + */ + + 'enabled' => env('GRAPHIQL_ENABLED', true), +]; diff --git a/packages/marvel/config/graphql-playground.php b/packages/marvel/config/graphql-playground.php new file mode 100644 index 0000000..e9533b7 --- /dev/null +++ b/packages/marvel/config/graphql-playground.php @@ -0,0 +1,49 @@ + [ + 'uri' => '/playground', + 'name' => 'playground', + // 'middleware' => ['web'] + // 'prefix' => '', + // 'domain' => 'graphql.' . env('APP_DOMAIN', 'localhost'), + ], + + /* + |-------------------------------------------------------------------------- + | Default GraphQL endpoint + |-------------------------------------------------------------------------- + | + | The default endpoint that the Playground UI is set to. + | It assumes you are running GraphQL on the same domain + | as GraphQL Playground, but can be set to any URL. + | + */ + + 'endpoint' => '/graphql', + + /* + |-------------------------------------------------------------------------- + | Control Playground availability + |-------------------------------------------------------------------------- + | + | Control if the playground is accessible at all. + | This allows you to disable it in certain environments, + | for example you might not want it active in production. + | + */ + + 'enabled' => env('GRAPHQL_PLAYGROUND_ENABLED', true), +]; diff --git a/packages/marvel/config/laravel-omnipay.php b/packages/marvel/config/laravel-omnipay.php new file mode 100644 index 0000000..172b5f8 --- /dev/null +++ b/packages/marvel/config/laravel-omnipay.php @@ -0,0 +1,29 @@ + 'STRIPE', + + // Add in each gateway here + 'gateways' => [ + 'PAYPAL' => [ + 'driver' => 'PayPal_Express', + 'options' => [ + 'solutionType' => '', + 'landingPage' => '', + 'headerImageUrl' => '', + 'testMode' => env('OMNIPAY_TEST_MODE', true) + + ] + ], + 'STRIPE' => [ + 'driver' => 'Stripe', + 'options' => [ + 'apiKey' => env('STRIPE_API_KEY', config('shop.stripe_api_key')), + 'testMode' => env('OMNIPAY_TEST_MODE', true) + ] + ] + ] + +]; diff --git a/packages/marvel/config/lighthouse.php b/packages/marvel/config/lighthouse.php new file mode 100644 index 0000000..f8bdb31 --- /dev/null +++ b/packages/marvel/config/lighthouse.php @@ -0,0 +1,600 @@ + false, to disable the default route + | registration and take full control. + | + */ + + 'route' => [ + /* + * The URI the endpoint responds to, e.g. mydomain.com/graphql. + */ + 'uri' => '/graphql', + + /* + * Lighthouse creates a named route for convenient URL generation and redirects. + */ + 'name' => 'graphql', + + /* + * Beware that middleware defined here runs before the GraphQL execution phase, + * make sure to return spec-compliant responses in case an error is thrown. + */ + 'middleware' => [ + \Nuwave\Lighthouse\Support\Http\Middleware\AcceptJson::class, + + // Logs in a user if they are authenticated. In contrast to Laravel's 'auth' + // middleware, this delegates auth and permission checks to the field level. + \Nuwave\Lighthouse\Support\Http\Middleware\AttemptAuthentication::class, + + // Logs every incoming GraphQL query. + // \Nuwave\Lighthouse\Support\Http\Middleware\LogGraphQLQueries::class, + ], + + /* + * The `prefix` and `domain` configuration options are optional. + */ + //'prefix' => '', + //'domain' => '', + ], + + /* + |-------------------------------------------------------------------------- + | Authentication Guard + |-------------------------------------------------------------------------- + | + | The guard to use for authenticating GraphQL requests, if needed. + | This setting is used whenever Lighthouse looks for an authenticated user, for example in directives + | such as `@guard` and when applying the `AttemptAuthentication` middleware. + | + */ + + 'guard' => 'api', + + /* + |-------------------------------------------------------------------------- + | Schema Location + |-------------------------------------------------------------------------- + | + | Path to your .graphql schema file. + | Additional schema files may be imported from within that file. + | + */ + + 'schema' => [ + 'register' => __DIR__ . '/../src/GraphQL/Schema/schema.graphql', + ], + + /* + |-------------------------------------------------------------------------- + | Schema Cache + |-------------------------------------------------------------------------- + | + | A large part of schema generation consists of parsing and AST manipulation. + | This operation is very expensive, so it is highly recommended to enable + | caching of the final schema to optimize performance of large schemas. + | + */ + + 'cache' => [ + /* + * Setting to true enables schema caching. + */ + 'enable' => env('LIGHTHOUSE_CACHE_ENABLE', 'local' !== env('APP_ENV')), + + /* + * Allowed values: + * - 1: uses the store, key and ttl config values to store the schema as a string in the given cache store. + * - 2: uses the path config value to store the schema in a PHP file allowing OPcache to pick it up. + */ + 'version' => env('LIGHTHOUSE_CACHE_VERSION', 1), + + /* + * The name of the cache item for the schema cache. + */ + 'version' => env('LIGHTHOUSE_CACHE_VERSION', 1), + + /* + * Allows using a specific cache store, uses the app's default if set to null. + * Only relevant if version is set to 1. + */ + 'store' => env('LIGHTHOUSE_CACHE_STORE', null), + + /* + * The name of the cache item for the schema cache. + * Only relevant if version is set to 1. + */ + 'key' => env('LIGHTHOUSE_CACHE_KEY', 'lighthouse-schema'), + + /* + * Duration in seconds the schema should remain cached, null means forever. + * Only relevant if version is set to 1. + */ + 'ttl' => env('LIGHTHOUSE_CACHE_TTL', null), + + /* + * File path to store the lighthouse schema. + * Only relevant if version is set to 2. + */ + 'path' => env('LIGHTHOUSE_CACHE_PATH', base_path('bootstrap/cache/lighthouse-schema.php')), + + /* + * Should the `@cache` directive use a tagged cache? + */ + 'tags' => false, + ], + + + /* + |-------------------------------------------------------------------------- + | Query Cache + |-------------------------------------------------------------------------- + | + | Caches the result of parsing incoming query strings to boost performance on subsequent requests. + | + */ + + 'query_cache' => [ + /* + * Setting to true enables query caching. + */ + 'enable' => env('LIGHTHOUSE_QUERY_CACHE_ENABLE', true), + + /* + * Allows using a specific cache store, uses the app's default if set to null. + */ + 'store' => env('LIGHTHOUSE_QUERY_CACHE_STORE', null), + + /* + * Duration in seconds the query should remain cached, null means forever. + */ + 'ttl' => env( + 'LIGHTHOUSE_QUERY_CACHE_TTL', + \Nuwave\Lighthouse\Support\AppVersion::atLeast(5.8) + ? null + : 365 * 24 * 60 // For Laravel < 5.8 the exact value must be specified and it is counted in minutes + ), + ], + + + /* + |-------------------------------------------------------------------------- + | Namespaces + |-------------------------------------------------------------------------- + | + | These are the default namespaces where Lighthouse looks for classes to + | extend functionality of the schema. You may pass in either a string + | or an array, they are tried in order and the first match is used. + | + */ + + 'namespaces' => [ + 'models' => ['App', 'Marvel\\Database\\Models'], + 'queries' => ['App\\GraphQL\\Queries', 'Marvel\\GraphQL\\Queries'], + 'mutations' => ['App\\GraphQL\\Mutations', 'Marvel\\GraphQL\\Mutation'], + 'subscriptions' => 'App\\GraphQL\\Subscriptions', + 'interfaces' => 'App\\GraphQL\\Interfaces', + 'unions' => 'App\\GraphQL\\Unions', + 'scalars' => 'App\\GraphQL\\Scalars', + 'directives' => ['App\\GraphQL\\Directives', 'Marvel\\GraphQL\\Directives'], + 'validators' => ['App\\GraphQL\\Validators'], + ], + + /* + |-------------------------------------------------------------------------- + | Security + |-------------------------------------------------------------------------- + | + | Control how Lighthouse handles security related query validation. + | Read more at https://webonyx.github.io/graphql-php/security/ + | + */ + + 'security' => [ + 'max_query_complexity' => \GraphQL\Validator\Rules\QueryComplexity::DISABLED, + 'max_query_depth' => \GraphQL\Validator\Rules\QueryDepth::DISABLED, + 'disable_introspection' => \GraphQL\Validator\Rules\DisableIntrospection::DISABLED, + ], + + /* + |-------------------------------------------------------------------------- + | Pagination + |-------------------------------------------------------------------------- + | + | Set defaults for the pagination features within Lighthouse, such as + | the @paginate directive, or paginated relation directives. + | + */ + + 'pagination' => [ + /* + * Allow clients to query paginated lists without specifying the amount of items. + * Setting this to `null` means clients have to explicitly ask for the count. + */ + 'default_count' => null, + + /* + * Limit the maximum amount of items that clients can request from paginated lists. + * Setting this to `null` means the count is unrestricted. + */ + 'max_count' => null, + ], + + /* + |-------------------------------------------------------------------------- + | Debug + |-------------------------------------------------------------------------- + | + | Control the debug level as described in https://webonyx.github.io/graphql-php/error-handling/ + | Debugging is only applied if the global Laravel debug config is set to true. + | + | When you set this value through an environment variable, use the following reference table: + | 0 => INCLUDE_NONE + | 1 => INCLUDE_DEBUG_MESSAGE + | 2 => INCLUDE_TRACE + | 3 => INCLUDE_TRACE | INCLUDE_DEBUG_MESSAGE + | 4 => RETHROW_INTERNAL_EXCEPTIONS + | 5 => RETHROW_INTERNAL_EXCEPTIONS | INCLUDE_DEBUG_MESSAGE + | 6 => RETHROW_INTERNAL_EXCEPTIONS | INCLUDE_TRACE + | 7 => RETHROW_INTERNAL_EXCEPTIONS | INCLUDE_TRACE | INCLUDE_DEBUG_MESSAGE + | 8 => RETHROW_UNSAFE_EXCEPTIONS + | 9 => RETHROW_UNSAFE_EXCEPTIONS | INCLUDE_DEBUG_MESSAGE + | 10 => RETHROW_UNSAFE_EXCEPTIONS | INCLUDE_TRACE + | 11 => RETHROW_UNSAFE_EXCEPTIONS | INCLUDE_TRACE | INCLUDE_DEBUG_MESSAGE + | 12 => RETHROW_UNSAFE_EXCEPTIONS | RETHROW_INTERNAL_EXCEPTIONS + | 13 => RETHROW_UNSAFE_EXCEPTIONS | RETHROW_INTERNAL_EXCEPTIONS | INCLUDE_DEBUG_MESSAGE + | 14 => RETHROW_UNSAFE_EXCEPTIONS | RETHROW_INTERNAL_EXCEPTIONS | INCLUDE_TRACE + | 15 => RETHROW_UNSAFE_EXCEPTIONS | RETHROW_INTERNAL_EXCEPTIONS | INCLUDE_TRACE | INCLUDE_DEBUG_MESSAGE + | + */ + + 'debug' => env('LIGHTHOUSE_DEBUG', \GraphQL\Error\DebugFlag::INCLUDE_DEBUG_MESSAGE | \GraphQL\Error\DebugFlag::INCLUDE_TRACE), + + /* + |-------------------------------------------------------------------------- + | Error Handlers + |-------------------------------------------------------------------------- + | + | Register error handlers that receive the Errors that occur during execution + | and handle them. You may use this to log, filter or format the errors. + | The classes must implement \Nuwave\Lighthouse\Execution\ErrorHandler + | + */ + + 'error_handlers' => [ + \Nuwave\Lighthouse\Execution\AuthenticationErrorHandler::class, + \Nuwave\Lighthouse\Execution\AuthorizationErrorHandler::class, + \Nuwave\Lighthouse\Execution\ValidationErrorHandler::class, + \Nuwave\Lighthouse\Execution\ExtensionErrorHandler::class, + \Nuwave\Lighthouse\Execution\ReportingErrorHandler::class, + ], + + /* + |-------------------------------------------------------------------------- + | Field Middleware + |-------------------------------------------------------------------------- + | + | Register global field middleware directives that wrap around every field. + | Execution happens in the defined order, before other field middleware. + | The classes must implement \Nuwave\Lighthouse\Support\Contracts\FieldMiddleware + | + */ + + 'field_middleware' => [ + \Nuwave\Lighthouse\Schema\Directives\TrimDirective::class, + \Nuwave\Lighthouse\Schema\Directives\SanitizeDirective::class, + \Nuwave\Lighthouse\Validation\ValidateDirective::class, + \Nuwave\Lighthouse\Schema\Directives\TransformArgsDirective::class, + \Nuwave\Lighthouse\Schema\Directives\SpreadDirective::class, + \Nuwave\Lighthouse\Schema\Directives\RenameArgsDirective::class, + ], + + /* + |-------------------------------------------------------------------------- + | Global ID + |-------------------------------------------------------------------------- + | + | The name that is used for the global id field on the Node interface. + | When creating a Relay compliant server, this must be named "id". + | + */ + + 'global_id_field' => 'id', + + /* + |-------------------------------------------------------------------------- + | Batched Queries + |-------------------------------------------------------------------------- + | + | GraphQL query batching means sending multiple queries to the server in one request, + | You may set this flag to either process or deny batched queries. + | + */ + + // 'batched_queries' => true, + + + /* + |-------------------------------------------------------------------------- + | Persisted Queries + |-------------------------------------------------------------------------- + | + | Lighthouse supports Automatic Persisted Queries (APQ), compatible with the + | [Apollo implementation](https://www.apollographql.com/docs/apollo-server/performance/apq). + | You may set this flag to either process or deny these queries. + | + */ + + 'persisted_queries' => true, + + /* + |-------------------------------------------------------------------------- + | Persisted Queries + |-------------------------------------------------------------------------- + | + | Lighthouse supports Automatic Persisted Queries (APQ), compatible with the + | [Apollo implementation](https://www.apollographql.com/docs/apollo-server/performance/apq). + | You may set this flag to either process or deny these queries. + | + */ + + 'persisted_queries' => true, + + /* + |-------------------------------------------------------------------------- + | Transactional Mutations + |-------------------------------------------------------------------------- + | + | If set to true, mutations such as @create or @update will be + | wrapped in a transaction to ensure atomicity. + | + */ + + 'transactional_mutations' => true, + + /* + |-------------------------------------------------------------------------- + | Mass Assignment Protection + |-------------------------------------------------------------------------- + | + | If set to true, mutations will use forceFill() over fill() when populating + | a model with arguments in mutation directives. Since GraphQL constrains + | allowed inputs by design, mass assignment protection is not needed. + | + */ + + 'force_fill' => true, + + /* + |-------------------------------------------------------------------------- + | Batchload Relations + |-------------------------------------------------------------------------- + | + | If set to true, relations marked with directives like @hasMany or @belongsTo + | will be optimized by combining the queries through the BatchLoader. + | + */ + + 'batchload_relations' => true, + + + /* + |-------------------------------------------------------------------------- + | Shortcut Foreign Key Selection + |-------------------------------------------------------------------------- + | + | If set to true, Lighthouse will shortcut queries where the client selects only the + | foreign key pointing to a related model. Only works if the related model's primary + | key field is called exactly `id` for every type in your schema. + | + */ + + 'shortcut_foreign_key_selection' => false, + + + /* + |-------------------------------------------------------------------------- + | Non-Null Pagination Results + |-------------------------------------------------------------------------- + | + | If set to true, the generated result type of paginated lists will be marked + | as non-nullable. This is generally more convenient for clients, but will + | cause validation errors to bubble further up in the result. + | + | This setting will be removed and always behave as if it were true in v6. + | + */ + + 'non_null_pagination_results' => false, + + + + /* + |-------------------------------------------------------------------------- + | Unbox BenSampo\Enum\Enum instances + |-------------------------------------------------------------------------- + | + | If set to true, Lighthouse will extract the internal $value from instances of + | BenSampo\Enum\Enum before passing it to ArgBuilderDirective::handleBuilder(). + | + | This setting will be removed and always behave as if it were false in v6. + | + | It is only here to preserve compatibility, e.g. when expecting the internal + | value to be passed to a scope when using @scope, but not needed due to Laravel + | calling the Enum's __toString() method automagically when used in a query. + | + */ + + 'unbox_bensampo_enum_enum_instances' => true, + + /* + |-------------------------------------------------------------------------- + | Shortcut Foreign Key Selection + |-------------------------------------------------------------------------- + | + | If set to true, Lighthouse will shortcut queries where the client selects only the + | foreign key pointing to a related model. Only works if the related model's primary + | key field is called exactly `id` for every type in your schema. + | + */ + + 'shortcut_foreign_key_selection' => false, + + /* + |-------------------------------------------------------------------------- + | Non-Null Pagination Results + |-------------------------------------------------------------------------- + | + | If set to true, the generated result type of paginated lists will be marked + | as non-nullable. This is generally more convenient for clients, but will + | cause validation errors to bubble further up in the result. + | + | This setting will be removed and always behave as if it were true in v6. + | + */ + + 'non_null_pagination_results' => false, + + /* + |-------------------------------------------------------------------------- + | Unbox BenSampo\Enum\Enum instances + |-------------------------------------------------------------------------- + | + | If set to true, Lighthouse will extract the internal $value from instances of + | BenSampo\Enum\Enum before passing it to ArgBuilderDirective::handleBuilder(). + | + | This setting will be removed and always behave as if it were false in v6. + | + | It is only here to preserve compatibility, e.g. when expecting the internal + | value to be passed to a scope when using @scope, but not needed due to Laravel + | calling the Enum's __toString() method automagically when used in a query. + | + */ + + 'unbox_bensampo_enum_enum_instances' => true, + + /* + |-------------------------------------------------------------------------- + | GraphQL Subscriptions + |-------------------------------------------------------------------------- + | + | Here you can define GraphQL subscription broadcaster and storage drivers + | as well their required configuration options. + | + */ + + 'subscriptions' => [ + /* + * Determines if broadcasts should be queued by default. + */ + 'queue_broadcasts' => env('LIGHTHOUSE_QUEUE_BROADCASTS', true), + + /* + * Determines the queue to use for broadcasting queue jobs. + */ + 'broadcasts_queue_name' => env('LIGHTHOUSE_BROADCASTS_QUEUE_NAME', null), + + /* + * Default subscription storage. + * + * Any Laravel supported cache driver options are available here. + */ + 'storage' => env('LIGHTHOUSE_SUBSCRIPTION_STORAGE', 'redis'), + + /* + * Default subscription storage time to live in seconds. + * + * Indicates how long a subscription can be active before it's automatically removed from storage. + * Setting this to `null` means the subscriptions are stored forever. This may cause + * stale subscriptions to linger indefinitely in case cleanup fails for any reason. + */ + 'storage_ttl' => env('LIGHTHOUSE_SUBSCRIPTION_STORAGE_TTL', null), + + /* + * Default subscription broadcaster. + */ + 'broadcaster' => env('LIGHTHOUSE_BROADCASTER', 'pusher'), + + /* + * Subscription broadcasting drivers with config options. + */ + 'broadcasters' => [ + 'log' => [ + 'driver' => 'log', + ], + 'pusher' => [ + 'driver' => 'pusher', + 'routes' => \Nuwave\Lighthouse\Subscriptions\SubscriptionRouter::class . '@pusher', + 'connection' => 'pusher', + ], + 'echo' => [ + 'driver' => 'echo', + 'connection' => env('LIGHTHOUSE_SUBSCRIPTION_REDIS_CONNECTION', 'default'), + 'routes' => \Nuwave\Lighthouse\Subscriptions\SubscriptionRouter::class . '@echoRoutes', + ], + ], + + /* + * Controls the format of the extensions response. + * Allowed values: 1, 2 + */ + 'version' => env('LIGHTHOUSE_SUBSCRIPTION_VERSION', 1), + + /* + * Should the subscriptions extension be excluded when the response has no subscription channel? + * This optimizes performance by sending less data, but clients must anticipate this appropriately. + * Will default to true in v6 and be removed in v7. + */ + 'exclude_empty' => env('LIGHTHOUSE_SUBSCRIPTION_EXCLUDE_EMPTY', false), + ], + + /* + |-------------------------------------------------------------------------- + | Defer + |-------------------------------------------------------------------------- + | + | Configuration for the experimental @defer directive support. + | + */ + + 'defer' => [ + /* + * Maximum number of nested fields that can be deferred in one query. + * Once reached, remaining fields will be resolved synchronously. + * 0 means unlimited. + */ + 'max_nested_fields' => 0, + + /* + * Maximum execution time for deferred queries in milliseconds. + * Once reached, remaining fields will be resolved synchronously. + * 0 means unlimited. + */ + 'max_execution_ms' => 0, + ], + + /* + |-------------------------------------------------------------------------- + | Apollo Federation + |-------------------------------------------------------------------------- + | + | Lighthouse can act as a federated service: https://www.apollographql.com/docs/federation/federation-spec. + | + */ + + 'federation' => [ + /* + * Location of resolver classes when resolving the `_entities` field. + */ + 'entities_resolver_namespace' => 'App\\GraphQL\\Entities', + ], + +]; diff --git a/packages/marvel/config/media-library.php b/packages/marvel/config/media-library.php new file mode 100644 index 0000000..e45061a --- /dev/null +++ b/packages/marvel/config/media-library.php @@ -0,0 +1,215 @@ + env('MEDIA_DISK', config('shop.media_disk')), + + /* + * The maximum file size of an item in bytes. + * Adding a larger file will result in an exception. + */ + 'max_file_size' => 1024 * 1024 * 10, + + /* + * This queue will be used to generate derived and responsive images. + * Leave empty to use the default queue. + */ + 'queue_name' => '', + + /* + * By default all conversions will be performed on a queue. + */ + 'queue_conversions_by_default' => env('QUEUE_CONVERSIONS_BY_DEFAULT', true), + + /* + * The fully qualified class name of the media model. + */ + 'media_model' => Spatie\MediaLibrary\MediaCollections\Models\Media::class, + + /* + * The fully qualified class name of the model used for temporary uploads. + * + * This model is only used in Media Library Pro (https://medialibrary.pro) + */ + 'temporary_upload_model' => Spatie\MediaLibraryPro\Models\TemporaryUpload::class, + + /* + * When enabled, Media Library Pro will only process temporary uploads there were uploaded + * in the same session. You can opt to disable this for stateless usage of + * the pro components. + */ + 'enable_temporary_uploads_session_affinity' => true, + + /* + * When enabled, Media Library pro will generate thumbnails for uploaded file. + */ + 'generate_thumbnails_for_temporary_uploads' => true, + + /* + * This is the class that is responsible for naming generated files. + */ + 'file_namer' => Spatie\MediaLibrary\Support\FileNamer\DefaultFileNamer::class, + + /* + * The class that contains the strategy for determining a media file's path. + */ + 'path_generator' => Spatie\MediaLibrary\Support\PathGenerator\DefaultPathGenerator::class, + + /* + * When urls to files get generated, this class will be called. Use the default + * if your files are stored locally above the site root or on s3. + */ + 'url_generator' => Spatie\MediaLibrary\Support\UrlGenerator\DefaultUrlGenerator::class, + + /* + * Moves media on updating to keep path consistent. Enable it only with a custom + * PathGenerator that uses, for example, the media UUID. + */ + 'moves_media_on_update' => false, + + /* + * Whether to activate versioning when urls to files get generated. + * When activated, this attaches a ?v=xx query string to the URL. + */ + 'version_urls' => false, + + /* + * The media library will try to optimize all converted images by removing + * metadata and applying a little bit of compression. These are + * the optimizers that will be used by default. + */ + 'image_optimizers' => [ + Spatie\ImageOptimizer\Optimizers\Jpegoptim::class => [ + '-m85', // set maximum quality to 85% + '--strip-all', // this strips out all text information such as comments and EXIF data + '--all-progressive', // this will make sure the resulting image is a progressive one + ], + Spatie\ImageOptimizer\Optimizers\Pngquant::class => [ + '--force', // required parameter for this package + ], + Spatie\ImageOptimizer\Optimizers\Optipng::class => [ + '-i0', // this will result in a non-interlaced, progressive scanned image + '-o2', // this set the optimization level to two (multiple IDAT compression trials) + '-quiet', // required parameter for this package + ], + Spatie\ImageOptimizer\Optimizers\Svgo::class => [ + '--disable=cleanupIDs', // disabling because it is known to cause troubles + ], + Spatie\ImageOptimizer\Optimizers\Gifsicle::class => [ + '-b', // required parameter for this package + '-O3', // this produces the slowest but best results + ], + Spatie\ImageOptimizer\Optimizers\Cwebp::class => [ + '-m 6', // for the slowest compression method in order to get the best compression. + '-pass 10', // for maximizing the amount of analysis pass. + '-mt', // multithreading for some speed improvements. + '-q 90', //quality factor that brings the least noticeable changes. + ], + ], + + /* + * These generators will be used to create an image of media files. + */ + 'image_generators' => [ + Spatie\MediaLibrary\Conversions\ImageGenerators\Image::class, + Spatie\MediaLibrary\Conversions\ImageGenerators\Webp::class, + Spatie\MediaLibrary\Conversions\ImageGenerators\Pdf::class, + Spatie\MediaLibrary\Conversions\ImageGenerators\Svg::class, + Spatie\MediaLibrary\Conversions\ImageGenerators\Video::class, + ], + + /* + * The path where to store temporary files while performing image conversions. + * If set to null, storage_path('media-library/temp') will be used. + */ + 'temporary_directory_path' => null, + + /* + * The engine that should perform the image conversions. + * Should be either `gd` or `imagick`. + */ + 'image_driver' => env('IMAGE_DRIVER', 'gd'), + + /* + * FFMPEG & FFProbe binaries paths, only used if you try to generate video + * thumbnails and have installed the php-ffmpeg/php-ffmpeg composer + * dependency. + */ + 'ffmpeg_path' => env('FFMPEG_PATH', '/usr/bin/ffmpeg'), + 'ffprobe_path' => env('FFPROBE_PATH', '/usr/bin/ffprobe'), + + /* + * Here you can override the class names of the jobs used by this package. Make sure + * your custom jobs extend the ones provided by the package. + */ + 'jobs' => [ + 'perform_conversions' => Spatie\MediaLibrary\Conversions\Jobs\PerformConversionsJob::class, + 'generate_responsive_images' => Spatie\MediaLibrary\ResponsiveImages\Jobs\GenerateResponsiveImagesJob::class, + ], + + /* + * When using the addMediaFromUrl method you may want to replace the default downloader. + * This is particularly useful when the url of the image is behind a firewall and + * need to add additional flags, possibly using curl. + */ + 'media_downloader' => Spatie\MediaLibrary\Downloaders\DefaultDownloader::class, + + 'remote' => [ + /* + * Any extra headers that should be included when uploading media to + * a remote disk. Even though supported headers may vary between + * different drivers, a sensible default has been provided. + * + * Supported by S3: CacheControl, Expires, StorageClass, + * ServerSideEncryption, Metadata, ACL, ContentEncoding + */ + 'extra_headers' => [ + 'CacheControl' => 'max-age=604800', + ], + ], + + 'responsive_images' => [ + /* + * This class is responsible for calculating the target widths of the responsive + * images. By default we optimize for filesize and create variations that each are 20% + * smaller than the previous one. More info in the documentation. + * + * https://docs.spatie.be/laravel-medialibrary/v9/advanced-usage/generating-responsive-images + */ + 'width_calculator' => Spatie\MediaLibrary\ResponsiveImages\WidthCalculator\FileSizeOptimizedWidthCalculator::class, + + /* + * By default rendering media to a responsive image will add some javascript and a tiny placeholder. + * This ensures that the browser can already determine the correct layout. + */ + 'use_tiny_placeholders' => true, + + /* + * This class will generate the tiny placeholder used for progressive image loading. By default + * the media library will use a tiny blurred jpg image. + */ + 'tiny_placeholder_generator' => Spatie\MediaLibrary\ResponsiveImages\TinyPlaceholderGenerator\Blurred::class, + ], + + /* + * When enabling this option, a route will be registered that will enable + * the Media Library Pro Vue and React components to move uploaded files + * in a S3 bucket to their right place. + */ + 'enable_vapor_uploads' => env('ENABLE_MEDIA_LIBRARY_VAPOR_UPLOADS', false), + + /* + * When converting Media instances to response the media library will add + * a `loading` attribute to the `img` tag. Here you can set the default + * value of that attribute. + * + * Possible values: 'lazy', 'eager', 'auto' or null if you don't want to set any loading instruction. + * + * More info: https://css-tricks.com/native-lazy-loading/ + */ + 'default_loading_attribute_value' => null, +]; diff --git a/packages/marvel/config/newsletter.php b/packages/marvel/config/newsletter.php new file mode 100644 index 0000000..d9c5b2c --- /dev/null +++ b/packages/marvel/config/newsletter.php @@ -0,0 +1,47 @@ + env('NEWSLETTER_DRIVER', Spatie\Newsletter\Drivers\MailChimpDriver::class), + + /** + * These arguments will be given to the driver. + */ + 'driver_arguments' => [ + 'api_key' => env('NEWSLETTER_API_KEY'), + + 'endpoint' => env('NEWSLETTER_ENDPOINT'), + ], + + /* + * The list name to use when no list name is specified in a method. + */ + 'default_list_name' => 'subscribers', + + 'lists' => [ + + /* + * This key is used to identify this list. It can be used + * as the listName parameter provided in the various methods. + * + * You can set it to any string you want and you can add + * as many lists as you want. + */ + 'subscribers' => [ + + /* + * When using the Mailcoach driver, this should be Email list UUID + * which is displayed in the Mailcoach UI + * + * When using the MailChimp driver, this should be a MailChimp list id. + * http://kb.mailchimp.com/lists/managing-subscribers/find-your-list-id. + */ + 'id' => env('NEWSLETTER_LIST_ID'), + ], + ], +]; diff --git a/packages/marvel/config/paystack.php b/packages/marvel/config/paystack.php new file mode 100644 index 0000000..e6d0d29 --- /dev/null +++ b/packages/marvel/config/paystack.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + + /** + * Public Key From Paystack Dashboard + * + */ + 'publicKey' => getenv('PAYSTACK_PUBLIC_KEY'), + + /** + * Secret Key From Paystack Dashboard + * + */ + 'secretKey' => getenv('PAYSTACK_SECRET_KEY'), + + /** + * Paystack Payment URL + * + */ + 'paymentUrl' => getenv('PAYSTACK_PAYMENT_URL'), + + /** + * Optional email address of the merchant + * + */ + 'merchantEmail' => getenv('MERCHANT_EMAIL'), + +]; diff --git a/packages/marvel/config/permission.php b/packages/marvel/config/permission.php new file mode 100644 index 0000000..84888ca --- /dev/null +++ b/packages/marvel/config/permission.php @@ -0,0 +1,187 @@ + [ + + /* + * When using the "HasPermissions" trait from this package, we need to know which + * Eloquent model should be used to retrieve your permissions. Of course, it + * is often just the "Permission" model but you may use whatever you like. + * + * The model you want to use as a Permission model needs to implement the + * `Spatie\Permission\Contracts\Permission` contract. + */ + + 'permission' => Spatie\Permission\Models\Permission::class, + + /* + * When using the "HasRoles" trait from this package, we need to know which + * Eloquent model should be used to retrieve your roles. Of course, it + * is often just the "Role" model but you may use whatever you like. + * + * The model you want to use as a Role model needs to implement the + * `Spatie\Permission\Contracts\Role` contract. + */ + + 'role' => Spatie\Permission\Models\Role::class, + + ], + + 'table_names' => [ + + /* + * When using the "HasRoles" trait from this package, we need to know which + * table should be used to retrieve your roles. We have chosen a basic + * default value but you may easily change it to any table you like. + */ + + 'roles' => 'roles', + + /* + * When using the "HasPermissions" trait from this package, we need to know which + * table should be used to retrieve your permissions. We have chosen a basic + * default value but you may easily change it to any table you like. + */ + + 'permissions' => 'permissions', + + /* + * When using the "HasPermissions" trait from this package, we need to know which + * table should be used to retrieve your models permissions. We have chosen a + * basic default value but you may easily change it to any table you like. + */ + + 'model_has_permissions' => 'model_has_permissions', + + /* + * When using the "HasRoles" trait from this package, we need to know which + * table should be used to retrieve your models roles. We have chosen a + * basic default value but you may easily change it to any table you like. + */ + + 'model_has_roles' => 'model_has_roles', + + /* + * When using the "HasRoles" trait from this package, we need to know which + * table should be used to retrieve your roles permissions. We have chosen a + * basic default value but you may easily change it to any table you like. + */ + + 'role_has_permissions' => 'role_has_permissions', + ], + + 'column_names' => [ + /* + * Change this if you want to name the related pivots other than defaults + */ + 'role_pivot_key' => null, //default 'role_id', + 'permission_pivot_key' => null, //default 'permission_id', + + /* + * Change this if you want to name the related model primary key other than + * `model_id`. + * + * For example, this would be nice if your primary keys are all UUIDs. In + * that case, name this `model_uuid`. + */ + + 'model_morph_key' => 'model_id', + + /* + * Change this if you want to use the teams feature and your related model's + * foreign key is other than `team_id`. + */ + + 'team_foreign_key' => 'team_id', + ], + + /* + * When set to true, the method for checking permissions will be registered on the gate. + * Set this to false if you want to implement custom logic for checking permissions. + */ + + 'register_permission_check_method' => true, + + /* + * When set to true, the Spatie\Permission\Listeners\OctaneReloadPermissions listener will be registered + * on the Laravel\Octane\Events\OperationTerminated event, this will refresh permissions on every + * TickTerminated, TaskTerminated and RequestTerminated + * NOTE: This should not be needed in most cases, but an Octane/Vapor combination benefited from it. + */ + 'register_octane_reset_listener' => false, + + /* + * Teams Feature. + * When set to true the package implements teams using the 'team_foreign_key'. + * If you want the migrations to register the 'team_foreign_key', you must + * set this to true before doing the migration. + * If you already did the migration then you must make a new migration to also + * add 'team_foreign_key' to 'roles', 'model_has_roles', and 'model_has_permissions' + * (view the latest version of this package's migration file) + */ + + 'teams' => false, + + /* + * Passport Client Credentials Grant + * When set to true the package will use Passports Client to check permissions + */ + + 'use_passport_client_credentials' => false, + + /* + * When set to true, the required permission names are added to exception messages. + * This could be considered an information leak in some contexts, so the default + * setting is false here for optimum safety. + */ + + 'display_permission_in_exception' => false, + + /* + * When set to true, the required role names are added to exception messages. + * This could be considered an information leak in some contexts, so the default + * setting is false here for optimum safety. + */ + + 'display_role_in_exception' => false, + + /* + * By default wildcard permission lookups are disabled. + * See documentation to understand supported syntax. + */ + + 'enable_wildcard_permission' => false, + + /* + * The class to use for interpreting wildcard permissions. + * If you need to modify delimiters, override the class and specify its name here. + */ + // 'permission.wildcard_permission' => Spatie\Permission\WildcardPermission::class, + + /* Cache-specific settings */ + + 'cache' => [ + + /* + * By default all permissions are cached for 24 hours to speed up performance. + * When permissions or roles are updated the cache is flushed automatically. + */ + + 'expiration_time' => \DateInterval::createFromDateString('24 hours'), + + /* + * The cache key used to store all permissions. + */ + + 'key' => 'spatie.permission.cache', + + /* + * You may optionally indicate a specific cache driver to use for permission and + * role caching using any of the `store` drivers listed in the cache.php config + * file. Using 'default' here means to use the `default` set in cache.php. + */ + + 'store' => 'default', + ], +]; \ No newline at end of file diff --git a/packages/marvel/config/repository.php b/packages/marvel/config/repository.php new file mode 100644 index 0000000..41413b7 --- /dev/null +++ b/packages/marvel/config/repository.php @@ -0,0 +1,249 @@ + [ + 'limit' => 15 + ], + + /* + |-------------------------------------------------------------------------- + | Fractal Presenter Config + |-------------------------------------------------------------------------- + | + + Available serializers: + ArraySerializer + DataArraySerializer + JsonApiSerializer + + */ + 'fractal' => [ + 'params' => [ + 'include' => 'include' + ], + 'serializer' => League\Fractal\Serializer\DataArraySerializer::class + ], + + /* + |-------------------------------------------------------------------------- + | Cache Config + |-------------------------------------------------------------------------- + | + */ + 'cache' => [ + /* + |-------------------------------------------------------------------------- + | Cache Status + |-------------------------------------------------------------------------- + | + | Enable or disable cache + | + */ + 'enabled' => false, + + /* + |-------------------------------------------------------------------------- + | Cache Minutes + |-------------------------------------------------------------------------- + | + | Time of expiration cache + | + */ + 'minutes' => 30, + + /* + |-------------------------------------------------------------------------- + | Cache Repository + |-------------------------------------------------------------------------- + | + | Instance of Illuminate\Contracts\Cache\Repository + | + */ + 'repository' => 'cache', + + /* + |-------------------------------------------------------------------------- + | Cache Clean Listener + |-------------------------------------------------------------------------- + | + | + | + */ + 'clean' => [ + + /* + |-------------------------------------------------------------------------- + | Enable clear cache on repository changes + |-------------------------------------------------------------------------- + | + */ + 'enabled' => true, + + /* + |-------------------------------------------------------------------------- + | Actions in Repository + |-------------------------------------------------------------------------- + | + | create : Clear Cache on create Entry in repository + | update : Clear Cache on update Entry in repository + | delete : Clear Cache on delete Entry in repository + | + */ + 'on' => [ + 'create' => true, + 'update' => true, + 'delete' => true, + ] + ], + + 'params' => [ + /* + |-------------------------------------------------------------------------- + | Skip Cache Params + |-------------------------------------------------------------------------- + | + | + | Ex: http://prettus.local/?search=lorem&skipCache=true + | + */ + 'skipCache' => 'skipCache' + ], + + /* + |-------------------------------------------------------------------------- + | Methods Allowed + |-------------------------------------------------------------------------- + | + | methods cacheable : all, paginate, find, findByField, findWhere, getByCriteria + | + | Ex: + | + | 'only' =>['all','paginate'], + | + | or + | + | 'except' =>['find'], + */ + 'allowed' => [ + 'only' => null, + 'except' => null + ] + ], + + /* + |-------------------------------------------------------------------------- + | Criteria Config + |-------------------------------------------------------------------------- + | + | Settings of request parameters names that will be used by Criteria + | + */ + 'criteria' => [ + /* + |-------------------------------------------------------------------------- + | Accepted Conditions + |-------------------------------------------------------------------------- + | + | Conditions accepted in consultations where the Criteria + | + | Ex: + | + | 'acceptedConditions'=>['=','like'] + | + | $query->where('foo','=','bar') + | $query->where('foo','like','bar') + | + */ + 'acceptedConditions' => [ + '=', + 'like', + 'in', + '>=', + '<=', + 'between' + ], + /* + |-------------------------------------------------------------------------- + | Request Params + |-------------------------------------------------------------------------- + | + | Request parameters that will be used to filter the query in the repository + | + | Params : + | + | - search : Searched value + | Ex: http://prettus.local/?search=lorem + | + | - searchFields : Fields in which research should be carried out + | Ex: + | http://prettus.local/?search=lorem&searchFields=name;email + | http://prettus.local/?search=lorem&searchFields=name:like;email + | http://prettus.local/?search=lorem&searchFields=name:like + | + | - filter : Fields that must be returned to the response object + | Ex: + | http://prettus.local/?search=lorem&filter=id,name + | + | - orderBy : Order By + | Ex: + | http://prettus.local/?search=lorem&orderBy=id + | + | - sortedBy : Sort + | Ex: + | http://prettus.local/?search=lorem&orderBy=id&sortedBy=asc + | http://prettus.local/?search=lorem&orderBy=id&sortedBy=desc + | + | - searchJoin: Specifies the search method (AND / OR), by default the + | application searches each parameter with OR + | EX: + | http://prettus.local/?search=lorem&searchJoin=and + | http://prettus.local/?search=lorem&searchJoin=or + | + */ + 'params' => [ + 'search' => 'search', + 'searchFields' => 'searchFields', + 'filter' => 'filter', + 'orderBy' => 'orderBy', + 'sortedBy' => 'sortedBy', + 'with' => 'with', + 'searchJoin' => 'searchJoin', + 'withCount' => 'withCount' + ] + ], + /* + |-------------------------------------------------------------------------- + | Generator Config + |-------------------------------------------------------------------------- + | + */ + 'generator' => [ + 'basePath' => app()->path(), + 'rootNamespace' => 'App\\', + 'stubsOverridePath' => app()->path(), + 'paths' => [ + 'models' => 'Entities', + 'repositories' => 'Repositories', + 'interfaces' => 'Repositories', + 'transformers' => 'Transformers', + 'presenters' => 'Presenters', + 'validators' => 'Validators', + 'controllers' => 'Http/Controllers', + 'provider' => 'RepositoryServiceProvider', + 'criteria' => 'Criteria' + ] + ] +]; diff --git a/packages/marvel/config/sanctum.php b/packages/marvel/config/sanctum.php new file mode 100644 index 0000000..46c01d3 --- /dev/null +++ b/packages/marvel/config/sanctum.php @@ -0,0 +1,48 @@ + explode(',', env('SANCTUM_STATEFUL_DOMAINS', 'localhost,127.0.0.1,127.0.0.1:8000,::1')), + + /* + |-------------------------------------------------------------------------- + | Expiration Minutes + |-------------------------------------------------------------------------- + | + | This value controls the number of minutes until an issued token will be + | considered expired. If this value is null, personal access tokens do + | not expire. This won't tweak the lifetime of first-party sessions. + | + */ + + + 'expiration' => null, + + /* + |-------------------------------------------------------------------------- + | Sanctum Middleware + |-------------------------------------------------------------------------- + | + | When authenticating your first-party SPA with Sanctum you may need to + | customize some of the middleware Sanctum uses while processing the + | request. You may change the middleware listed below as required. + | + */ + + 'middleware' => [ + 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, + 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, + ], + +]; diff --git a/packages/marvel/config/scout.php b/packages/marvel/config/scout.php new file mode 100644 index 0000000..2e9abe5 --- /dev/null +++ b/packages/marvel/config/scout.php @@ -0,0 +1,91 @@ + env('SCOUT_DRIVER', 'algolia'), + + /* + |-------------------------------------------------------------------------- + | Index Prefix + |-------------------------------------------------------------------------- + | + | Here you may specify a prefix that will be applied to all search index + | names used by Scout. This prefix may be useful if you have multiple + | "tenants" or applications sharing the same search infrastructure. + | + */ + + 'prefix' => env('SCOUT_PREFIX', ''), + + /* + |-------------------------------------------------------------------------- + | Queue Data Syncing + |-------------------------------------------------------------------------- + | + | This option allows you to control if the operations that sync your data + | with your search engines are queued. When this is set to "true" then + | all automatic data syncing will get queued for better performance. + | + */ + + 'queue' => env('SCOUT_QUEUE', true), + + /* + |-------------------------------------------------------------------------- + | Chunk Sizes + |-------------------------------------------------------------------------- + | + | These options allow you to control the maximum chunk size when you are + | mass importing data into the search engine. This allows you to fine + | tune each of these chunk sizes based on the power of the servers. + | + */ + + 'chunk' => [ + 'searchable' => 500, + 'unsearchable' => 500, + ], + + /* + |-------------------------------------------------------------------------- + | Soft Deletes + |-------------------------------------------------------------------------- + | + | This option allows to control whether to keep soft deleted records in + | the search indexes. Maintaining soft deleted records can be useful + | if your application still needs to search for the records later. + | + */ + + 'soft_delete' => false, + + /* + |-------------------------------------------------------------------------- + | Algolia Configuration + |-------------------------------------------------------------------------- + | + | Here you may configure your Algolia settings. Algolia is a cloud hosted + | search engine which works great with Scout out of the box. Just plug + | in your application ID and admin API key to get started searching. + | + */ + + 'algolia' => [ + 'id' => env('ALGOLIA_APP_ID', ''), + 'secret' => env('ALGOLIA_SECRET', ''), + ], + +]; diff --git a/packages/marvel/config/services.php b/packages/marvel/config/services.php new file mode 100644 index 0000000..07e5932 --- /dev/null +++ b/packages/marvel/config/services.php @@ -0,0 +1,57 @@ + [ + 'domain' => env('MAILGUN_DOMAIN'), + 'secret' => env('MAILGUN_SECRET'), + 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), + ], + + 'postmark' => [ + 'token' => env('POSTMARK_TOKEN'), + ], + + 'ses' => [ + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + ], + + 'google' => [ + 'client_id' => env('GOOGLE_CLIENT_ID'), + 'client_secret' => env('GOOGLE_CLIENT_SECRET'), + 'redirect' => env('GOOGLE_REDIRECT_URI') + ], + + 'facebook' => [ + 'client_id' => env('FACEBOOK_CLIENT_ID'), + 'client_secret' => env('FACEBOOK_CLIENT_SECRET'), + 'redirect' => env('FACEBOOK_REDIRECT_URI') + ], + + 'twilio' => [ + 'account_sid' => env('TWILIO_ACCOUNT_SID'), + 'auth_token' => env('TWILIO_AUTH_TOKEN'), + 'verification_sid' => env('TWILIO_VERIFICATION_SID'), + 'from' => env('TWILIO_FROM_NUMBER'), + ], + + 'messagebird' => [ + 'api_key' => env('MESSAGEBIRD_API_KEY'), + 'originator' => env('MESSAGEBIRD_ORIGINATOR') + ] + +]; diff --git a/packages/marvel/config/shop.php b/packages/marvel/config/shop.php new file mode 100644 index 0000000..8c27802 --- /dev/null +++ b/packages/marvel/config/shop.php @@ -0,0 +1,114 @@ + env('ADMIN_EMAIL'), + + /* + |-------------------------------------------------------------------------- + | Shop url configuration + |-------------------------------------------------------------------------- + | + | Shop url is used in order placed template to go to shop order page. + | + */ + 'shop_url' => env('SHOP_URL'), + + 'dashboard_url' => env('DASHBOARD_URL'), + + 'media_disk' => env('MEDIA_DISK'), + + 'version' => env('APP_VERSION', 12), + + 'stripe_api_key' => env('STRIPE_API_KEY'), + + 'app_notice_domain' => env('APP_NOTICE_DOMAIN', 'MARVEL_'), + + 'dummy_data_path' => env('DUMMY_DATA_PATH', 'pickbazar'), + + 'default_language' => env('DEFAULT_LANGUAGE', 'en'), + + 'translation_enabled' => env('TRANSLATION_ENABLED', true), + + 'default_currency' => env('DEFAULT_CURRENCY', 'USD'), + + 'active_payment_gateway' => env('ACTIVE_PAYMENT_GATEWAY', 'stripe'), + + 'razorpay' => [ + 'key_id' => env('RAZORPAY_KEY_ID'), + 'key_secret' => env('RAZORPAY_KEY_SECRET'), + 'webhook_secret' => env('RAZORPAY_WEBHOOK_SECRET_KEY') + ], + + 'mollie' => [ + 'mollie_key' => env('MOLLIE_KEY'), + 'webhook_url' => env('MOLLIE_WEBHOOK_URL', url('webhooks/mollie')), + ], + + 'stripe' => [ + 'api_secret' => env('STRIPE_API_KEY'), + 'webhook_secret' => env('STRIPE_WEBHOOK_SECRET_KEY') + ], + + 'paystack' => [ + 'public_key' => env('PAYSTACK_PUBLIC_KEY'), + 'secret_key' => env('PAYSTACK_SECRET_KEY'), + ], + + + 'paypal' => [ + 'mode' => env('PAYPAL_MODE', 'sandbox'), // Can only be 'sandbox' Or 'live'. If empty or invalid, 'live' will be used. + 'sandbox' => [ + 'client_id' => env('PAYPAL_SANDBOX_CLIENT_ID', ''), + 'client_secret' => env('PAYPAL_SANDBOX_CLIENT_SECRET', ''), + ], + 'live' => [ + 'client_id' => env('PAYPAL_LIVE_CLIENT_ID', ''), + 'client_secret' => env('PAYPAL_LIVE_CLIENT_SECRET', ''), + ], + 'payment_action' => env('PAYPAL_PAYMENT_ACTION', 'Sale'), // Can only be 'Sale', 'Authorization' or 'Order' + 'webhook_id' => env('PAYPAL_WEBHOOK_ID'), + 'currency' => env('PAYPAL_CURRENCY', 'USD'), + 'notify_url' => env('PAYPAL_NOTIFY_URL', ''), // Change this accordingly for your application. + 'locale' => env('PAYPAL_LOCALE', 'en_US'), // force gateway language i.e. it_IT, es_ES, en_US ... (for express checkout only) + 'validate_ssl' => env('PAYPAL_VALIDATE_SSL', true), // Validate SSL when creating api client. + ], + + 'sslcommerz' => [ + 'store_id' => env('SSLC_STORE_ID'), + 'store_password' => env('SSLC_STORE_PASSWORD'), + ], + 'iyzico' => [ + 'api_Key' => env('IYZIPAY_API_KEY', ''), + 'secret_Key' => env('IYZIPAY_SECRET_KEY', ''), + 'baseUrl' => env('IYZIPAY_BASE_URL', 'https://sandbox-api.iyzipay.com'), + ], + 'bkash' => [ + 'app_Key' => env('BKASH_APP_KEY', ''), + 'app_secret' => env('BKASH_APP_SECRET', ''), + 'username' => env('BKASH_USERNAME', ''), + 'password' => env('BKASH_PASSWORD', ''), + 'callback_url' => env('BKASH_CALLBACK_URL', 'http://127.0.0.1:8000/bkash/callback'), + ], + 'flutterwave' => [ + 'public_key' => env('FLW_PUBLIC_KEY'), + 'secret_key' => env('FLW_SECRET_KEY'), + 'secret_hash' => env('FLW_SECRET_HASH'), + ], + + 'openai' => [ + 'secret_Key' => env('OPENAI_SECRET_KEY'), + ], + + 'pusher' => [ + 'enabled' => env('PUSHER_ENABLED', false), + ] +]; diff --git a/packages/marvel/config/sluggable.php b/packages/marvel/config/sluggable.php new file mode 100644 index 0000000..4bc7240 --- /dev/null +++ b/packages/marvel/config/sluggable.php @@ -0,0 +1,147 @@ +name; + * + * Or it can be an array of fields, like ["name", "company"], which builds a slug from: + * + * $model->name . ' ' . $model->company; + * + * If you've defined custom getters in your model, you can use those too, + * since Eloquent will call them when you request a custom attribute. + * + * Defaults to null, which uses the toString() method on your model. + */ + + 'source' => null, + + /** + * The maximum length of a generated slug. Defaults to "null", which means + * no length restrictions are enforced. Set it to a positive integer if you + * want to make sure your slugs aren't too long. + */ + + 'maxLength' => null, + + /** + * If you are setting a maximum length on your slugs, you may not want the + * truncated string to split a word in half. The default setting of "true" + * will ensure this, e.g. with a maxLength of 12: + * + * "my source string" -> "my-source" + * + * Setting it to "false" will simply truncate the generated slug at the + * desired length, e.g.: + * + * "my source string" -> "my-source-st" + */ + + 'maxLengthKeepWords' => true, + + /** + * If left to "null", then use the cocur/slugify package to generate the slug + * (with the separator defined below). + * + * Set this to a closure that accepts two parameters (string and separator) + * to define a custom slugger. e.g.: + * + * 'method' => function( $string, $sep ) { + * return preg_replace('/[^a-z]+/i', $sep, $string); + * }, + * + * Otherwise, this will be treated as a callable to be used. e.g.: + * + * 'method' => array('Str','slug'), + */ + + 'method' => null, + + /** + * Separator to use when generating slugs. Defaults to a hyphen. + */ + + 'separator' => '-', + + /** + * Enforce uniqueness of slugs? Defaults to true. + * If a generated slug already exists, an incremental numeric + * value will be appended to the end until a unique slug is found. e.g.: + * + * my-slug + * my-slug-1 + * my-slug-2 + */ + + 'unique' => true, + + /** + * If you are enforcing unique slugs, the default is to add an + * incremental value to the end of the base slug. Alternatively, you + * can change this value to a closure that accepts three parameters: + * the base slug, the separator, and a Collection of the other + * "similar" slugs. The closure should return the new unique + * suffix to append to the slug. + */ + + 'uniqueSuffix' => null, + + /** + * Should we include the trashed items when generating a unique slug? + * This only applies if the softDelete property is set for the Eloquent model. + * If set to "false", then a new slug could duplicate one that exists on a trashed model. + * If set to "true", then uniqueness is enforced across trashed and existing models. + */ + + 'includeTrashed' => false, + + /** + * An array of slug names that can never be used for this model, + * e.g. to prevent collisions with existing routes or controller methods, etc.. + * Defaults to null (i.e. no reserved names). + * Can be a static array, e.g.: + * + * 'reserved' => array('add', 'delete'), + * + * or a closure that returns an array of reserved names. + * If using a closure, it will accept one parameter: the model itself, and should + * return an array of reserved names, or null. e.g. + * + * 'reserved' => function( Model $model) { + * return $model->some_method_that_returns_an_array(); + * } + * + * In the case of a slug that gets generated with one of these reserved names, + * we will do: + * + * $slug .= $separator + "1" + * + * and continue from there. + */ + + 'reserved' => null, + + /** + * Whether to update the slug value when a model is being + * re-saved (i.e. already exists). Defaults to false, which + * means slugs are not updated. + * + * Be careful! If you are using slugs to generate URLs, then + * updating your slug automatically might change your URLs which + * is probably not a good idea from an SEO point of view. + * Only set this to true if you understand the possible consequences. + */ + + 'onUpdate' => false, + + /** + * If the default slug engine of cocur/slugify is used, this array of + * configuration options will be used when instantiating the engine. + */ + 'slugEngineOptions' => [], + +]; diff --git a/packages/marvel/config/sslcommerz.php b/packages/marvel/config/sslcommerz.php new file mode 100644 index 0000000..c2977a8 --- /dev/null +++ b/packages/marvel/config/sslcommerz.php @@ -0,0 +1,133 @@ + env('APP_DEBUG', true), + + /** + * CREDENTIALS + * -------------------------------- + * The API credentials given from SSLCommerz + * + */ + + 'store' => [ + 'id' => env('SSLC_STORE_ID'), + 'password' => env('SSLC_STORE_PASSWORD'), + 'currency' => env('DEFAULT_CURRENCY','USD'), + ], + + /** + * REDIRECT URL's + * -------------------------------- + * The URL Redirection after success/failure/cancel + * USE route name() + * DO NOT USE route url() + */ + + 'route' => [ + 'success' => env('SSLC_ROUTE_SUCCESS','sslc.sslcommerz'), + 'failure' => env('SSLC_ROUTE_FAILURE','sslc.sslcommerz'), + 'cancel' => env('SSLC_ROUTE_CANCEL','sslc.sslcommerz'), + 'ipn' => env('SSLC_ROUTE_IPN','sslc.sslcommerz'), + ], + + /** + * STRICT PAYMENT GATEWAY + * -------------------------------- + * Strict your payment gateway. Leave is NULL if + * you want to enable all available gateways + * + * List of gateways + * brac_visa= BRAC VISA + * dbbl_visa= Dutch Bangla VISA + * city_visa= City Bank Visa + * ebl_visa = EBL Visa + * sbl_visa = Southeast Bank Visa + * brac_master = BRAC MASTER + * dbbl_master = MASTER Dutch-Bangla + * city_master = City Master Card + * ebl_maste= EBL Master Card + * sbl_maste= Southeast Bank Master Card + * city_amex= City Bank AMEX + * qcash= QCash + * dbbl_nexu= DBBL Nexus + * bankasia = Bank Asia IB + * abban= AB Bank IB + * ibbl = IBBL IB and Mobile Banking + * mtbl = Mutual Trust Bank IB + * bkash= Bkash Mobile Banking + * dbblmobilebanking= DBBL Mobile Banking + * city = City Touch IB + * upay = Upay + * tapnpay = Tap N Pay Gateway + * + * GROUP GATEWAY + * internetbank = For all internet banking + * mobileban= For all mobile banking + * othercard= For all cards except visa,master and amex + * visacard = For all visa + * mastercar= For All Master card + * amexcard = For Amex Card + */ + + 'gateway' => null, + + /** + * DEFAULT SYSTEM PRODUCT PROFILE + * -------------------------------- + * Product profile required from SSLC + * By default it is "general" + * + * AVAILABLE PROFILES + * general + * physical-goods + * non-physical-goods + * airline-tickets + * travel-vertical + * telecom-vertical + * + */ + + 'product_profile' => 'general', + + /** + * ALLOW FROM LOCALHOST + * -------------------------------- + * Set TRUE if you are in development mode, + * or you have localhost based application, + * otherwise FALSE in production + */ + + 'localhost' => env('SSLC_ALLOW_LOCALHOST',true), + + /** + * PATHS + * -------------------------------- + * Default paths of the sslcommerz system + * Do not change if necessary + * + */ + + 'path' => [ + 'domain' => [ + 'sandbox' => 'https://sandbox.sslcommerz.com', + 'live' => 'https://securepay.sslcommerz.com' + ], + 'endpoint' => [ + 'make_payment' => '/gwprocess/v4/api.php', + 'transaction_status' => '/validator/api/merchantTransIDvalidationAPI.php', + 'order_validate' => '/validator/api/validationserverAPI.php', + 'refund_payment' => '/validator/api/merchantTransIDvalidationAPI.php', + 'refund_status' => '/validator/api/merchantTransIDvalidationAPI.php', + ] + ] + ]; \ No newline at end of file diff --git a/packages/marvel/database/migrations/2020_04_17_194830_create_permission_tables.php b/packages/marvel/database/migrations/2020_04_17_194830_create_permission_tables.php new file mode 100644 index 0000000..64018c4 --- /dev/null +++ b/packages/marvel/database/migrations/2020_04_17_194830_create_permission_tables.php @@ -0,0 +1,114 @@ +bigIncrements('id'); + $table->string('name'); + $table->string('guard_name'); + $table->timestamps(); + }); + + Schema::create($tableNames['roles'], function (Blueprint $table) { + $table->bigIncrements('id'); + $table->string('name'); + $table->string('guard_name'); + $table->timestamps(); + }); + + Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) { + $table->unsignedBigInteger('permission_id'); + + $table->string('model_type'); + $table->unsignedBigInteger($columnNames['model_morph_key']); + $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index'); + + $table->foreign('permission_id') + ->references('id') + ->on($tableNames['permissions']) + ->onDelete('cascade'); + + $table->primary( + ['permission_id', $columnNames['model_morph_key'], 'model_type'], + 'model_has_permissions_permission_model_type_primary' + ); + }); + + Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) { + $table->unsignedBigInteger('role_id'); + + $table->string('model_type'); + $table->unsignedBigInteger($columnNames['model_morph_key']); + $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index'); + + $table->foreign('role_id') + ->references('id') + ->on($tableNames['roles']) + ->onDelete('cascade'); + + $table->primary( + ['role_id', $columnNames['model_morph_key'], 'model_type'], + 'model_has_roles_role_model_type_primary' + ); + }); + + Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) { + $table->unsignedBigInteger('permission_id'); + $table->unsignedBigInteger('role_id'); + + $table->foreign('permission_id') + ->references('id') + ->on($tableNames['permissions']) + ->onDelete('cascade'); + + $table->foreign('role_id') + ->references('id') + ->on($tableNames['roles']) + ->onDelete('cascade'); + + $table->primary(['permission_id', 'role_id'], 'role_has_permissions_permission_id_role_id_primary'); + }); + + app('cache') + ->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null) + ->forget(config('permission.cache.key')); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + $tableNames = config('permission.table_names'); + + if (empty($tableNames)) { + throw new \Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.'); + } + + Schema::drop($tableNames['role_has_permissions']); + Schema::drop($tableNames['model_has_roles']); + Schema::drop($tableNames['model_has_permissions']); + Schema::drop($tableNames['roles']); + Schema::drop($tableNames['permissions']); + } +} diff --git a/packages/marvel/database/migrations/2020_06_02_051901_create_marvel_tables.php b/packages/marvel/database/migrations/2020_06_02_051901_create_marvel_tables.php new file mode 100644 index 0000000..3f4547c --- /dev/null +++ b/packages/marvel/database/migrations/2020_06_02_051901_create_marvel_tables.php @@ -0,0 +1,280 @@ +id(); + $table->string('name'); + $table->double('amount'); + $table->string('is_global')->default(true); + $table->enum('type', ShippingType::getValues())->default(ShippingType::FIXED); + $table->timestamps(); + }); + Schema::create('coupons', function (Blueprint $table) { + $table->id(); + $table->string('code'); + $table->text('description')->nullable(); + $table->json('image')->nullable(); + $table->enum('type', CouponType::getValues())->default(CouponType::DEFAULT_COUPON); + $table->float('amount')->default(0); + $table->float('minimum_cart_amount')->default(0); + $table->string('active_from'); + $table->string('expire_at'); + $table->timestamps(); + $table->timestamp('deleted_at')->nullable(); + }); + + Schema::create('types', function (Blueprint $table) { + $table->id(); + $table->string('name'); + $table->string('slug'); + $table->string('icon')->nullable(); + $table->json('promotional_sliders')->nullable(); + $table->json('images')->nullable(); + $table->timestamps(); + }); + + Schema::create('authors', function (Blueprint $table) { + $table->id(); + $table->string('name'); + $table->boolean('is_approved')->default(false); + $table->json('image')->nullable(); + $table->json('cover_image')->nullable(); + $table->string('slug'); + $table->text('bio')->nullable(); + $table->text('quote')->nullable(); + $table->string('born')->nullable(); + $table->string('death')->nullable(); + $table->string('languages')->nullable(); + $table->json('socials')->nullable(); + $table->timestamps(); + }); + + Schema::create('manufacturers', function (Blueprint $table) { + $table->id(); + $table->string('name'); + $table->boolean('is_approved')->default(false); + $table->json('image')->nullable(); + $table->json('cover_image')->nullable(); + $table->string('slug'); + $table->unsignedBigInteger('type_id'); + $table->foreign('type_id')->references('id')->on('types')->onDelete('cascade'); + $table->text('description')->nullable(); + $table->string('website')->nullable(); + $table->json('socials')->nullable(); + $table->timestamps(); + }); + + Schema::create('products', function (Blueprint $table) { + $table->id(); + $table->string('name'); + $table->string('slug'); + $table->text('description')->nullable(); + $table->unsignedBigInteger('type_id'); + $table->foreign('type_id')->references('id')->on('types')->onDelete('cascade'); + $table->double('price')->nullable(); + $table->double('sale_price')->nullable(); + $table->string('sku')->nullable(); + $table->integer('quantity')->default(0); + $table->boolean('in_stock')->default(true); + $table->boolean('is_taxable')->default(false); + $table->unsignedBigInteger('shipping_class_id')->nullable(); + $table->foreign('shipping_class_id')->references('id')->on('shipping_classes'); + $table->enum('status', ProductStatus::getValues())->default(ProductStatus::DRAFT); + $table->enum('product_type', ProductType::getValues())->default(ProductType::SIMPLE); + $table->string('unit'); + $table->string('height')->nullable(); + $table->string('width')->nullable(); + $table->string('length')->nullable(); + $table->json('image')->nullable(); + $table->json('gallery')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + Schema::create('orders', function (Blueprint $table) { + $table->id(); + $table->string('tracking_number')->unique(); + $table->unsignedBigInteger('customer_id')->nullable(); + $table->string('customer_contact'); + $table->string('customer_name')->nullable(); + $table->double('amount'); + $table->double('sales_tax')->nullable(); + $table->double('paid_total')->nullable(); + $table->double('total')->nullable(); + $table->unsignedBigInteger('coupon_id')->nullable(); + $table->double('discount')->nullable(); + $table->string('payment_gateway')->nullable(); + $table->string('altered_payment_gateway')->nullable(); + $table->json('shipping_address')->nullable(); + $table->json('billing_address')->nullable(); + $table->unsignedBigInteger('logistics_provider')->nullable(); + $table->double('delivery_fee')->nullable(); + $table->string('delivery_time')->nullable(); + $table->enum('order_status', OrderStatus::getValues())->default(OrderStatus::DEFAULT_ORDER_STATUS); + $table->enum('payment_status', PaymentStatus::getValues())->default(PaymentStatus::DEFAULT_PAYMENT_STATUS); + $table->softDeletes(); + $table->timestamps(); + $table->foreign('customer_id')->references('id')->on('users'); + }); + + Schema::create('order_product', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('order_id'); + $table->unsignedBigInteger('product_id'); + $table->string('order_quantity'); + $table->double('unit_price'); + $table->double('subtotal'); + $table->softDeletes(); + $table->timestamps(); + $table->foreign('order_id')->references('id')->on('orders')->onDelete('cascade'); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + }); + + Schema::create('categories', function (Blueprint $table) { + $table->id(); + $table->string('name'); + $table->string('slug'); + $table->string('icon')->nullable(); + $table->json('image')->nullable(); + $table->json('banner_image')->nullable(); + $table->text('details')->nullable(); + $table->unsignedBigInteger('parent')->nullable(); + $table->foreign('parent')->references('id')->on('categories')->onDelete('cascade'); +// $table->unsignedBigInteger('type_id'); +// $table->foreign('type_id')->references('id')->on('types')->onDelete('cascade'); + $table->timestamps(); + $table->softDeletes(); + }); + + Schema::create('category_product', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('product_id'); + $table->unsignedBigInteger('category_id'); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); + }); + + Schema::create('attributes', function (Blueprint $table) { + $table->id(); + $table->string('slug'); + $table->string('name'); + $table->timestamps(); + }); + + Schema::create('attribute_values', function (Blueprint $table) { + $table->id(); + $table->string('slug'); + $table->unsignedBigInteger('attribute_id'); + $table->foreign('attribute_id')->references('id')->on('attributes')->onDelete('cascade'); + $table->string('value'); + $table->timestamps(); + }); + + Schema::create('attribute_product', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('attribute_value_id'); + $table->foreign('attribute_value_id')->references('id')->on('attribute_values')->onDelete('cascade'); + $table->unsignedBigInteger('product_id'); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + $table->timestamps(); + }); + + Schema::create('tax_classes', function (Blueprint $table) { + $table->id(); + $table->string('country')->nullable(); + $table->string('state')->nullable(); + $table->string('zip')->nullable(); + $table->string('city')->nullable(); + $table->double('rate'); + $table->string('name')->nullable(); + $table->integer('is_global')->nullable(); + $table->integer('priority')->nullable(); + $table->boolean('on_shipping')->default(1); + $table->timestamps(); + }); + + Schema::create('address', function (Blueprint $table) { + $table->id(); + $table->string('title'); + $table->string('type'); + $table->boolean('default')->default(false); + $table->json('address'); + $table->json('location')->nullable(); + $table->unsignedBigInteger('customer_id'); + $table->foreign('customer_id')->references('id')->on('users'); + $table->timestamps(); + }); + + Schema::create('settings', function (Blueprint $table) { + $table->id(); + $table->json('options'); + $table->timestamps(); + }); + + Schema::create('user_profiles', function (Blueprint $table) { + $table->id(); + $table->json('avatar')->nullable(); + $table->text('bio')->nullable(); + $table->json('socials')->nullable(); + $table->string('contact')->nullable(); + $table->unsignedBigInteger('customer_id'); + $table->foreign('customer_id')->references('id')->on('users'); + $table->timestamps(); + }); + + Schema::table('users', function (Blueprint $table) { + $table->boolean('is_active')->default(1); + }); + + Schema::create('attachments', function (Blueprint $table) { + $table->id(); + $table->string('url')->default(''); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shipping_classes'); + Schema::dropIfExists('shipping_classes'); + Schema::dropIfExists('coupons'); + Schema::dropIfExists('types'); + Schema::dropIfExists('products'); + Schema::dropIfExists('orders'); + Schema::dropIfExists('order_product'); + Schema::dropIfExists('categories'); + Schema::dropIfExists('category_product'); + Schema::dropIfExists('attributes'); + Schema::dropIfExists('attribute_values'); + Schema::dropIfExists('attribute_product'); + Schema::dropIfExists('tax_classes'); + Schema::dropIfExists('address'); + Schema::dropIfExists('settings'); + Schema::dropIfExists('user_profiles'); + Schema::dropIfExists('attachments'); + Schema::dropIfExists('authors'); + Schema::dropIfExists('manufacturers'); + } +} diff --git a/packages/marvel/database/migrations/2020_10_26_163529_create_media_table.php b/packages/marvel/database/migrations/2020_10_26_163529_create_media_table.php new file mode 100644 index 0000000..20d4afd --- /dev/null +++ b/packages/marvel/database/migrations/2020_10_26_163529_create_media_table.php @@ -0,0 +1,40 @@ +bigIncrements('id'); + + $table->morphs('model'); + $table->uuid('uuid')->nullable(); + $table->string('collection_name'); + $table->string('name'); + $table->string('file_name'); + $table->string('mime_type')->nullable(); + $table->string('disk'); + $table->string('conversions_disk')->nullable(); + $table->unsignedBigInteger('size'); + $table->json('manipulations'); + $table->json('generated_conversions'); + $table->json('custom_properties'); + $table->json('responsive_images'); + $table->unsignedInteger('order_column')->nullable(); + + $table->nullableTimestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down() + { + Schema::dropIfExists('media'); + } +} diff --git a/packages/marvel/database/migrations/2021_04_17_051901_create_new_marvel_tables.php b/packages/marvel/database/migrations/2021_04_17_051901_create_new_marvel_tables.php new file mode 100644 index 0000000..9e37f6b --- /dev/null +++ b/packages/marvel/database/migrations/2021_04_17_051901_create_new_marvel_tables.php @@ -0,0 +1,226 @@ +id(); + $table->string('title'); + $table->string('price'); + $table->string('sale_price')->nullable(); + $table->unsignedBigInteger('quantity'); + $table->boolean('is_disable')->default(false); + $table->string('sku')->nullable(); + $table->json('options'); + $table->unsignedBigInteger('product_id')->nullable(); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + $table->timestamps(); + }); + + Schema::create('tags', function (Blueprint $table) { + $table->id(); + $table->string('name'); + $table->string('slug'); + $table->string('icon')->nullable(); + $table->json('image')->nullable(); + $table->text('details')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + + Schema::create('product_tag', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('product_id'); + $table->unsignedBigInteger('tag_id'); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + $table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade'); + }); + Schema::table('products', function (Blueprint $table) { + $table->float('min_price')->after('sale_price')->nullable(); + $table->float('max_price')->after('min_price')->nullable(); + $table->json('video')->after('image')->nullable(); + }); + + Schema::table('order_product', function (Blueprint $table) { + $table->unsignedBigInteger('variation_option_id')->after('product_id')->nullable(); + $table->foreign('variation_option_id')->references('id')->on('variation_options'); + }); + + Schema::create('shops', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('owner_id'); + $table->foreign('owner_id')->references('id')->on('users'); + $table->string('name')->nullable(); + $table->string('slug')->nullable(); + $table->text('description')->nullable(); + $table->json('cover_image')->nullable(); + $table->json('logo')->nullable(); + $table->boolean('is_active')->default(false); + $table->json('address')->nullable(); + $table->json('settings')->nullable(); + $table->timestamps(); + }); + Schema::create('balances', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('shop_id'); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->double('admin_commission_rate')->nullable(); + $table->double('total_earnings')->default(0); + $table->double('withdrawn_amount')->default(0); + $table->double('current_balance')->default(0); + $table->json('payment_info')->nullable(); + $table->timestamps(); + }); + + Schema::table('users', function (Blueprint $table) { + $table->unsignedBigInteger('shop_id')->nullable(); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + }); + + Schema::create('user_shop', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('user_id'); + $table->unsignedBigInteger('shop_id'); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + }); + + Schema::create('category_shop', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('shop_id'); + $table->unsignedBigInteger('category_id'); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); + }); + + Schema::create('withdraws', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('shop_id'); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->float('amount'); + $table->string('payment_method')->nullable(); + $table->enum('status', WithdrawStatus::getValues())->default(WithdrawStatus::PENDING); + $table->text('details')->nullable(); + $table->text('note')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + + Schema::table('attributes', function (Blueprint $table) { + $table->unsignedBigInteger('shop_id')->nullable()->after('name'); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + }); + + Schema::table('attribute_values', function (Blueprint $table) { + $table->string('meta')->after('value')->nullable(); + }); + + Schema::table('types', function (Blueprint $table) { + $table->json('settings')->after('name')->nullable(); + }); + + Schema::table('products', function (Blueprint $table) { + $table->unsignedBigInteger('shop_id')->after('price')->nullable(); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + }); + Schema::table('orders', function (Blueprint $table) { + $table->unsignedBigInteger('shop_id')->after('coupon_id')->nullable(); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->unsignedBigInteger('parent_id')->after('coupon_id')->nullable(); + $table->foreign('parent_id')->references('id')->on('orders')->onDelete('cascade'); + }); + + Schema::table('users', function (Blueprint $table) { + $table->string('password')->nullable()->change(); + }); + + Schema::create('providers', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('user_id'); + $table->string('provider_user_id'); + $table->string('provider'); + $table->timestamps(); + + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + }); + + Schema::create('banners', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('type_id'); + $table->text('title'); + $table->text('description')->nullable(); + $table->json('image')->nullable(); + $table->timestamps(); + $table->foreign('type_id')->references('id')->on('types')->onDelete('cascade'); + }); + + Schema::create('payment_gateways', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('user_id'); + $table->string('customer_id'); + $table->string('gateway_name')->nullable(); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->softDeletes(); + $table->timestamps(); + }); + + + Schema::create('payment_methods', function (Blueprint $table) { + $table->id(); + $table->string('method_key')->unique(); + $table->unsignedBigInteger('payment_gateway_id')->nullable(); + $table->boolean('default_card')->nullable()->default(false); + $table->string('fingerprint')->unique(); + $table->string('owner_name')->nullable(); + $table->string('network')->nullable(); + $table->string('type')->nullable(); + $table->string('last4')->nullable(); + $table->string('expires')->nullable(); + $table->string('origin')->nullable(); + $table->string('verification_check')->nullable(); + $table->foreign('payment_gateway_id')->references('id')->on('payment_gateways')->onDelete('cascade'); + $table->softDeletes(); + $table->timestamps(); + }); + + + Schema::create('payment_intents', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('order_id')->nullable(); + $table->string('tracking_number')->nullable(); + $table->string('payment_gateway')->nullable(); + $table->json('payment_intent_info')->nullable(); + $table->foreign('order_id')->references('id')->on('orders')->onDelete('cascade'); + $table->softDeletes(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('withdraws'); + Schema::dropIfExists('store_settings'); + Schema::dropIfExists('variation_options'); + Schema::dropIfExists('product_tag'); + Schema::dropIfExists('tags'); + Schema::dropIfExists('payment_gateways'); + Schema::dropIfExists('cards'); + Schema::dropIfExists('payment_intents'); + } +} diff --git a/packages/marvel/database/migrations/2021_08_08_051901_create_wallet_table.php b/packages/marvel/database/migrations/2021_08_08_051901_create_wallet_table.php new file mode 100644 index 0000000..207a946 --- /dev/null +++ b/packages/marvel/database/migrations/2021_08_08_051901_create_wallet_table.php @@ -0,0 +1,61 @@ +id(); + $table->double('total_points')->default(0); + $table->double('points_used')->default(0); + $table->double('available_points')->default(0); + $table->unsignedBigInteger('customer_id')->nullable(); + $table->foreign('customer_id')->references('id')->on('users')->onDelete('cascade'); + $table->timestamps(); + }); + + Schema::create('order_wallet_points', function (Blueprint $table) { + $table->id(); + $table->double('amount')->nullable(); + $table->unsignedBigInteger('order_id')->nullable(); + $table->foreign('order_id')->references('id')->on('orders')->onDelete('cascade'); + $table->timestamps(); + }); + + Schema::create('refunds', function (Blueprint $table) { + $table->id(); + $table->double('amount')->default(0); + $table->enum('status',RefundStatus::getValues())->default(RefundStatus::PENDING); + $table->string('title')->nullable(); + $table->text('description')->nullable(); + $table->json('images')->nullable(); + $table->unsignedBigInteger('order_id')->nullable(); + $table->foreign('order_id')->references('id')->on('orders')->onDelete('cascade'); + $table->unsignedBigInteger('customer_id')->nullable(); + $table->foreign('customer_id')->references('id')->on('users')->onDelete('cascade'); + $table->unsignedBigInteger('shop_id')->nullable(); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('wallets'); + } +} diff --git a/packages/marvel/database/migrations/2021_09_26_051901_create_product_type_table.php b/packages/marvel/database/migrations/2021_09_26_051901_create_product_type_table.php new file mode 100644 index 0000000..22b6582 --- /dev/null +++ b/packages/marvel/database/migrations/2021_09_26_051901_create_product_type_table.php @@ -0,0 +1,77 @@ +unsignedBigInteger('author_id')->nullable(); + $table->foreign('author_id')->references('id')->on('authors')->onDelete('cascade'); + $table->unsignedBigInteger('manufacturer_id')->nullable(); + $table->foreign('manufacturer_id')->references('id')->on('manufacturers')->onDelete('cascade'); + $table->boolean('is_digital')->default(0); + $table->boolean('is_external')->default(0); + $table->string('external_product_url')->nullable(); + $table->string('external_product_button_text')->nullable(); + $table->string('blocked_dates')->nullable(); + }); + + Schema::create('digital_files', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('attachment_id'); + $table->string('url'); + $table->string('file_name'); + $table->string('fileable_type'); + $table->unsignedBigInteger('fileable_id'); + $table->timestamps(); + }); + + Schema::create('ordered_files', function (Blueprint $table) { + $table->id(); + $table->string('purchase_key'); + $table->unsignedBigInteger('digital_file_id'); + $table->foreign('digital_file_id')->references('id')->on('digital_files')->onDelete('cascade'); + $table->string('tracking_number')->nullable(); + $table->foreign('tracking_number')->references('tracking_number')->on('orders')->onDelete('cascade'); + $table->unsignedBigInteger('customer_id'); + $table->foreign('customer_id')->references('id')->on('users')->onDelete('cascade'); + $table->timestamps(); + }); + + Schema::create('download_tokens', function (Blueprint $table) { + $table->id(); + $table->string('token'); + $table->unsignedBigInteger('digital_file_id')->nullable(); + $table->text('payload')->nullable(); + $table->foreign('digital_file_id')->references('id')->on('digital_files')->onDelete('cascade'); + $table->unsignedBigInteger('user_id'); + $table->timestamps(); + }); + + Schema::table('variation_options', function (Blueprint $table) { + $table->json('image')->after('title')->nullable(); + $table->boolean('is_digital')->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('digital_files'); + Schema::dropIfExists('download_tokens'); + Schema::dropIfExists('ordered_files'); + } +} diff --git a/packages/marvel/database/migrations/2021_10_12_193855_create_reviews_table.php b/packages/marvel/database/migrations/2021_10_12_193855_create_reviews_table.php new file mode 100644 index 0000000..10afa0b --- /dev/null +++ b/packages/marvel/database/migrations/2021_10_12_193855_create_reviews_table.php @@ -0,0 +1,88 @@ +bigIncrements('id'); + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->unsignedBigInteger('shop_id'); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->unsignedBigInteger('product_id'); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + $table->longText('comment'); + $table->double('rating')->nullable(); + $table->json('photos')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + + Schema::create('questions', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->unsignedBigInteger('shop_id'); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->unsignedBigInteger('product_id'); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + $table->text('question'); + $table->text('answer')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + + Schema::create('feedbacks', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->morphs('model'); + $table->boolean('positive')->nullable(); + $table->boolean('negative')->nullable(); + $table->timestamps(); + }); + + Schema::create('abusive_reports', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->morphs('model'); + $table->text('message'); + $table->timestamps(); + }); + + Schema::create('wishlists', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->unsignedBigInteger('product_id'); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + $table->timestamps(); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('reviews'); + Schema::dropIfExists('questions'); + Schema::dropIfExists('feedbacks'); + Schema::dropIfExists('abusive_reports'); + Schema::dropIfExists('wishlists'); + } +} diff --git a/packages/marvel/database/migrations/2022_01_19_051901_create_rental_tables.php b/packages/marvel/database/migrations/2022_01_19_051901_create_rental_tables.php new file mode 100644 index 0000000..35d50b9 --- /dev/null +++ b/packages/marvel/database/migrations/2022_01_19_051901_create_rental_tables.php @@ -0,0 +1,104 @@ +increments('id'); + $table->unsignedBigInteger('product_id'); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + $table->string('type')->default('null'); + $table->string('key')->index(); + $table->text('value')->nullable(); + $table->timestamps(); + }); + + + Schema::create('availabilities', function (Blueprint $table) { + $table->id(); + $table->string('from'); + $table->string('to'); + $table->string('booking_duration'); + $table->integer('order_quantity'); + $table->string('bookable_type'); + $table->unsignedBigInteger('bookable_id'); + $table->unsignedBigInteger('order_id')->nullable(); + $table->foreign('order_id')->references('id')->on('orders')->onDelete('cascade'); + $table->unsignedBigInteger('product_id')->nullable(); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + $table->timestamps(); + }); + + Schema::create('resources', function (Blueprint $table) { + $table->id(); + $table->string('name'); + $table->string('slug'); + $table->string('icon')->nullable(); + $table->text('details')->nullable(); + $table->json('image')->nullable(); + $table->boolean('is_approved')->default(false); + $table->double('price')->nullable(); + $table->enum('type', ResourceType::getValues()); + $table->timestamps(); + }); + + Schema::create('dropoff_location_product', function (Blueprint $table) { + $table->unsignedBigInteger('resource_id')->nullable(); + $table->foreign('resource_id')->references('id')->on('resources')->onDelete('cascade'); + $table->unsignedBigInteger('product_id')->nullable(); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + }); + + Schema::create('pickup_location_product', function (Blueprint $table) { + $table->unsignedBigInteger('resource_id')->nullable(); + $table->foreign('resource_id')->references('id')->on('resources')->onDelete('cascade'); + $table->unsignedBigInteger('product_id')->nullable(); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + }); + + Schema::create('feature_product', function (Blueprint $table) { + $table->unsignedBigInteger('resource_id')->nullable(); + $table->foreign('resource_id')->references('id')->on('resources')->onDelete('cascade'); + $table->unsignedBigInteger('product_id')->nullable(); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + }); + Schema::create('deposit_product', function (Blueprint $table) { + $table->unsignedBigInteger('resource_id')->nullable(); + $table->foreign('resource_id')->references('id')->on('resources')->onDelete('cascade'); + $table->unsignedBigInteger('product_id')->nullable(); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + }); + + Schema::create('person_product', function (Blueprint $table) { + $table->unsignedBigInteger('resource_id')->nullable(); + $table->foreign('resource_id')->references('id')->on('resources')->onDelete('cascade'); + $table->unsignedBigInteger('product_id')->nullable(); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('availabilities'); + Schema::dropIfExists('products_meta'); + Schema::dropIfExists('locations'); + Schema::dropIfExists('location_product'); + } +} diff --git a/packages/marvel/database/migrations/2022_01_31_051901_create_marvel_languages_tables.php b/packages/marvel/database/migrations/2022_01_31_051901_create_marvel_languages_tables.php new file mode 100644 index 0000000..42c66a1 --- /dev/null +++ b/packages/marvel/database/migrations/2022_01_31_051901_create_marvel_languages_tables.php @@ -0,0 +1,95 @@ +increments('id'); + $table->json('flag'); + $table->string('language_code'); + $table->string('language_name'); + $table->timestamps(); + }); + + Schema::create('translations', function (Blueprint $table) { + $table->id(); + $table->string('item_type'); + $table->unsignedBigInteger('item_id'); // this is the translated item id + $table->unsignedBigInteger('translation_item_id')->nullable(); // this is the main element id + $table->string('language_code'); + $table->string('source_language_code')->default(DEFAULT_LANGUAGE); + $table->timestamps(); + }); + } + + + Schema::table('products', function (Blueprint $table) { + $table->string('language')->after('sale_price')->default(DEFAULT_LANGUAGE); + }); + Schema::table('categories', function (Blueprint $table) { + $table->string('language')->after('slug')->default(DEFAULT_LANGUAGE); + }); + Schema::table('tags', function (Blueprint $table) { + $table->string('language')->after('slug')->default(DEFAULT_LANGUAGE); + }); + Schema::table('authors', function (Blueprint $table) { + $table->string('language')->after('slug')->default(DEFAULT_LANGUAGE); + }); + Schema::table('manufacturers', function (Blueprint $table) { + $table->string('language')->after('slug')->default(DEFAULT_LANGUAGE); + }); + Schema::table('resources', function (Blueprint $table) { + $table->string('language')->after('slug')->default(DEFAULT_LANGUAGE); + }); + Schema::table('types', function (Blueprint $table) { + $table->string('language')->after('slug')->default(DEFAULT_LANGUAGE); + }); + Schema::table('attributes', function (Blueprint $table) { + $table->string('language')->after('slug')->default(DEFAULT_LANGUAGE); + }); + Schema::table('attribute_values', function (Blueprint $table) { + $table->string('language')->after('value')->default(DEFAULT_LANGUAGE); + }); + Schema::table('availabilities', function (Blueprint $table) { + $table->string('language')->after('to')->default(DEFAULT_LANGUAGE); + }); + Schema::table('coupons', function (Blueprint $table) { + $table->string('language')->after('code')->default(DEFAULT_LANGUAGE); + }); + Schema::table('orders', function (Blueprint $table) { + $table->string('language')->after('total')->default(DEFAULT_LANGUAGE); + }); + // Schema::table('order_status', function (Blueprint $table) { + // $table->string('language')->after('serial')->default(DEFAULT_LANGUAGE); + // }); + Schema::table('variation_options', function (Blueprint $table) { + $table->string('language')->after('sale_price')->default(DEFAULT_LANGUAGE); + }); + Schema::table('settings', function (Blueprint $table) { + $table->string('language')->unique()->after('options')->default(DEFAULT_LANGUAGE); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('languages'); + Schema::dropIfExists('translations'); + } +} diff --git a/packages/marvel/database/migrations/2022_03_23_051901_create_marvel_delivery_time_tables.php b/packages/marvel/database/migrations/2022_03_23_051901_create_marvel_delivery_time_tables.php new file mode 100644 index 0000000..dc279d8 --- /dev/null +++ b/packages/marvel/database/migrations/2022_03_23_051901_create_marvel_delivery_time_tables.php @@ -0,0 +1,37 @@ +increments('id'); + $table->string('title'); + $table->string('slug'); + $table->string('icon'); + $table->text('description')->nullable(); + $table->string('language')->default(DEFAULT_LANGUAGE); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('delivery_times'); + } +} diff --git a/packages/marvel/database/migrations/2022_03_23_051902_create_marvel_store_notice_tables.php b/packages/marvel/database/migrations/2022_03_23_051902_create_marvel_store_notice_tables.php new file mode 100644 index 0000000..d6a00fd --- /dev/null +++ b/packages/marvel/database/migrations/2022_03_23_051902_create_marvel_store_notice_tables.php @@ -0,0 +1,59 @@ +id(); + $table->enum('priority', StoreNoticePriority::getValues())->default(StoreNoticePriority::LOW); + $table->text('notice'); + $table->text('description')->nullable(); + $table->dateTime('effective_from')->default(now()); + $table->dateTime('expired_at'); + $table->enum('type', StoreNoticeType::getValues()); + $table->foreignId('created_by')->nullable()->references('id')->on('users'); + $table->foreignId('updated_by')->nullable()->references('id')->on('users'); + $table->timestamps(); + $table->softDeletes(); + }); + Schema::create('store_notice_user', function (Blueprint $table) { + $table->foreignId('store_notice_id')->nullable()->references('id')->on('store_notices')->cascadeOnDelete(); + $table->foreignId('user_id')->nullable()->references('id')->on('users')->cascadeOnDelete(); + }); + Schema::create('store_notice_shop', function (Blueprint $table) { + $table->foreignId('store_notice_id')->nullable()->references('id')->on('store_notices')->cascadeOnDelete(); + $table->foreignId('shop_id')->nullable()->references('id')->on('shops')->cascadeOnDelete(); + }); + Schema::create('store_notice_read', function (Blueprint $table) { + $table->foreignId('store_notice_id')->nullable()->references('id')->on('store_notices')->cascadeOnDelete(); + $table->foreignId('user_id')->nullable()->references('id')->on('users')->cascadeOnDelete(); + $table->boolean('is_read')->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('store_notices'); + Schema::dropIfExists('store_notice_user'); + Schema::dropIfExists('store_notice_shop'); + Schema::dropIfExists('store_notice_read'); + } +} diff --git a/packages/marvel/database/migrations/2022_03_24_124527_add_columns_to_table.php b/packages/marvel/database/migrations/2022_03_24_124527_add_columns_to_table.php new file mode 100644 index 0000000..4cb6583 --- /dev/null +++ b/packages/marvel/database/migrations/2022_03_24_124527_add_columns_to_table.php @@ -0,0 +1,51 @@ +unsignedBigInteger('order_id')->after('id')->nullable(); + $table->foreign('order_id')->references('id')->on('orders')->onDelete('cascade'); + $table->unsignedBigInteger('variation_option_id')->after('product_id')->nullable(); + $table->foreign('variation_option_id')->references('id')->on('variation_options')->onDelete('cascade'); + }); + + Schema::table('wishlists', function (Blueprint $table) { + $table->unsignedBigInteger('variation_option_id')->after('product_id')->nullable(); + $table->foreign('variation_option_id')->references('id')->on('variation_options')->onDelete('cascade'); + }); + Schema::table('orders', function (Blueprint $table) { + $table->decimal('cancelled_amount')->after('total')->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('reviews', function (Blueprint $table) { + $table->dropColumn('order_id'); + $table->dropColumn('variation_option_id'); + }); + + Schema::table('wishlists', function (Blueprint $table) { + $table->dropColumn('variation_option_id'); + }); + Schema::table('orders', function (Blueprint $table) { + $table->dropColumn('cancelled_amount'); + }); + } +} diff --git a/packages/marvel/database/migrations/2022_05_09_070829_create_messages_table.php b/packages/marvel/database/migrations/2022_05_09_070829_create_messages_table.php new file mode 100644 index 0000000..5b468b4 --- /dev/null +++ b/packages/marvel/database/migrations/2022_05_09_070829_create_messages_table.php @@ -0,0 +1,76 @@ +id(); + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->unsignedBigInteger('shop_id'); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->timestamps(); + }); + + Schema::create('messages', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('conversation_id'); + $table->foreign('conversation_id')->references('id')->on('conversations')->onDelete('cascade'); + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->text('body'); + $table->timestamps(); + }); + + Schema::create('participants', function (Blueprint $table) { + $table->id(); + $table->unsignedBigInteger('conversation_id'); + $table->foreign('conversation_id')->references('id')->on('conversations')->onDelete('cascade'); + $table->enum('type', ['shop', 'user']); + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->unsignedBigInteger('shop_id'); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->unsignedBigInteger('message_id'); + $table->foreign('message_id')->references('id')->on('messages')->onDelete('cascade'); + $table->boolean('notify')->default(0); + $table->timestamp('last_read')->nullable(); + $table->timestamps(); + }); + + Schema::table('user_profiles', function ($table) { + $table->json('notifications')->after('contact')->nullable(); + }); + Schema::table('shops', function ($table) { + $table->json('notifications')->after('settings')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('conversations'); + Schema::dropIfExists('messages'); + Schema::dropIfExists('participants'); + Schema::table('user_profiles', function ($table) { + $table->dropColumn('notifications'); + }); + Schema::table('shops', function ($table) { + $table->dropColumn('notifications'); + }); + } +} diff --git a/packages/marvel/database/migrations/2023_05_10_154638_add_column_to_order_table.php b/packages/marvel/database/migrations/2023_05_10_154638_add_column_to_order_table.php new file mode 100644 index 0000000..9205d1e --- /dev/null +++ b/packages/marvel/database/migrations/2023_05_10_154638_add_column_to_order_table.php @@ -0,0 +1,32 @@ +decimal('cancelled_tax')->after('cancelled_amount')->default(0); + $table->decimal('cancelled_delivery_fee')->after('cancelled_tax')->default(0); + $table->longText('note')->after('total')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('orders', function (Blueprint $table) { + $table->dropColumn('note'); + $table->dropColumn('cancelled_tax'); + $table->dropColumn('cancelled_delivery_fee'); + }); + } +}; diff --git a/packages/marvel/database/migrations/2023_07_12_030502_create_notify_logs_table.php b/packages/marvel/database/migrations/2023_07_12_030502_create_notify_logs_table.php new file mode 100644 index 0000000..5ea2227 --- /dev/null +++ b/packages/marvel/database/migrations/2023_07_12_030502_create_notify_logs_table.php @@ -0,0 +1,37 @@ +id(); + $table->unsignedBigInteger('receiver'); + $table->foreign('receiver')->references('id')->on('users')->onDelete('cascade'); + $table->unsignedBigInteger('sender')->nullable(); + $table->foreign('sender')->references('id')->on('users')->onDelete('cascade'); + $table->text('notify_type')->nullable(); + $table->text('notify_receiver_type')->nullable(); + $table->boolean('is_read')->default(false); + $table->text('notify_tracker')->nullable(); + $table->text('notify_text')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('notify_logs'); + } +}; diff --git a/packages/marvel/database/migrations/2023_07_19_162433_create_faqs_table.php b/packages/marvel/database/migrations/2023_07_19_162433_create_faqs_table.php new file mode 100644 index 0000000..d254786 --- /dev/null +++ b/packages/marvel/database/migrations/2023_07_19_162433_create_faqs_table.php @@ -0,0 +1,38 @@ +id(); + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->unsignedBigInteger('shop_id')->nullable(); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->text('faq_title'); + $table->string('slug'); + $table->text('faq_description'); + $table->string('faq_type')->nullable(); + $table->string('issued_by')->nullable(); + $table->string('language')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('faqs'); + } +}; diff --git a/packages/marvel/database/migrations/2023_07_25_053633_create_terms_and_conditions_table.php b/packages/marvel/database/migrations/2023_07_25_053633_create_terms_and_conditions_table.php new file mode 100644 index 0000000..25db04c --- /dev/null +++ b/packages/marvel/database/migrations/2023_07_25_053633_create_terms_and_conditions_table.php @@ -0,0 +1,39 @@ +id(); + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->unsignedBigInteger('shop_id')->nullable(); + $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade'); + $table->text('title'); + $table->string('slug'); + $table->text('description'); + $table->string('type')->nullable(); + $table->string('issued_by')->nullable(); + $table->boolean('is_approved')->default(false); + $table->string('language')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('terms_and_conditions'); + } +}; diff --git a/packages/marvel/database/migrations/2023_08_10_161757_add_sold_quantity_column_to_products_table.php b/packages/marvel/database/migrations/2023_08_10_161757_add_sold_quantity_column_to_products_table.php new file mode 100644 index 0000000..ec2ca71 --- /dev/null +++ b/packages/marvel/database/migrations/2023_08_10_161757_add_sold_quantity_column_to_products_table.php @@ -0,0 +1,35 @@ +integer('sold_quantity')->after('quantity')->default(0); + }); + + Schema::table('variation_options', function (Blueprint $table) { + $table->integer('sold_quantity')->after('quantity')->default(0); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('products', function (Blueprint $table) { + $table->dropColumn('sold_quantity'); + }); + Schema::table('variation_options', function (Blueprint $table) { + $table->dropColumn('sold_quantity'); + }); + } +}; diff --git a/packages/marvel/database/migrations/2023_08_14_173253_create_flash_sales_table.php b/packages/marvel/database/migrations/2023_08_14_173253_create_flash_sales_table.php new file mode 100644 index 0000000..dc0588e --- /dev/null +++ b/packages/marvel/database/migrations/2023_08_14_173253_create_flash_sales_table.php @@ -0,0 +1,59 @@ +id(); + $table->string('title'); + $table->string('slug'); + $table->text('description')->nullable(); + $table->dateTime('start_date')->default(now()); + $table->dateTime('end_date'); + $table->boolean('sale_status')->default(false); + $table->enum('type', FlashSaleType::getValues())->default(FlashSaleType::DEFAULT); + $table->integer('rate')->nullable(); + $table->json('sale_builder')->nullable(); + $table->json('image')->nullable(); + $table->json('cover_image')->nullable(); + $table->string('language')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + + Schema::create('flash_sale_requests', function (Blueprint $table) { + $table->id(); + $table->string('title'); + $table->json('requested_product_ids')->nullable(); + $table->boolean('request_status')->default(false); + $table->softDeletes(); + $table->timestamps(); + }); + + Schema::create('flash_sale_products', function (Blueprint $table) { + $table->unsignedBigInteger('flash_sale_id'); + $table->unsignedBigInteger('product_id'); + $table->foreign('flash_sale_id')->references('id')->on('flash_sales')->onDelete('cascade'); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('flash_sales'); + Schema::dropIfExists('flash_sale_requests'); + Schema::dropIfExists('flash_sale_products'); + } +}; \ No newline at end of file diff --git a/packages/marvel/database/migrations/2023_08_15_061447_add_is_featured_column_to_products_table.php b/packages/marvel/database/migrations/2023_08_15_061447_add_is_featured_column_to_products_table.php new file mode 100644 index 0000000..f7cefc3 --- /dev/null +++ b/packages/marvel/database/migrations/2023_08_15_061447_add_is_featured_column_to_products_table.php @@ -0,0 +1,28 @@ +integer('in_flash_sale')->after('is_taxable')->default(false); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('products', function (Blueprint $table) { + $table->dropColumn('in_flash_sale'); + }); + } +}; diff --git a/packages/marvel/database/migrations/2023_08_28_114418_create_refund_policies_table.php b/packages/marvel/database/migrations/2023_08_28_114418_create_refund_policies_table.php new file mode 100644 index 0000000..db2f25b --- /dev/null +++ b/packages/marvel/database/migrations/2023_08_28_114418_create_refund_policies_table.php @@ -0,0 +1,43 @@ +id(); + $table->string('title'); + $table->string('slug')->unique(); + $table->text('description')->nullable(); + $table->enum('target', RefundPolicyTarget::getValues())->default(RefundPolicyTarget::VENDOR); + $table->string('language')->default(DEFAULT_LANGUAGE); + $table->enum('status', RefundPolicyStatus::getValues())->default(RefundPolicyStatus::PENDING); + $table->foreignId('shop_id')->nullable()->constrained('shops')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); + }); + Schema::table('refunds', function (Blueprint $table) { + $table->foreignId('refund_policy_id')->after('customer_id')->nullable()->constrained('refund_policies')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('refunds', function (Blueprint $table) { + $table->dropForeign(['refund_policy_id']); + }); + Schema::dropIfExists('refund_policies'); + } +}; diff --git a/packages/marvel/database/migrations/2023_09_07_061715_create_refund_reasons_table.php b/packages/marvel/database/migrations/2023_09_07_061715_create_refund_reasons_table.php new file mode 100644 index 0000000..ff6e203 --- /dev/null +++ b/packages/marvel/database/migrations/2023_09_07_061715_create_refund_reasons_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('name'); + $table->string('slug'); + $table->string('language')->default(DEFAULT_LANGUAGE); + $table->timestamps(); + $table->softDeletes(); + }); + Schema::table('refunds', function (Blueprint $table) { + $table->foreignId('refund_reason_id')->after('shop_id')->nullable()->constrained('refund_reasons')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('refunds', function (Blueprint $table) { + $table->dropForeign(['refund_reason_id']); + }); + Schema::dropIfExists('refund_reasons'); + } +}; diff --git a/packages/marvel/database/migrations/2023_10_19_055742_add_note_column_to_flash_sale_requests_table.php b/packages/marvel/database/migrations/2023_10_19_055742_add_note_column_to_flash_sale_requests_table.php new file mode 100644 index 0000000..405a2b8 --- /dev/null +++ b/packages/marvel/database/migrations/2023_10_19_055742_add_note_column_to_flash_sale_requests_table.php @@ -0,0 +1,42 @@ +dropColumn('requested_product_ids'); + $table->string('note')->after('request_status')->nullable(); + $table->unsignedBigInteger('flash_sale_id')->after('title'); + $table->foreign('flash_sale_id')->references('id')->on('flash_sales')->onDelete('cascade'); + $table->string('language')->after('note')->default(DEFAULT_LANGUAGE); + }); + + Schema::create('flash_sale_requests_products', function (Blueprint $table) { + $table->unsignedBigInteger('flash_sale_requests_id')->nullable(); + $table->foreign('flash_sale_requests_id')->references('id')->on('flash_sale_requests')->onDelete('cascade'); + $table->unsignedBigInteger('product_id')->nullable(); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('flash_sale_requests', function (Blueprint $table) { + $table->dropColumn('note'); + $table->dropColumn('flash_sale_id'); + $table->dropColumn('language'); + }); + Schema::dropIfExists('flash_sale_requests_products'); + } +}; diff --git a/packages/marvel/database/migrations/2023_11_28_090210_add_new_two_column_to_coupons_table.php b/packages/marvel/database/migrations/2023_11_28_090210_add_new_two_column_to_coupons_table.php new file mode 100644 index 0000000..8e89c4e --- /dev/null +++ b/packages/marvel/database/migrations/2023_11_28_090210_add_new_two_column_to_coupons_table.php @@ -0,0 +1,33 @@ +boolean('target')->after('expire_at')->default(false) + ->comment('Default value is false but For authenticated customer the value is true'); + $table->boolean('is_approve')->after('target')->default(false); + $table->foreignId('shop_id')->after('is_approve')->nullable()->constrained('shops')->onDelete('cascade'); + $table->foreignId('user_id')->after('shop_id')->nullable()->constrained('users')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('coupons', function (Blueprint $table) { + $table->dropColumn('target'); + $table->dropColumn('is_approve'); + }); + } +}; diff --git a/packages/marvel/database/migrations/2023_12_12_162216_create_became_sellers_table.php b/packages/marvel/database/migrations/2023_12_12_162216_create_became_sellers_table.php new file mode 100644 index 0000000..7248287 --- /dev/null +++ b/packages/marvel/database/migrations/2023_12_12_162216_create_became_sellers_table.php @@ -0,0 +1,29 @@ +id(); + $table->json('page_options'); + $table->string('language')->unique()->default(DEFAULT_LANGUAGE); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('became_sellers'); + } +}; diff --git a/packages/marvel/database/migrations/2024_01_02_063637_create_transfer_history_table.php b/packages/marvel/database/migrations/2024_01_02_063637_create_transfer_history_table.php new file mode 100644 index 0000000..bfe48d9 --- /dev/null +++ b/packages/marvel/database/migrations/2024_01_02_063637_create_transfer_history_table.php @@ -0,0 +1,45 @@ +id(); + $table->string('transaction_identifier', 50); + $table->foreignId('from')->constrained('users', 'id')->cascadeOnDelete(); + $table->foreignId('shop_id')->constrained('shops', 'id')->cascadeOnDelete(); + $table->foreignId('to')->constrained('users', 'id')->cascadeOnDelete(); + $table->text('message')->nullable(); + $table->foreignId('created_by')->constrained('users', 'id')->cascadeOnDelete(); + $table->enum('status', DefaultStatusType::getValues())->default(DefaultStatusType::PENDING); + $table->timestamps(); + $table->softDeletes(); + $table->index(['id', 'transaction_identifier', 'created_at']); + }); + + Schema::table('products', function (Blueprint $table) { + $table->enum('visibility', ProductVisibilityStatus::getValues())->after('status')->default(ProductVisibilityStatus::VISIBILITY_PUBLIC); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('ownership_transfers'); + Schema::table('products', function (Blueprint $table) { + $table->dropColumn('visibility'); + }); + } +}; diff --git a/packages/marvel/database/migrations/2024_02_07_162216_create_commissions_table.php b/packages/marvel/database/migrations/2024_02_07_162216_create_commissions_table.php new file mode 100644 index 0000000..5ba1e8b --- /dev/null +++ b/packages/marvel/database/migrations/2024_02_07_162216_create_commissions_table.php @@ -0,0 +1,42 @@ +id(); + $table->string('level'); + $table->string('sub_level'); + $table->text('description'); + $table->integer('min_balance'); + $table->string('max_balance'); + $table->float('commission'); + $table->json('image')->nullable(); + $table->string('language')->default(DEFAULT_LANGUAGE); + $table->timestamps(); + }); + + Schema::table('balances', function (Blueprint $table) { + $table->boolean('is_custom_commission')->after('current_balance')->default(false); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('commissions'); + Schema::table('balances', function (Blueprint $table) { + $table->dropColumn('is_custom_commission'); + }); + } +}; diff --git a/packages/marvel/license.md b/packages/marvel/license.md new file mode 100644 index 0000000..8a9373d --- /dev/null +++ b/packages/marvel/license.md @@ -0,0 +1,5 @@ +# The license + +Copyright (c) author name + +...Add your license text here... \ No newline at end of file diff --git a/packages/marvel/phpunit.xml b/packages/marvel/phpunit.xml new file mode 100644 index 0000000..ce34605 --- /dev/null +++ b/packages/marvel/phpunit.xml @@ -0,0 +1,22 @@ + + + + + ./tests/ + + + + + src/ + + + diff --git a/packages/marvel/readme.md b/packages/marvel/readme.md new file mode 100644 index 0000000..73c172b --- /dev/null +++ b/packages/marvel/readme.md @@ -0,0 +1,5 @@ +# Marvel + +A complete ecommerce `api` solution with both `REST` and `GraphQL` support. + + diff --git a/packages/marvel/src/Ai/Ai.php b/packages/marvel/src/Ai/Ai.php new file mode 100644 index 0000000..eb1860e --- /dev/null +++ b/packages/marvel/src/Ai/Ai.php @@ -0,0 +1,26 @@ +ai = $ai; + } + + /** + * generateDescription + * + * @param object $request + * @return array + */ + public function generateDescription($request) + { + return $this->ai->generateDescription($request); + } + +} diff --git a/packages/marvel/src/Ai/AiInterface.php b/packages/marvel/src/Ai/AiInterface.php new file mode 100644 index 0000000..c82852c --- /dev/null +++ b/packages/marvel/src/Ai/AiInterface.php @@ -0,0 +1,8 @@ +enable_ai = $settings->options['useAi']; + if (!$this->enable_ai) { + throw new HttpException(400, PLEASE_ENABLE_OPENAI_FROM_THE_SETTINGS); + } + } +} diff --git a/packages/marvel/src/Ai/Openai.php b/packages/marvel/src/Ai/Openai.php new file mode 100644 index 0000000..5e683a7 --- /dev/null +++ b/packages/marvel/src/Ai/Openai.php @@ -0,0 +1,50 @@ +openAiClient = OpenAIClient::client(config('shop.openai.secret_Key')); + parent::__construct(); + } + /** + * createCustomer + * + * @param mixed $request + * @return array + */ + public function generateDescription($request): mixed + { + try { + $response = $this->openAiClient->chat()->create([ + 'model' => 'gpt-3.5-turbo', + 'messages' => [ + [ + 'role' => 'user', 'content' => $request->prompt + ], + ], + ]); + + foreach ($response->choices as $result) { + $result->index; // 0 + $result->message->role; // 'assistant' + $result->message->content; // '\n\nHello there! How can I assist you today?' + $result->finishReason; // 'stop' + } + + return ['status' => 'success', 'result' => $result->message->content]; + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Console/AWSSetupCommand.php b/packages/marvel/src/Console/AWSSetupCommand.php new file mode 100644 index 0000000..937bf9c --- /dev/null +++ b/packages/marvel/src/Console/AWSSetupCommand.php @@ -0,0 +1,161 @@ +CheckENVExistOrNot(); + $reconfigure = ''; + + try { + do { + // Read the current .env content + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + $targetKeys = ['MEDIA_DISK', 'FILESYSTEM_DISK', 'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_DEFAULT_REGION', 'AWS_BUCKET']; // Add the keys you want to display + + $data = $this->existingKeyValueInENV($targetKeys, $envContent); + + info('Please use arrow keys in keyboard for navigation.'); + if (confirm('Do you want to setup AWS config?')) { + $media_disk = text(label: 'Enter media disk', default: $data[0][1]); + $filesystem_disk = text(label: 'Enter filesystem disk', default: $data[1][1]); + $aws_access_key_id = text(label: 'Enter AWS access key ID', default: $data[2][1], required: 'AWS access key ID is required'); + $aws_secret_access_key = text(label: 'Enter AWS secret key', default: $data[3][1], required: 'AWS secret key is required'); + $aws_default_region = text(label: 'Enter AWS default region', default: $data[4][1], required: 'AWS default region is required'); + $aws_bucket = text(label: 'Enter AWS bucket', default: $data[5][1], required: 'Bucket is required'); + + $this->awsTable( + $media_disk, + $filesystem_disk, + $aws_access_key_id, + $aws_secret_access_key, + $aws_default_region, + $aws_bucket, + ); + info('Do you want to update your AWS configuration?'); + info('If yes, your previous AWS configuration will be removed permanently'); + $confirmed = confirm( + label: "Are you sure!", + default: true, + yes: 'Yes, I accept', + no: 'No, I decline', + hint: 'The terms must be accepted to continue.' + ); + + if ($confirmed) { + $envContent = $this->awsDataSetup( + $envContent, + $media_disk, + $filesystem_disk, + $aws_access_key_id, + $aws_secret_access_key, + $aws_default_region, + $aws_bucket, + ); + File::put($envFilePath, $envContent); + info('Congratulations! Your AWS configuration is updated successfully!'); + } else { + info('Your previous data (if any) is kept.'); + } + } + info('If you think there is something wrong in the config, then you can reconfigure it.'); + $reconfigure = confirm('Do you want to reconfigure AWS settings?', false); + + // If the user wants to reconfigure, the loop will continue + } while ($reconfigure); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + } + + private function awsTable( + $media_disk, + $filesystem_disk, + $aws_access_key_id, + $aws_secret_access_key, + $aws_default_region, + $aws_bucket + ) { + info('Please, check your credentials properly'); + table(['Key', 'Value'], [ + ['MEDIA_DISK', $media_disk], + ['FILESYSTEM_DISK', $filesystem_disk], + ['AWS_ACCESS_KEY_ID', $aws_access_key_id], + ['AWS_SECRET_ACCESS_KEY', $aws_secret_access_key], + ['AWS_DEFAULT_REGION', $aws_default_region], + ['AWS_BUCKET', $aws_bucket], + + ]); + } + + // setup mailtrap's key and value in .env file + private function awsDataSetup( + $envContent, + $media_disk, + $filesystem_disk, + $aws_access_key_id, + $aws_secret_access_key, + $aws_default_region, + $aws_bucket + ) { + $envContent = preg_replace( + "/(MEDIA_DISK)=(.*)/", + "$1=$media_disk", + $envContent + ); + $envContent = preg_replace( + "/(FILESYSTEM_DISK)=(.*)/", + "$1=$filesystem_disk", + $envContent + ); + $envContent = preg_replace( + "/(AWS_ACCESS_KEY_ID)=(.*)/", + "$1=$aws_access_key_id", + $envContent + ); + $envContent = preg_replace( + "/(AWS_SECRET_ACCESS_KEY)=(.*)/", + "$1=$aws_secret_access_key", + $envContent + ); + $envContent = preg_replace( + "/(AWS_DEFAULT_REGION)=(.*)/", + "$1=$aws_default_region", + $envContent + ); + $envContent = preg_replace( + "/(AWS_BUCKET)=(.*)/", + "$1=$aws_bucket", + $envContent + ); + return $envContent; + } +} diff --git a/packages/marvel/src/Console/AdminCreateCommand.php b/packages/marvel/src/Console/AdminCreateCommand.php new file mode 100644 index 0000000..c28abdf --- /dev/null +++ b/packages/marvel/src/Console/AdminCreateCommand.php @@ -0,0 +1,93 @@ + $name, + 'email' => $email, + 'password' => $password, + 'confirmPassword' => $confirmPassword, + ], + [ + 'name' => 'required|string', + 'email' => 'required|email|unique:users,email', + 'password' => 'required', + 'confirmPassword' => 'required|same:password', + ] + ); + if ($validator->fails()) { + info('User not created. See error messages below:'); + foreach ($validator->errors()->all() as $error) { + error($error); + } + return; + } + $user = User::create([ + 'name' => $name, + 'email' => $email, + 'password' => Hash::make($password), + ]); + $user->email_verified_at = now()->timestamp; + $user->save(); + $user->givePermissionTo( + [ + UserPermission::SUPER_ADMIN, + UserPermission::STORE_OWNER, + UserPermission::CUSTOMER, + ] + ); + $user->assignRole(UserRole::SUPER_ADMIN); + + info('User Creation Successful!'); + } + } catch (\Exception $e) { + error($e->getMessage()); + } + } +} diff --git a/packages/marvel/src/Console/CopyFilesCommand.php b/packages/marvel/src/Console/CopyFilesCommand.php new file mode 100644 index 0000000..d111f13 --- /dev/null +++ b/packages/marvel/src/Console/CopyFilesCommand.php @@ -0,0 +1,34 @@ +ensureDirectoryExists(resource_path('views/emails')); + + info('Copying resources files...'); + + (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/resources/views/emails', resource_path('views/emails')); + (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/resources/views/pdf', resource_path('views/pdf')); + (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/resources/lang', resource_path('lang')); + + info('Installation Complete'); + } catch (\Exception $e) { + error($e->getMessage()); + } + } +} diff --git a/packages/marvel/src/Console/DatabaseSetupCommand.php b/packages/marvel/src/Console/DatabaseSetupCommand.php new file mode 100644 index 0000000..d23a599 --- /dev/null +++ b/packages/marvel/src/Console/DatabaseSetupCommand.php @@ -0,0 +1,171 @@ +CheckENVExistOrNot(); + $reconfigure = ''; + + try { + do { + // Read the current .env content + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + + $targetKeys = ['DB_CONNECTION', 'DB_HOST', 'DB_PORT', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD']; // Add the keys you want to display + $data = $this->existingKeyValueInENV($targetKeys, $envContent); + + + info('Please use arrow keys in keyboard for navigation.'); + if (confirm('Do you want to setup MySQL database?')) { + $db_host = text(label: 'Enter Database Host Name',default: $data[1][1], required: 'Database host name is required', placeholder: 'E.g. mysql/localhost'); + $number = null; + do { + $db_port = text(label: 'Enter Database Port', default: $data[2][1],required: 'Database port is required', placeholder: 'E.g. 3306'); + + // Validate if the input is a number + if (!is_numeric($db_port)) { + info('Invalid input. Please enter an integer as a port.'); + } else { + $number = $db_port; + } + } while ($number === null); + $db_database = text(label: 'Enter Database Name', default: $data[3][1],required: 'Database name is required'); + $db_username = text(label: 'Enter Database User Name', default: $data[4][1],required: 'Database user name is required'); + $db_password = text(label: 'Enter Database Password', default: $data[5][1], required: 'Database password is required'); + + $this->databaseTable( + // $db_connection, + $db_host, + $db_port, + $db_database, + $db_username, + $db_password, + ); + + $confirmed = confirm( + label: "Are you sure you want to update your database connection?", + default: true, + yes: 'Yes, I accept', + no: 'No, I decline', + hint: 'The terms must be accepted to continue.' + ); + + if ($confirmed) { + $envContent = $this->databaseSetup( + $envContent, + // $db_connection, + $db_host, + $db_port, + $db_database, + $db_username, + $db_password, + ); + + File::put($envFilePath, $envContent); + info('Congratulations! Your database connection updated successfully!'); + } else { + info('Your previous data (if any) is kept.'); + } + } + info('If you think there is something wrong in the config, then you can reconfigure it.'); + $reconfigure = confirm('Do you want to reconfigure database setup?', false); + + // If the user wants to reconfigure, the loop will continue + } while ($reconfigure); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + } + + private function databaseTable( + // $db_connection, + $db_host, + $db_port, + $db_database, + $db_username, + $db_password, + ) { + info('Please, check your credentials properly'); + table(['Key', 'Value'], [ + ['DB_CONNECTION', 'mysql'], + ['DB_HOST', $db_host], + ['DB_PORT', $db_port], + ['DB_DATABASE', $db_database], + ['DB_USERNAME', $db_username], + ['DB_PASSWORD', $db_password], + + ]); + } + + // setup database key and value in .env file + private function databaseSetup( + $envContent, + // $db_connection, + $db_host, + $db_port, + $db_database, + $db_username, + $db_password, + ) { + // $envContent = preg_replace( + // "/(DB_CONNECTION)=(.*)/", + // "$1=$db_connection", + // $envContent + // ); + $envContent = preg_replace( + "/(DB_HOST)=(.*)/", + "$1=$db_host", + $envContent + ); + $envContent = preg_replace( + "/(DB_PORT)=(.*)/", + "$1=$db_port", + $envContent + ); + $envContent = preg_replace( + "/(DB_DATABASE)=(.*)/", + "$1=$db_database", + $envContent + ); + $envContent = preg_replace( + "/(DB_USERNAME)=(.*)/", + "$1=$db_username", + $envContent + ); + $envContent = preg_replace( + "/(DB_PASSWORD)=(.*)/", + "$1=$db_password", + $envContent + ); + return $envContent; + } +} diff --git a/packages/marvel/src/Console/DefaultLanguageSetupCommand.php b/packages/marvel/src/Console/DefaultLanguageSetupCommand.php new file mode 100644 index 0000000..056b74a --- /dev/null +++ b/packages/marvel/src/Console/DefaultLanguageSetupCommand.php @@ -0,0 +1,94 @@ +CheckENVExistOrNot(); + $reconfigure = ''; + try { + + do { + // Read the current .env content + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + + $targetKeys = ['DEFAULT_LANGUAGE']; + $data = $this->existingKeyValueInENV($targetKeys, $envContent); + + info('Please use arrow keys in keyboard for navigation.'); + if (confirm('Do you want to setup default language?')) { + + $default_language = text(label: 'Enter default language',default: $data[0][1], placeholder: 'E.g. en for English', required: 'Default language is required'); + + $this->defaultLanguageTable($default_language); + + $confirmed = confirm( + label: "Are you sure you want to update your default language's value?", + default: true, + yes: 'Yes, I accept', + no: 'No, I decline', + hint: 'The terms must be accepted to continue.' + ); + + if ($confirmed) { + $envContent = preg_replace( + "/(DEFAULT_LANGUAGE)=(.*)/", + "$1=$default_language", + $envContent + ); + + File::put($envFilePath, $envContent); + + info("Congratulations! Your default language's value has been updated successfully."); + } else { + info('Your previous data (if any) is kept.'); + } + } + info('If you think there is something wrong in the config, then you can reconfigure it.'); + $reconfigure = confirm('Do you want to reconfigure default language settings?', false); + + + + // If the user wants to reconfigure, the loop will continue + } while ($reconfigure); + } catch (\Exception $e) { + error($e->getMessage()); + } + } + + private function defaultLanguageTable($default_language) + { + info('Please, check your credentials properly'); + table(['Key', 'Value'], [ + ['DEFAULT_LANGUAGE', $default_language], + ]); + } +} diff --git a/packages/marvel/src/Console/ENVSetupCommand.php b/packages/marvel/src/Console/ENVSetupCommand.php new file mode 100644 index 0000000..7d85350 --- /dev/null +++ b/packages/marvel/src/Console/ENVSetupCommand.php @@ -0,0 +1,108 @@ +argument('key'); + if (!$optionalValue) { + do { + $this->info('Setup Marvel .env file'); + $this->info('Available terminal command. you can use quick access key to run specific command.'); + + table(['The command looks like:'], [ + ['php artisan marvel:env-setup mail'], + ]); + table(['Quick Access Key', 'Details'], [ + ['mail', 'Mail server setup (mailtrap, mailgun, gmail)'], + ['database', 'Setup MySQL database in .env file'], + ['newsletter', 'Mailchimp newsletter setup in .env file'], + ['frontend-connection', 'Frontend URL setup (admin & shop)'], + ['aws', 'AWS (bucket) setup'], + ['default-language', 'Setup default language in .env file'], + ['open-ai', 'Setup OpenAI in .env file'], + ['otp', 'OTP SMS gateway (Twilio or MessageBird) setup in .env file'], + ['queue-connection', 'Setup queue connection in .env file. (e.g. database or sync)'], + ['translation-enable', 'Enable translation settings in .env file (true/false)'], + ['test-mail', 'Send an email for credentials check'], + ]); + + + + info('Or you can choose options'); + + info('Please use arrow keys in keyboard for navigation.'); + + $role = select( + label: 'Select a option do you want to configure in .env file?', + options: [ + 'mail' => 'Mail Server Setup', + 'mail-test' => 'Mail Test', + 'database' => 'Database', + 'aws' => 'AWS (Amazon Web Services)', + 'translation-enable' => 'Translation Enable', + 'default-language' => 'Default Language', + 'queue-connection' => 'Queue Connection', + 'frontend-connection' => 'Frontend Connection (admin/shop)', + 'newsletter' => 'Mailchimp Newsletter', + 'otp' => 'OTP Message System (Twilio/MessageBird)', + 'open-ai' => 'OpenAI', + 'test-mail' => 'Send An Email For Credentials Check', + 'cancel' => 'Cancel' + ], + scroll: 15 + ); + $this->commandOption($role); + } while ($role !== 'cancel'); + } else { + $this->commandOption($optionalValue); + } + + $this->info('Everything is successful. Now clearing all cached...'); + + $this->call('optimize:clear'); + + info('Thank You.'); + } + + private function commandOption($role) + { + if ($role == 'mail') { + $this->call('marvel:mail-setup'); + } elseif ($role == 'database') { + $this->call('marvel:database-setup'); + } elseif ($role == 'mail-test') { + $this->call('marvel:test-mail-send'); + } elseif ($role == 'aws') { + $this->call('marvel:aws-setup'); + } elseif ($role == 'translation-enable') { + $this->call('marvel:translation-enable'); + } elseif ($role == 'default-language') { + $this->call('marvel:default-language-setup'); + } elseif ($role == 'queue-connection') { + $this->call('marvel:queue-setup'); + } elseif ($role == 'frontend-connection') { + $this->call('marvel:frontend-setup'); + } elseif ($role == 'newsletter') { + $this->call('marvel:mailchimp-newsletter'); + } elseif ($role == 'otp') { + $this->call('marvel:otp-gateway-setup'); + } elseif ($role == 'open-ai') { + $this->call('marvel:open-ai-setup'); + } elseif ($role == 'test-mail') { + $this->call('marvel:test-mail-send'); + } else { + $role = false; + } + } +} diff --git a/packages/marvel/src/Console/FrontendSetupCommand.php b/packages/marvel/src/Console/FrontendSetupCommand.php new file mode 100644 index 0000000..65fe8ac --- /dev/null +++ b/packages/marvel/src/Console/FrontendSetupCommand.php @@ -0,0 +1,203 @@ +CheckENVExistOrNot(); + $reconfigure = ''; + try { + + do { + // Read the current .env content + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + + $targetKeys = ['SHOP_URL', 'DASHBOARD_URL']; // Add the keys you want to display + $data = $this->existingKeyValueInENV($targetKeys, $envContent); + + info('Please use arrow keys in keyboard for navigation.'); + if (confirm('Do you want to connect with frontend (shop and admin)?')) { + $shop_url = $this->shopDomain($data); + $admin_url = $this->adminDomain($data); + + $this->dataTable( + $shop_url, + $admin_url + ); + info('Do you want to update your shop and admin URL?'); + info('If yes, your previous URL will be removed permanently'); + $confirmed = confirm( + label: "Are you sure!", + default: true, + yes: 'Yes, I accept', + no: 'No, I decline', + hint: 'The terms must be accepted to continue.' + ); + + if ($confirmed) { + if ($shop_url != '') { + $envContent = preg_replace( + "/(SHOP_URL)=(.*)/", + "$1=$shop_url", + $envContent + ); + } + if ($admin_url != '') { + $envContent = preg_replace( + "/(DASHBOARD_URL)=(.*)/", + "$1=$admin_url", + $envContent + ); + } + + File::put($envFilePath, $envContent); + info('Congratulations! Your URL updated Successfully!'); + } else { + info('Your previous data (if any) is kept.'); + } + } + + info('If you think there is something wrong in the config, then you can reconfigure it.'); + $reconfigure = confirm('Do you want to reconnect with frontend??', false); + + // If the user wants to reconfigure, the loop will continue + } while ($reconfigure); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + } + + private function dataTable($shop_url, $admin_url) + { + if ($shop_url == null && $shop_url == '') { + $shop_url = env('SHOP_URL'); + } + if ($admin_url == null && $admin_url == '') { + $admin_url = env('DASHBOARD_URL'); + } + info('Please, check your credentials properly'); + table(['Key', 'Value'], [ + ['SHOP_URL', $shop_url], + ['DASHBOARD_URL', $admin_url], + ]); + } + + private function previousData($envContent) + { + $targetKeys = ['SHOP_URL', 'DASHBOARD_URL']; // Add the keys you want to display + $keyValuePairs = []; + + foreach ($targetKeys as $targetKey) { + // Search for the key in the content + preg_match("/^$targetKey=(.*)$/m", $envContent, $matches); + + // Check if the key was found + if (isset($matches[1])) { + $value = $matches[1]; + $keyValuePairs[] = [$targetKey, $value]; + } else { + $keyValuePairs[] = [$targetKey, 'Not found']; + } + } + // Display the key-value pairs in a table + if (!empty($keyValuePairs)) { + info('Your existing frontend URL key & value on the .env file right now:'); + table(['Key', 'Value'], $keyValuePairs); + } else { + error('No key-value pairs found in the .env file'); + } + } + + private function shopDomain($data) + { + $shop_url = ''; + $shopUrl = $data[0][1]; + + if ($shopUrl !== null && $shopUrl !== '') { + info('Your existing shop URL key & value on the .env file right now:'); + table(['Key', 'Value'], [['SHOP_URL', $shopUrl]]); + info('You can upgrade shop URL or skip it.'); + do { + $shop_url = text(label: 'Enter shop URL', default: $shopUrl, placeholder: 'E.g. http://domain.com'); + if ($shop_url !== '' && !filter_var($shop_url, FILTER_VALIDATE_URL)) { + $this->error('Invalid URL format. Please enter a valid URL.'); + } else { + break; + } + } while (true); + } else { + info('Your existing shop URL key & value on the .env file right now:'); + table(['Key', 'Value'], [['SHOP_URL', $shopUrl]]); + do { + + $shop_url = text(label: 'Enter SHOP_URL', placeholder: 'E.g. http://domain.com', required: 'SHOP_URL is required'); + if ($shop_url !== '' && !filter_var($shop_url, FILTER_VALIDATE_URL)) { + $this->error('Invalid URL format. Please enter a valid URL.'); + } else { + break; + } + } while (true); + } + return $shop_url; + } + + private function adminDomain($data) + { + $admin_url = ''; + $adminUrl = $data[1][1]; + if ($adminUrl !== null && $adminUrl !== '') { + info('Your existing dashboard URL key & value on the .env file right now:'); + table(['Key', 'Value'], [['DASHBOARD_URL', $adminUrl]]); + info('You can upgrade dashboard URL or skip it.'); + do { + $admin_url = text(label: 'Enter dashboard URL', default: $adminUrl, placeholder: 'E.g. http://domain.com'); + if ($admin_url !== '' && !filter_var($admin_url, FILTER_VALIDATE_URL)) { + $this->error('Invalid URL format. Please enter a valid URL.'); + } else { + break; + } + } while (true); + } else { + info('Your existing dashboard URL key & value on the .env file right now:'); + table(['Key', 'Value'], [['DASHBOARD_URL', $adminUrl]]); + do { + + $admin_url = text(label: 'Enter DASHBOARD_URL', placeholder: 'E.g. http://domain.com', required: 'SHOP_URL is required'); + if ($admin_url !== '' && !filter_var($admin_url, FILTER_VALIDATE_URL)) { + $this->error('Invalid URL format. Please enter a valid URL.'); + } else { + break; + } + } while (true); + } + return $admin_url; + } +} diff --git a/packages/marvel/src/Console/ImportDemoData.php b/packages/marvel/src/Console/ImportDemoData.php new file mode 100644 index 0000000..fb1130a --- /dev/null +++ b/packages/marvel/src/Console/ImportDemoData.php @@ -0,0 +1,203 @@ +copyDirectory(__DIR__ . '/../../stubs/sql/' . config('shop.dummy_data_path'), public_path('sql')); + + info('File copying successful'); + + info('Seeding....'); + + $this->seedDemoData(); + } + public function seedDemoData() + { + $media_path = public_path('sql/media.sql'); + $media_sql = file_get_contents($media_path); + DB::statement($media_sql); + + $attachments_path = public_path('sql/attachments.sql'); + $attachments_sql = file_get_contents($attachments_path); + DB::statement($attachments_sql); + + $permissions_path = public_path('sql/permissions.sql'); + $permissions_sql = file_get_contents($permissions_path); + DB::statement($permissions_sql); + + $roles_path = public_path('sql/roles.sql'); + $roles_sql = file_get_contents($roles_path); + DB::statement($roles_sql); + + $types_path = public_path('sql/types.sql'); + $types_sql = file_get_contents($types_path); + DB::statement($types_sql); + + // For chawkbazar + // $banners_path = public_path('sql/banners.sql'); + // $banners_sql = file_get_contents($banners_path); + // DB::statement($banners_sql); + + $users_path = public_path('sql/users.sql'); + $users_sql = file_get_contents($users_path); + DB::statement($users_sql); + + $user_profiles_path = public_path('sql/user_profiles.sql'); + $user_profiles_sql = file_get_contents($user_profiles_path); + DB::statement($user_profiles_sql); + + $address_path = public_path('sql/address.sql'); + $address_sql = file_get_contents($address_path); + DB::statement($address_sql); + + $model_has_permissions_path = public_path('sql/model_has_permissions.sql'); + $model_has_permissions_sql = file_get_contents($model_has_permissions_path); + DB::statement($model_has_permissions_sql); + + $model_has_roles_path = public_path('sql/model_has_roles.sql'); + $model_has_roles_sql = file_get_contents($model_has_roles_path); + DB::statement($model_has_roles_sql); + + $role_has_permissions_path = public_path('sql/role_has_permissions.sql'); + $role_has_permissions_sql = file_get_contents($role_has_permissions_path); + DB::statement($role_has_permissions_sql); + + $shops_path = public_path('sql/shops.sql'); + $shops_sql = file_get_contents($shops_path); + DB::statement($shops_sql); + + $balances_path = public_path('sql/balances.sql'); + $balances_sql = file_get_contents($balances_path); + DB::statement($balances_sql); + + $attributes_path = public_path('sql/attributes.sql'); + $attributes_sql = file_get_contents($attributes_path); + DB::statement($attributes_sql); + + $attribute_values_path = public_path('sql/attribute_values.sql'); + $attribute_values_sql = file_get_contents($attribute_values_path); + DB::statement($attribute_values_sql); + + $categories_path = public_path('sql/categories.sql'); + $categories_sql = file_get_contents($categories_path); + DB::statement($categories_sql); + + $tags_path = public_path('sql/tags.sql'); + $tags_sql = file_get_contents($tags_path); + DB::statement($tags_sql); + + // Pickbazar only + + if (config('shop.dummy_data_path') !== 'chawkbazar') { + $authors_path = public_path('sql/authors.sql'); + $authors_sql = file_get_contents($authors_path); + DB::statement($authors_sql); + + $manufacturers_path = public_path('sql/manufacturers.sql'); + $manufacturers_sql = file_get_contents($manufacturers_path); + DB::statement($manufacturers_sql); + + $banners_path = public_path('sql/banners.sql'); + $banners_sql = file_get_contents($banners_path); + DB::statement($banners_sql); + } + + + $products_path = public_path('sql/products.sql'); + $products_sql = file_get_contents($products_path); + DB::statement($products_sql); + + $attribute_product_path = public_path('sql/attribute_product.sql'); + $attribute_product_sql = file_get_contents($attribute_product_path); + DB::statement($attribute_product_sql); + + $variation_options_path = public_path('sql/variation_options.sql'); + $variation_options_sql = file_get_contents($variation_options_path); + DB::statement($variation_options_sql); + + $coupons_path = public_path('sql/coupons.sql'); + $coupons_sql = file_get_contents($coupons_path); + DB::statement($coupons_sql); + + // For ChawkBazar + $types_path = public_path('sql/product_tag.sql'); + $types_sql = file_get_contents($types_path); + DB::statement($types_sql); + + $category_product_path = public_path('sql/category_product.sql'); + $category_product_sql = file_get_contents($category_product_path); + DB::statement($category_product_sql); + + // if (config('shop.dummy_data_path') === 'chawkbazar') { + // $orders_path = public_path('sql/orders.sql'); + // $orders_sql = file_get_contents($orders_path); + // DB::statement($orders_sql); + + // $order_product_path = public_path('sql/order_product.sql'); + // $order_product_sql = file_get_contents($order_product_path); + // DB::statement($order_product_sql); + // } + + // $settings_path = public_path('sql/settings.sql'); + // $settings_sql = file_get_contents($settings_path); + // DB::statement($settings_sql); + + $shipping_classes_path = public_path('sql/shipping_classes.sql'); + $shipping_classes_sql = file_get_contents($shipping_classes_path); + DB::statement($shipping_classes_sql); + + $tax_classes_path = public_path('sql/tax_classes.sql'); + $tax_classes_sql = file_get_contents($tax_classes_path); + DB::statement($tax_classes_sql); + + $withdraws_path = public_path('sql/withdraws.sql'); + $withdraws_sql = file_get_contents($withdraws_path); + DB::statement($withdraws_sql); + + $orders_path = public_path('sql/orders.sql'); + $orders_sql = file_get_contents($orders_path); + DB::statement($orders_sql); + + $order_product_path = public_path('sql/order_product.sql'); + $order_product_sql = file_get_contents($order_product_path); + DB::statement($order_product_sql); + + // $flash_sale_path = public_path('sql/flash_sales.sql'); + // $flash_sale_sql = file_get_contents($flash_sale_path); + // DB::statement($flash_sale_sql); + + // $flash_sale_products_path = public_path('sql/flash_sale_products.sql'); + // $flash_sale_products_sql = file_get_contents($flash_sale_products_path); + // DB::statement($flash_sale_products_sql); + + // $terms_path = public_path('sql/terms_and_conditions.sql'); + // $terms_sql = file_get_contents($terms_path); + // DB::statement($terms_sql); + + $become_seller = public_path('sql/became_sellers.sql'); + $become_seller_sql = file_get_contents($become_seller); + DB::statement($become_seller_sql); + + $commissions = public_path('sql/commissions.sql'); + $commissions_sql = file_get_contents($commissions); + DB::statement($commissions_sql); + + info('Seed completed successfully!'); + } +} diff --git a/packages/marvel/src/Console/InstallCommand.php b/packages/marvel/src/Console/InstallCommand.php new file mode 100644 index 0000000..8cbd63b --- /dev/null +++ b/packages/marvel/src/Console/InstallCommand.php @@ -0,0 +1,205 @@ +verification = new MarvelVerification(); + $shouldGetLicenseKeyFromUser = $this->shouldGetLicenseKey(); + if ($shouldGetLicenseKeyFromUser) { + $this->getLicenseKey(); + $description = $this->appData['description'] ?? ''; + $this->components->info("Thank you for using " . APP_NOTICE_DOMAIN . ". $description"); + } else { + $this->appData = $this->verification->jsonSerialize(); + } + + info('Installing Marvel Dependencies...'); + info('Do you want to migrate Tables?'); + info('If you have already run this command or migrated tables then be aware.'); + info('Tt will erase all of your data.'); + + info('Please use arrow key for navigation.'); + if (confirm('Are you sure!')) { + + info('Migrating Tables Now....'); + + $this->call('migrate:fresh'); + + info('Tables Migration completed.'); + + if (confirm('Do you want to seed dummy data?')) { + $this->call('marvel:seed'); + $this->call('db:seed', [ + '--class' => MarvelSeeder::class + ]); + } + + info('Importing required settings...'); + + $this->call( + 'db:seed', + [ + '--class' => '\\Marvel\\Database\\Seeders\\SettingsSeeder', + ] + + ); + + info('Settings import is completed.'); + } else { + info('Do you want to seed dummy Settings data?'); + info('If "yes", then please follow next steps carefully.'); + if (confirm('Are you sure!')) { + $this->call('marvel:settings-seed'); + } + } + + app()[\Spatie\Permission\PermissionRegistrar::class]->forgetCachedPermissions(); + + Permission::firstOrCreate(['name' => UserPermission::SUPER_ADMIN]); + Permission::firstOrCreate(['name' => UserPermission::CUSTOMER]); + Permission::firstOrCreate(['name' => UserPermission::STORE_OWNER]); + Permission::firstOrCreate(['name' => UserPermission::STAFF]); + + $superAdminPermissions = [UserPermission::SUPER_ADMIN, UserPermission::STORE_OWNER, UserPermission::CUSTOMER]; + $storeOwnerPermissions = [UserPermission::STORE_OWNER, UserPermission::CUSTOMER]; + $staffPermissions = [UserPermission::STAFF, UserPermission::CUSTOMER]; + $customerPermissions = [UserPermission::CUSTOMER]; + + Role::firstOrCreate(['name' => UserRole::SUPER_ADMIN])->syncPermissions($superAdminPermissions); + Role::firstOrCreate(['name' => UserRole::STORE_OWNER])->syncPermissions($storeOwnerPermissions); + Role::firstOrCreate(['name' => UserRole::STAFF])->syncPermissions($staffPermissions); + Role::firstOrCreate(['name' => UserRole::CUSTOMER])->syncPermissions($customerPermissions); + + $this->call('marvel:create-admin'); // creating Admin + + $this->call('marvel:copy-files'); + + $this->modifySettingsData(); + + info('You need to configure your mail server for proper application performance.'); + info('Do you want to configure mail server.'); + $confirmed = confirm( + label: "Are you sure!", + default: true, + yes: 'Yes, I accept', + no: 'No, I decline', + ); + if ($confirmed) { + $this->call('marvel:mail-setup'); + } else { + info('You can configuration by below command or manual process.'); + table(['Command', 'Details'], [['marvel:mail-setup', 'Mail setup (mailtrap, mailgun, gmail)']]); + } + + info('Everything is successful. Now clearing all cached...'); + $this->call('optimize:clear'); + info('Thank You.'); + } + + + private function createDatabase(): void + { + $databaseName = config('database.connections.mysql.database'); + $servername = config('database.connections.mysql.host'); + $username = config('database.connections.mysql.username'); + $password = config('database.connections.mysql.password'); + + try { + $conn = new PDO("mysql:host=$servername", $username, $password); + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + // Check if the database exists + $query = "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '$databaseName'"; + $stmt = $conn->query($query); + $databaseExists = $stmt->fetch(PDO::FETCH_ASSOC); + + if (!$databaseExists) { + // Create the database + $createDatabaseQuery = "CREATE DATABASE $databaseName"; + $conn->exec($createDatabaseQuery); + info("Database $databaseName created successfully."); + } + // else { + // $this->info("Database $databaseName already exists."); + // } + } catch (PDOException $e) { + info("Connection failed: " . $e->getMessage()); + } + } + + private function getLicenseKey($count = 0) + { + $message = 'Kindly enter a valid License Key or visit https://redq.io/pickbazar-laravel-ecommerce for a legitimate license key'; + if ($count < 1) { + $message = 'Please Enter Your License Key.'; + } + $licenseKey = text($message); + $isValid = $this->licenseKeyValidator($licenseKey); + if (!$isValid) { + ++$count; + error("Invalid Licensing Key"); + $this->getLicenseKey($count); + } + return $isValid; + } + + private function licenseKeyValidator(string $licenseKey): bool + { + $verification = $this->verification->verify($licenseKey); + $this->appData = $verification->jsonSerialize(); + return $verification->getTrust(); + } + + + + private function shouldGetLicenseKey() + { + $trust = empty($this->verification->getTrust()); + $env = config("app.env"); + if ($env == "production") { + return true; + } elseif ($env == "local" && $trust) { + return true; + } elseif ($env == "development" && $trust) { + return true; + } + return false; + } + + private function modifySettingsData(): void + { + + $language = isset(request()['language']) ? request()['language'] : DEFAULT_LANGUAGE; + Cache::flush(); + $settings = Settings::getData($language); + $settings->update([ + 'options' => [ + ...$settings->options, + 'app_settings' => [ + 'last_checking_time' => $this->appData['last_checking_time'], + 'trust' => $this->appData['trust'], + ] + ] + ]); + } +} diff --git a/packages/marvel/src/Console/MailSetupCommand.php b/packages/marvel/src/Console/MailSetupCommand.php new file mode 100644 index 0000000..fd966a5 --- /dev/null +++ b/packages/marvel/src/Console/MailSetupCommand.php @@ -0,0 +1,407 @@ +checkExistingConfig($envContent); + + + info('Please use arrow keys in keyboard for navigation.'); + if (confirm('Do you want to setup your mail server?')) { + + info("We provide 'mailtrap', 'mailgun' & 'gmail' config by command line."); + info("If you want to setup any other mail service, then you need to setup manually."); + + $role = select( + 'Which mail server do you want to configure in .env file?', + ['mailtrap', 'mailgun', 'gmail'], + ); + + $mail_host = text(label: 'Enter mail host', default: $data[1][1], required: 'Mail host is required'); + $number = null; + do { + $mail_port = text('Enter port', default: $data[2][1], required: 'Port is required'); + + // Validate if the input is a number + if (!is_numeric($mail_port)) { + info('Invalid input. Please enter an integer as a port.'); + } else { + $number = $mail_port; + } + } while ($number === null); + // $mail_port = number(label: 'Enter port', required: 'Port is required'); + $mail_username = text(label: 'Enter username', default: $data[3][1], required: 'Username is required'); + $mail_password = text(label: 'Enter password', default: $data[4][1],required: 'Password is required'); + $mail_from_address = text('Enter mail from address', default: $data[5][1],); + + // Manually validate the email input + do { + $admin_email = text('Enter Admin Email', default: $data[6][1]); + if (!filter_var($admin_email, FILTER_VALIDATE_EMAIL)) { + info('Invalid email address format. Please enter a valid email.'); + } else { + // Break out of the loop if the email is valid + break; + } + } while (true); + + if ($role == 'mailtrap') { + $this->mailtrapTable( + $mail_port, + $mail_host, + $mail_username, + $mail_password, + $mail_from_address, + $admin_email + + ); + } + + if ($role == 'mailgun') { + $mailgun_domain = text('Enter mailgun domain', default: $data[7][1] ?? '',); + $mailgun_secret = text('Enter mailgun secret key', default: $data[8][1] ?? ''); + + $this->mailgunTable( + $mail_port, + $mail_host, + $mail_username, + $mail_password, + $mailgun_domain, + $mailgun_secret, + $mail_from_address, + $admin_email + ); + } + + if ($role == 'gmail') { + $this->gmailTable( + $mail_port, + $mail_host, + $mail_username, + $mail_password, + $mail_from_address, + $admin_email + ); + } + + info('Do you want to update your mail server configuration?'); + info('If yes, your previous mail server configuration will be removed permanently.'); + $confirmed = confirm( + label: "Are you sure!", + default: true, + yes: 'Yes, I accept', + no: 'No, I decline', + hint: 'The terms must be accepted to continue.' + ); + + if ($confirmed) { + $envContent = $this->remove_existing_env_key($envContent); + + // setup mailtrap's key and value in .env file + if ($role == 'mailtrap') { + $envContent = $this->mailtrapDataSetup( + $envContent, + $mail_port, + $mail_host, + $mail_username, + $mail_password, + $mail_from_address, + $admin_email + ); + } + // setup mailgun's key and value in .env file + if ($role == 'mailgun') { + $envContent = $this->mailgunDataSetup( + $envContent, + $mail_port, + $mail_host, + $mail_username, + $mail_password, + $mailgun_domain, + $mailgun_secret, + $mail_from_address, + $admin_email + ); + } + + // setup gmail's key and value in .env file + if ($role == 'gmail') { + $envContent = $this->gmailDataSetup( + $envContent, + $mail_port, + $mail_host, + $mail_username, + $mail_password, + $mail_from_address, + $admin_email + ); + } + + File::put($envFilePath, $envContent); + + info('Congratulations! Your mail server configuration updated successfully!'); + } else { + info('Your previous data (if any) is kept.'); + } + } + info('If you think there is something wrong in the config, then you can reconfigure it.'); + $reconfigure = confirm('Do you want to reconfigure mail settings?', false); + + + // If the user wants to reconfigure, the loop will continue + } while ($reconfigure); + info('If you want to test your mail configuration, then you can run this command'); + table(['Command', 'Details'], [['marvel:test-mail-send', 'It will send a test mail']]); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + } + + private function mailtrapTable($mail_port, $mail_host, $mail_username, $mail_password, $mail_from_address, $admin_email) + { + info('Please, check your credentials properly'); + table(['Key', 'Value'], [ + ['MAIL_MAILER', 'smtp'], + ['MAIL_HOST', $mail_host], + ['MAIL_PORT', $mail_port], + ['MAIL_USERNAME', $mail_username], + ['MAIL_PASSWORD', $mail_password], + ['MAIL_FROM_ADDRESS', $mail_from_address], + ['ADMIN_EMAIL', $admin_email] + + ]); + } + private function mailgunTable( + $mail_port, + $mail_host, + $mail_username, + $mail_password, + $mailgun_domain, + $mailgun_secret, + $mail_from_address, + $admin_email + ) { + info('Please, check your credentials properly'); + table(['Key', 'Value'], [ + ['MAIL_MAILER', 'mailgun'], + ['MAIL_HOST', $mail_host], + ['MAIL_PORT', $mail_port], + ['MAIL_USERNAME', $mail_username], + ['MAIL_PASSWORD', $mail_password], + ['MAIL_FROM_ADDRESS', $mail_from_address], + ['ADMIN_EMAIL', $admin_email], + ['MAILGUN_DOMAIN', $mailgun_domain], + ['MAILGUN_SECRET', $mailgun_secret], + ['MAIL_ENCRYPTION', 'tls'], + ]); + } + private function gmailTable($mail_port, $mail_host, $mail_username, $mail_password, $mail_from_address, $admin_email) + { + info('Please check your credentials carefully.'); + table(['Key', 'Value'], [ + ['MAIL_MAILER', 'smtp'], + ['MAIL_HOST', $mail_host], + ['MAIL_PORT', $mail_port], + ['MAIL_USERNAME', $mail_username], + ['MAIL_PASSWORD', $mail_password], + ['MAIL_FROM_ADDRESS', $mail_from_address], + ['ADMIN_EMAIL', $admin_email] + ]); + } + + // setup mailtrap's key and value in .env file + private function mailtrapDataSetup($envContent, $mail_port, $mail_host, $mail_username, $mail_password, $mail_from_address, $admin_email) + { + $key = "# Email"; + $data = [ + "MAIL_MAILER=smtp ", + "MAIL_HOST={$mail_host}", + "MAIL_PORT={$mail_port}", + "MAIL_USERNAME={$mail_username}", + "MAIL_PASSWORD={$mail_password}", + "MAIL_FROM_ADDRESS={$mail_from_address}", + "ADMIN_EMAIL={$admin_email}", + ]; + $envContent = $this->insertDataAfterKey($envContent, $key, $data); + return $envContent; + } + + // setup mailgun's key and value in .env file + private function mailgunDataSetup($envContent, $mail_port, $mail_host, $mail_username, $mail_password, $mailgun_domain, $mailgun_secret, $mail_from_address, $admin_email) + { + $key = "# Email"; + $data = [ + "MAIL_MAILER=mailgun ", + "MAIL_HOST={$mail_host}", + "MAIL_PORT={$mail_port}", + "MAIL_USERNAME={$mail_username}", + "MAIL_PASSWORD={$mail_password}", + "MAILGUN_DOMAIN={$mailgun_domain}", + "MAILGUN_SECRET={$mailgun_secret}", + "MAIL_FROM_ADDRESS={$mail_from_address}", + "MAIL_ENCRYPTION=tls", + "ADMIN_EMAIL={$admin_email}", + ]; + $envContent = $this->insertDataAfterKey($envContent, $key, $data); + return $envContent; + } + // setup gmail's key and value in .env file + private function gmailDataSetup($envContent, $mail_port, $mail_host, $mail_username, $mail_password, $admin_email, $mail_from_address) + { + $key = "# Email"; + $data = [ + "MAIL_MAILER=smtp", + "MAIL_HOST={$mail_host}", + "MAIL_PORT={$mail_port}", + "MAIL_USERNAME={$mail_username}", + "MAIL_PASSWORD={$mail_password}", + "MAIL_ENCRYPTION=tls", + "MAIL_FROM_ADDRESS={$mail_from_address}", + "ADMIN_EMAIL={$admin_email}", + ]; + $envContent = $this->insertDataAfterKey($envContent, $key, $data); + return $envContent; + } + + private function remove_existing_env_key($envContent) + { + $keysToRemove = [ + 'MAIL_MAILER', + 'MAIL_HOST', + 'MAIL_PORT', + 'MAIL_USERNAME', + 'MAIL_PASSWORD', + 'MAILGUN_DOMAIN', + 'MAILGUN_SECRET', + 'MAIL_FROM_ADDRESS', + 'MAIL_ENCRYPTION', + 'ADMIN_EMAIL', + ]; + + foreach ($keysToRemove as $key) { + $envContent = preg_replace("/^\s*$key\s*=\s*.*$/m", '', $envContent); + } + return $envContent; + } + private function insertDataAfterKey($envContent, $key, $data) + { + // Split the content into lines + $lines = explode("\n", $envContent); + + // Find the position of the key + $position = false; + foreach ($lines as $index => $line) { + // Check for the key, considering both commented and uncommented keys + if (strpos($line, $key) !== false) { + $position = $index; + break; + } + } + + // If the key is found, insert data after it + if ($position !== false) { + // Check if the next line is empty, and remove it if necessary + if (isset($lines[$position + 1]) && empty(trim($lines[$position + 1]))) { + unset($lines[$position + 1]); + } + + // Insert the new data + array_splice($lines, $position + 1, 0, $data); + } else { + // Key not found, insert data at the end + $lines = array_merge($lines, $data); + } + + // Trim each line to remove leading and trailing whitespace + $lines = array_map('trim', $lines); + + // Rebuild the content and remove extra newline characters + $envContent = implode("\n", $lines); + $envContent = preg_replace("/^\n+/", '', $envContent); + + return $envContent; + } + + protected function sendEmail() + { + $to = 'recipient@example.com'; + $subject = 'Mail Configuration Completed'; + $message = 'Your mail configuration has been successfully completed.'; + + Mail::raw($message, function ($mail) use ($to, $subject) { + $mail->to($to)->subject($subject); + }); + } + protected function checkExistingConfig($envContent) + { + $targetKeys = [ + "MAIL_MAILER", + "MAIL_HOST", + "MAIL_PORT", + "MAIL_USERNAME", + "MAIL_PASSWORD", + "MAIL_FROM_ADDRESS", + "ADMIN_EMAIL", + "MAILGUN_DOMAIN", + "MAILGUN_SECRET", + "MAIL_ENCRYPTION", + ]; // Add the keys you want to display + + $keyValuePairs = []; + foreach ($targetKeys as $targetKey) { + // Search for the key in the content + preg_match("/^$targetKey=(.*)$/m", $envContent, $matches); + + // Check if the key was found + if (isset($matches[1])) { + $value = $matches[1]; + if ($value !== null) { + $keyValuePairs[] = [$targetKey, $value]; + } + } + } + + // Display the key-value pairs in a table + if (!empty($keyValuePairs)) { + info('Your existing key & value on the .env file right now:'); + table(['Key', 'Value'], $keyValuePairs); + } else { + $this->error('No key-value pairs found in the .env file'); + } + return $keyValuePairs; + } +} diff --git a/packages/marvel/src/Console/MailchimpNewsletterSetupCommand.php b/packages/marvel/src/Console/MailchimpNewsletterSetupCommand.php new file mode 100644 index 0000000..8db8702 --- /dev/null +++ b/packages/marvel/src/Console/MailchimpNewsletterSetupCommand.php @@ -0,0 +1,108 @@ +CheckENVExistOrNot(); + $reconfigure = ''; + try { + + do { + // Read the current .env content + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + $targetKeys = ['NEWSLETTER_API_KEY', 'NEWSLETTER_LIST_ID']; // Add the keys you want to display + $data = $this->existingKeyValueInENV($targetKeys, $envContent); + + info('Please use arrow keys in keyboard for navigation.'); + if (confirm('Do you want to setup mailchimp newsletter?')) { + $newsletter_api_key = text('Enter newsletter api key', default: $data[0][1], required: 'Newsletter api key is required'); + $newsletter_list_id = text('Enter newsletter list ID', default: $data[1][1], required: 'newsletter list ID required'); + + $this->newsletterTable( + $newsletter_api_key, + $newsletter_list_id + ); + + $confirmed = confirm( + label: "Are you sure you want to update your Mailchimp newsletter configuration?", + default: true, + yes: 'Yes, I accept', + no: 'No, I decline', + hint: 'The terms must be accepted to continue.' + ); + + if ($confirmed) { + + $envContent = $this->newsletterDataSetup( + $envContent, + $newsletter_api_key, + $newsletter_list_id + ); + + + File::put($envFilePath, $envContent); + info('Congratulations! Your mailchimp newsletter configuration updated Successfully!'); + } else { + info('Your previous data (if any) is kept.'); + } + } + info('If you think there is something wrong in the config, then you can reconfigure it.'); + $reconfigure = confirm('Do you want to reconfigure mailchimp newsletter settings?', false); + + // If the user wants to reconfigure, the loop will continue + } while ($reconfigure); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + } + + private function newsletterTable( + $newsletter_api_key, + $newsletter_list_id + ) { + info('Please, check your credentials properly'); + table(['Key', 'Value'], [ + ['NEWSLETTER_API_KEY', $newsletter_api_key], + ['NEWSLETTER_LIST_ID', $newsletter_list_id] + ]); + } + + private function newsletterDataSetup( + $envContent, + $newsletter_api_key, + $newsletter_list_id + ) { + $envContent = preg_replace("/(NEWSLETTER_API_KEY)=(.*)/", "$1=$newsletter_api_key", $envContent); + $envContent = preg_replace("/(NEWSLETTER_LIST_ID)=(.*)/", "$1=$newsletter_list_id", $envContent); + return $envContent; + } +} diff --git a/packages/marvel/src/Console/MarvelInfoCommand.php b/packages/marvel/src/Console/MarvelInfoCommand.php new file mode 100644 index 0000000..3fd921c --- /dev/null +++ b/packages/marvel/src/Console/MarvelInfoCommand.php @@ -0,0 +1,90 @@ +CheckENVExistOrNot(); + try { + // Read the current .env content + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + $targetKeys = ['APP_NAME','APP_ENV','APP_DEBUG','APP_URL','APP_VERSION','APP_SERVICE','APP_NOTICE_DOMAIN','DUMMY_DATA_PATH']; // Add the keys you want to display + info('Basic application information.'); + $this->existingKeyValueInENV($targetKeys, $envContent); + + + info('Available Marvel Command'); + + table(['Command', 'Details'], [ + ['marvel:install', 'Installing Marvel application'], + ['marvel:env-setup', 'Setup necessary config in .env file'], + ['marvel:database-setup', 'Setup MySQL database in .env file'], + ['marvel:mail-setup', 'Mail server setup (mailtrap, mailgun, gmail)'], + ['marvel:mailchimp-newsletter', 'Mailchimp newsletter setup in .env file'], + ['marvel:frontend-setup', 'Frontend URL setup (admin & shop)'], + ['marvel:aws-setup', 'AWS (bucket) setup'], + ['marvel:create-admin', 'Create an admin user'], + ['marvel:default-language-setup', 'Setup default language in .env file'], + ['marvel:open-ai-setup', 'Setup OpenAI in .env file'], + ['marvel:otp-gateway-setup', 'OTP SMS gateway (Twilio or MessageBird) setup in .env file'], + ['marvel:queue-setup', 'Setup queue connection in .env file. (e.g. database or sync)'], + ['marvel:seed', 'Import Demo Data'], + ['marvel:settings-seed', 'Import Settings Data'], + ['marvel:translation-enable', 'Enable translation settings in .env file (true/false)'], + ['marvel:test-mail-send', 'Send an email for credentials check'], + ]); + + $this->info("'marvel:env-setup' command has some Quick Access Key"); + + table(['Quick Access Key', 'Details'], [ + ['mail', 'Mail server setup (mailtrap, mailgun, gmail)'], + ['database', 'Setup MySQL database in .env file'], + ['newsletter', 'Mailchimp newsletter setup in .env file'], + ['frontend-connection', 'Frontend URL setup (admin & shop)'], + ['aws', 'AWS (bucket) setup'], + ['default-language', 'Setup default language in .env file'], + ['open-ai', 'Setup OpenAI in .env file'], + ['otp', 'OTP SMS gateway (Twilio or MessageBird) setup in .env file'], + ['queue-connection', 'Setup queue connection in .env file. (e.g. database or sync)'], + ['translation-enable', 'Enable translation settings in .env file (true/false)'], + ['test-mail', 'Send an email for credentials check'], + ]); + + + table(['The command looks like:'], [ + ['marvel:env-setup mail'], + ]); + + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + } +} diff --git a/packages/marvel/src/Console/MarvelVerification.php b/packages/marvel/src/Console/MarvelVerification.php new file mode 100644 index 0000000..97ddcb7 --- /dev/null +++ b/packages/marvel/src/Console/MarvelVerification.php @@ -0,0 +1,139 @@ +verify($pkey); + } else { + $config = $this->getConfig(); + $this->mapConfigToProperties($config); + } + } + + public function getPrivateKey(): string + { + return $this->pkey; + } + + public function getTrust(): bool + { + return $this->trust; + } + + public function getDomains(): array + { + return $this->domains; + } + public function getDescription(): string + { + return $this->description; + } + public function getLastCheckingTime(): Carbon | string + { + return Carbon::parse($this->lastCheckingTime); + } + + public function jsonSerialize(): mixed + { + return [ + 'p_key' => $this->getPrivateKey(), + 'trust' => $this->getTrust(), + 'domains' => $this->getDomains(), + 'description' => $this->getDescription(), + 'last_checking_time' => $this->getLastCheckingTime(), + ]; + } + + public function verify(string $code): MarvelVerification + { + $this->pkey = $code; + $this->trust = true; + $this->domains = []; + $this->description = 'nulled'; + $this->lastCheckingTime = now(); + + $this->setConfig($this->jsonSerialize()); + + return $this; + } + + public function modifySettingsData($language = DEFAULT_LANGUAGE): void + { + Cache::flush(); + $settings = Settings::getData($language); + $settings->update([ + 'options' => [ + ...$settings->options, + 'app_settings' => [ + 'trust' => $this->trust, + 'last_checking_time' => $this->lastCheckingTime, + ] + ] + ]); + } + + private function setConfig($config): void + { + try { + if (empty(env('APP_KEY'))) { + Artisan::call('key:generate'); + } + $stringifyConfig = json_encode($config, JSON_PRETTY_PRINT); + $encryptedConfig = Crypt::encrypt($stringifyConfig); + $fileLocation = storage_path('app/shop/shop.config.json'); + file_put_contents($fileLocation, $encryptedConfig); + } catch (Exception $e) { + // Handle exception if needed + } + } + + private function mapConfigToProperties($config): MarvelVerification + { + $this->pkey = $config['p_key'] ?? ''; + $this->trust = $config['trust'] ?? false; + $this->domains = $config['domains'] ?? []; + $this->description = $config['description'] ?? ''; + $this->lastCheckingTime = $config['last_checking_time'] ?? now(); + return $this; + } + + private function getConfig(): array + { + $config = []; + try { + $folderPath = storage_path('app/shop/'); + if (!File::exists($folderPath)) { + File::makeDirectory($folderPath, 0777, true, true); + } + + $fileName = $folderPath . "shop.config.json"; + if (file_exists($fileName)) { + $json_data = file_get_contents($fileName); + $data = Crypt::decrypt($json_data); + $config = json_decode($data, true); + } + } catch (Exception $e) { + } + return $config; + } +} diff --git a/packages/marvel/src/Console/OTPGatewaySetupCommand.php b/packages/marvel/src/Console/OTPGatewaySetupCommand.php new file mode 100644 index 0000000..57600b5 --- /dev/null +++ b/packages/marvel/src/Console/OTPGatewaySetupCommand.php @@ -0,0 +1,188 @@ +CheckENVExistOrNot(); + $reconfigure = ''; + $messagebird_originator = ''; + try { + do { + // Read the current .env content + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + + // $existing_OTP_system = env('ACTIVE_OTP_GATEWAY'); + $targetKey = 'ACTIVE_OTP_GATEWAY'; + preg_match("/^$targetKey=(.*)$/m", $envContent, $matches); + $value = $matches[1]; + + if ($value == 'twilio') { + $targetKeys = ['ACTIVE_OTP_GATEWAY', 'TWILIO_AUTH_TOKEN', 'TWILIO_ACCOUNT_SID', 'TWILIO_VERIFICATION_SID', 'TWILIO_FROM_NUMBER']; // Add the keys you want to display + $twilio = $this->existingKeyValueInENV($targetKeys, $envContent); + } else { + $targetKeys = ['ACTIVE_OTP_GATEWAY', 'MESSAGEBIRD_API_KEY', 'MESSAGEBIRD_ORIGINATOR']; // Add the keys you want to display + $data = $this->existingKeyValueInENV($targetKeys, $envContent); + } + + info('Please use arrow keys in keyboard for navigation.'); + + if (confirm('Do you want to setup OTP SMS gateway?')) { + $role = select( + 'Which OTP SMS gateway you want to configure in .env file?', + ['twilio', 'MessageBird'], + ); + + if ($role == 'twilio') { + $targetKeys = ['ACTIVE_OTP_GATEWAY', 'TWILIO_AUTH_TOKEN', 'TWILIO_ACCOUNT_SID', 'TWILIO_VERIFICATION_SID', 'TWILIO_FROM_NUMBER']; // Add the keys you want to display + $twilio = $this->existingKeyValueInENV($targetKeys, $envContent); + $twilio_auth_token = text('Enter Twilio auth token', default: $twilio[1][1], required: 'Twilio auth token is required'); + $twilio_account_sid = text('Enter twilio account SID', default: $twilio[2][1], required: 'Twilio account SID is required'); + $twilio_verification_sid = text('Enter twilio verification SID', default: $twilio[3][1], required: 'Twilio verification SID is required'); + $twilio_from_number = text('Enter twilio from number', default: $twilio[4][1]); + + $this->twilioTable( + $twilio_auth_token, + $twilio_account_sid, + $twilio_verification_sid, + $twilio_from_number + ); + } + + if ($role == 'MessageBird') { + $targetKeys = ['ACTIVE_OTP_GATEWAY', 'MESSAGEBIRD_API_KEY', 'MESSAGEBIRD_ORIGINATOR']; // Add the keys you want to display + $data = $this->existingKeyValueInENV($targetKeys, $envContent); + $messagebird_api_key = text('Enter MessageBird api key', default: $data[1][1], required: 'Port is MessageBird api key'); + $messagebird_originator = text('Enter MessageBird originator', default: $data[2][1],); + + $this->messagebirdTable( + $messagebird_api_key, + $messagebird_originator + ); + } + + $confirmed = confirm( + label: "Are you sure you want to update your OTP SMS gateway configuration?", + default: true, + yes: 'Yes, I accept', + no: 'No, I decline', + hint: 'The terms must be accepted to continue.' + ); + + if ($confirmed) { + + if ($role == 'twilio') { + $envContent = $this->twilioDataSetup( + $envContent, + $twilio_auth_token, + $twilio_account_sid, + $twilio_verification_sid, + $twilio_from_number + ); + } + if ($role == 'MessageBird') { + $envContent = $this->messagebirdDataSetup( + $envContent, + $messagebird_api_key, + $messagebird_originator + ); + } + + File::put($envFilePath, $envContent); + info('Congratulations! Your OTP SMS gateway configuration updated Successfully!'); + } else { + info('Your previous data (if any) is kept.'); + } + } + + info('If you think there is something wrong in the config, then you can reconfigure it.'); + $reconfigure = confirm('Do you want to reconfigure OTP SMS gateway settings?', false); + + // If the user wants to reconfigure, the loop will continue + } while ($reconfigure); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + } + + private function twilioTable( + $twilio_auth_token, + $twilio_account_sid, + $twilio_verification_sid, + $twilio_from_number + ) { + info('Please, check your credentials properly'); + table(['Key', 'Value'], [ + ['ACTIVE_OTP_GATEWAY', 'twilio'], + ['TWILIO_AUTH_TOKEN', $twilio_auth_token], + ['TWILIO_ACCOUNT_SID', $twilio_account_sid], + ['TWILIO_VERIFICATION_SID', $twilio_verification_sid], + ['TWILIO_FROM_NUMBER', $twilio_from_number] + ]); + } + private function messagebirdTable($messagebird_api_key, $messagebird_originator) + { + info('Please check your credentials carefully.'); + table(['Key', 'Value'], [ + ['ACTIVE_OTP_GATEWAY', 'messagebird'], + ['MESSAGEBIRD_API_KEY', $messagebird_api_key], + ['MESSAGEBIRD_ORIGINATOR', $messagebird_originator] + ]); + } + + // setup mailtrap's key and value in .env file + private function twilioDataSetup( + $envContent, + $twilio_auth_token, + $twilio_account_sid, + $twilio_verification_sid, + $twilio_from_number + ) { + $envContent = preg_replace("/(ACTIVE_OTP_GATEWAY)=(.*)/", "$1=twilio", $envContent); + $envContent = preg_replace("/(TWILIO_AUTH_TOKEN)=(.*)/", "$1=$twilio_auth_token", $envContent); + $envContent = preg_replace("/(TWILIO_ACCOUNT_SID)=(.*)/", "$1=$twilio_account_sid", $envContent); + $envContent = preg_replace("/(TWILIO_VERIFICATION_SID)=(.*)/", "$1=$twilio_verification_sid", $envContent); + $envContent = preg_replace("/(TWILIO_FROM_NUMBER)=(.*)/", "$1=$twilio_from_number", $envContent); + return $envContent; + } + + // setup mailgun's key and value in .env file + private function messagebirdDataSetup($envContent, $messagebird_api_key, $messagebird_originator) + { + $envContent = preg_replace("/(ACTIVE_OTP_GATEWAY)=(.*)/", "$1=messagebird", $envContent); + + $envContent = preg_replace("/(MESSAGEBIRD_API_KEY)=(.*)/", "$1=$messagebird_api_key", $envContent); + + if ($messagebird_originator != '') + $envContent = preg_replace("/(MESSAGEBIRD_ORIGINATOR)=(.*)/", "$1=$messagebird_originator", $envContent); + return $envContent; + } +} diff --git a/packages/marvel/src/Console/OpenAiSetupCommand.php b/packages/marvel/src/Console/OpenAiSetupCommand.php new file mode 100644 index 0000000..187d52d --- /dev/null +++ b/packages/marvel/src/Console/OpenAiSetupCommand.php @@ -0,0 +1,89 @@ +CheckENVExistOrNot(); + $reconfigure = ''; + try { + + do { + // Read the current .env content + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + $targetKeys = ['OPENAI_SECRET_KEY']; // Add the keys you want to display + $data = $this->existingKeyValueInENV($targetKeys, $envContent); + + info('Please use arrow keys in keyboard for navigation.'); + if (confirm('Do you want to setup OpenAI?')) { + $openAi = text(label: 'Enter OpenAI secret key', default: $data[0][1], required: 'OpenAI secret key is required'); + + $this->OpenAiTable($openAi); + + $confirmed = confirm( + label: "Are you sure you want to update your OpenAI secret key?", + default: true, + yes: 'Yes, I accept', + no: 'No, I decline', + hint: 'The terms must be accepted to continue.' + ); + + if ($confirmed) { + $envContent = preg_replace( + "/(OPENAI_SECRET_KEY)=(.*)/", + "$1=$openAi", + $envContent + ); + + File::put($envFilePath, $envContent); + info('Congratulations! Your OpenAI configuration updated successfully!'); + } else { + info('Your previous data (if any) is kept.'); + } + } + info('If you think there is something wrong in the config, then you can reconfigure it.'); + $reconfigure = confirm('Do you want to reconfigure OpenAI secret key?', false); + + // If the user wants to reconfigure, the loop will continue + } while ($reconfigure); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + } + + private function OpenAiTable($openAi) + { + info('Please, check your credentials properly'); + table(['Key', 'Value'], [ + ['OPENAI_SECRET_KEY', $openAi], + ]); + } +} diff --git a/packages/marvel/src/Console/QueueConnectionSetupCommand.php b/packages/marvel/src/Console/QueueConnectionSetupCommand.php new file mode 100644 index 0000000..82c828e --- /dev/null +++ b/packages/marvel/src/Console/QueueConnectionSetupCommand.php @@ -0,0 +1,89 @@ +CheckENVExistOrNot(); + $reconfigure = ''; + try { + do { + // Read the current .env content + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + $targetKeys = ['QUEUE_CONNECTION']; // Add the keys you want to display + $data = $this->existingKeyValueInENV($targetKeys, $envContent); + + info('Please use arrow keys in keyboard for navigation.'); + + if (confirm('Do you want to setup queue connection?')) { + $queue_connection = text(label: 'Enter queue connection value',default: $data[0][1], placeholder: 'E.g. database / sync', required: 'Queue connection value is required'); + + $this->queueConnectionTable($queue_connection); + + $confirmed = confirm( + label: "Are you sure you want to update your queue connection?", + default: true, + yes: 'Yes, I accept', + no: 'No, I decline', + hint: 'The terms must be accepted to continue.' + ); + + if ($confirmed) { + $envContent = preg_replace( + "/(QUEUE_CONNECTION)=(.*)/", + "$1=$queue_connection", + $envContent + ); + + File::put($envFilePath, $envContent); + info('Congratulations! Your queue connection updated Successfully!'); + } else { + info('Your previous data (if any) is kept.'); + } + } + info('If you think there is something wrong in the config, then you can reconfigure it.'); + $reconfigure = confirm('Do you want to reconfigure URL settings?', false); + + // If the user wants to reconfigure, the loop will continue + } while ($reconfigure); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + } + + private function queueConnectionTable($queue_connection) + { + info('Please, check your credentials properly'); + table(['Key', 'Value'], [ + ['QUEUE_CONNECTION', $queue_connection], + ]); + } +} diff --git a/packages/marvel/src/Console/SettingsDataSeed.php b/packages/marvel/src/Console/SettingsDataSeed.php new file mode 100644 index 0000000..d70e73a --- /dev/null +++ b/packages/marvel/src/Console/SettingsDataSeed.php @@ -0,0 +1,89 @@ +verification = new MarvelVerification(); + $shouldGetLicenseKeyFromUser = $this->shouldGetLicenseKey(); + if ($shouldGetLicenseKeyFromUser) { + $this->getLicenseKey(); + $description = $this->appData['description'] ?? ''; + $this->components->info("Thank you for using " . APP_NOTICE_DOMAIN . ". $description"); + } else { + $this->appData = $this->verification->jsonSerialize(); + } + if (DB::table('settings')->where('id', 1)->exists()) { + + if (confirm('Already data exists. Do you want to refresh it with dummy settings?')) { + + info('Seeding necessary settings....'); + + DB::table('settings')->truncate(); + + info('Importing dummy settings...'); + + $this->call('db:seed', [ + '--class' => '\\Marvel\\Database\\Seeders\\SettingsSeeder' + ]); + + $this->verification->modifySettingsData(); + info('Settings were imported successfully'); + } else { + info('Previous settings was kept. Thanks!'); + } + } + } + + private function getLicenseKey($count = 0) + { + $message = 'Please Enter a valid License Key! Please visit us at https://redq.io for a valid license key.'; + if ($count < 1) { + $message = 'Please Enter Your License Key.'; + } + $licenseKey = text(label: $message, required: 'License Key is required'); + $isValid = $this->licenseKeyValidator($licenseKey); + if (!$isValid) { + ++$count; + $description = $this->appData['description'] ?? ''; + $this->components->error("Invalid Licensing Key. $description"); + $this->getLicenseKey($count); + } + return $isValid; + } + + private function licenseKeyValidator(string $licenseKey): bool + { + $verification = $this->verification->verify($licenseKey); + $this->appData = $verification->jsonSerialize(); + return $verification->getTrust(); + } + + + + private function shouldGetLicenseKey() + { + $env = config("app.env"); + if ($env == "production") { + return true; + } elseif ($env == "local" && empty($this->verification->getTrust())) { + return true; + } elseif ($env == "development" && empty($this->verification->getTrust())) { + return true; + } + return false; + } +} diff --git a/packages/marvel/src/Console/TestMailSendCommand.php b/packages/marvel/src/Console/TestMailSendCommand.php new file mode 100644 index 0000000..81c759e --- /dev/null +++ b/packages/marvel/src/Console/TestMailSendCommand.php @@ -0,0 +1,64 @@ +CheckENVExistOrNot(); + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + try { + $this->sendEmail(); + } catch (Exception $e) { + throw new HttpException(400, 'Opsss! Something is wrong in your mail configuration. Please check again.'); + } + } + + protected function sendEmail() + { + $to = env('ADMIN_EMAIL'); + if ($to !== null && $to !== '') { + $subject = 'Mail Configuration Completed'; + $message = 'Your mail configuration has been successfully completed.'; + + Mail::raw($message, function ($mail) use ($to, $subject) { + $mail->to($to)->subject($subject); + }); + + info('An email has sent to your mail. Please check your email'); + } else { + info('admin email missing in your env file!'); + return; + } + } +} diff --git a/packages/marvel/src/Console/TranslationEnabledCommand.php b/packages/marvel/src/Console/TranslationEnabledCommand.php new file mode 100644 index 0000000..753ec1b --- /dev/null +++ b/packages/marvel/src/Console/TranslationEnabledCommand.php @@ -0,0 +1,109 @@ +CheckENVExistOrNot(); + try { + + $reconfigure = ''; + do { // Read the current .env content + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + $targetKeys = ['TRANSLATION_ENABLED']; // Add the keys you want to display + $this->existingKeyValueInENV($targetKeys, $envContent); + + info('Please use arrow keys in keyboard for navigation.'); + if (confirm('Do you want to enable/disable translation?')) { + + // Read the current .env content + $envFilePath = base_path('.env'); + $envContent = File::get($envFilePath); + + $role = select( + 'enable/disable translation in .env file?', + ['Enable', 'Disable'], + ); + + $this->translationEnableTable($role); + $confirmed = confirm( + label: "Are you sure you want to update your translation settings?", + default: true, + yes: 'Yes, I accept', + no: 'No, I decline', + hint: 'The terms must be accepted to continue.' + ); + + if ($confirmed) { + if ($role == 'Enable') { + $envContent = preg_replace( + "/(TRANSLATION_ENABLED)=(.*)/", + "$1=true", + $envContent + ); + } else { + $envContent = preg_replace( + "/(TRANSLATION_ENABLED)=(.*)/", + "$1=false", + $envContent + ); + } + + File::put($envFilePath, $envContent); + info('Congratulations! Your translation settings updated Successfully!'); + } else { + info('Your previous data (if any) is kept.'); + } + } + info('If you think there is something wrong in the config, then you can reconfigure it.'); + $reconfigure = confirm('Do you want to reconfigure translation enable value settings?', false); + + // If the user wants to reconfigure, the loop will continue + } while ($reconfigure); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + } + + private function translationEnableTable($role) + { + info('Please, check your credentials properly'); + if ($role == 'Enable') { + $value = 'true'; + } else { + $value = 'false'; + } + table(['Key', 'Value'], [ + ['TRANSLATION_ENABLED', $value], + + ]); + } +} diff --git a/packages/marvel/src/Database/Models/AbusiveReport.php b/packages/marvel/src/Database/Models/AbusiveReport.php new file mode 100644 index 0000000..df8f822 --- /dev/null +++ b/packages/marvel/src/Database/Models/AbusiveReport.php @@ -0,0 +1,29 @@ +belongsTo(User::class, 'user_id'); + } + + /** + * Get all of the models that own abusive reports. + */ + public function model() + { + return $this->morphTo(); + } +} diff --git a/packages/marvel/src/Database/Models/Address.php b/packages/marvel/src/Database/Models/Address.php new file mode 100644 index 0000000..469e416 --- /dev/null +++ b/packages/marvel/src/Database/Models/Address.php @@ -0,0 +1,26 @@ + 'json', + 'location' => 'json' + ]; + + /** + * @return BelongsTo + */ + public function customer(): BelongsTo + { + return $this->belongsTo(User::class, 'customer_id'); + } +} diff --git a/packages/marvel/src/Database/Models/Attachment.php b/packages/marvel/src/Database/Models/Attachment.php new file mode 100644 index 0000000..a238b69 --- /dev/null +++ b/packages/marvel/src/Database/Models/Attachment.php @@ -0,0 +1,31 @@ +addMediaConversion('thumbnail') + ->width(368) + ->height(232) + ->nonQueued(); + } +} diff --git a/packages/marvel/src/Database/Models/Attribute.php b/packages/marvel/src/Database/Models/Attribute.php new file mode 100644 index 0000000..a50f879 --- /dev/null +++ b/packages/marvel/src/Database/Models/Attribute.php @@ -0,0 +1,60 @@ + [ + 'source' => 'name' + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } + + + /** + * @return HasMany + */ + public function values(): HasMany + { + return $this->hasMany(AttributeValue::class, 'attribute_id'); + } + + /** + * @return BelongsToMany + */ + public function shop(): BelongsTo + { + return $this->belongsTo(Shop::class, 'shop_id'); + } +} diff --git a/packages/marvel/src/Database/Models/AttributeValue.php b/packages/marvel/src/Database/Models/AttributeValue.php new file mode 100644 index 0000000..0b213c7 --- /dev/null +++ b/packages/marvel/src/Database/Models/AttributeValue.php @@ -0,0 +1,58 @@ +where('language', $model->language); + } + + /** + * Return the sluggable configuration array for this model. + * + * @return array + */ + public function sluggable(): array + { + return [ + 'slug' => [ + 'source' => 'value' + ] + ]; + } + + /** + * @return BelongsTo + */ + public function attribute(): BelongsTo + { + return $this->belongsTo(Attribute::class, 'attribute_id'); + } + + + /** + * @return BelongsToMany + */ + public function products(): BelongsToMany + { + return $this->belongsToMany(Product::class, 'attribute_product'); + } +} diff --git a/packages/marvel/src/Database/Models/Author.php b/packages/marvel/src/Database/Models/Author.php new file mode 100644 index 0000000..5195df7 --- /dev/null +++ b/packages/marvel/src/Database/Models/Author.php @@ -0,0 +1,62 @@ + 'json', + 'cover_image' => 'json', + 'socials' => 'json', + ]; + + + + /** + * Return the sluggable configuration array for this model. + * + * @return array + */ + public function sluggable(): array + { + return [ + 'slug' => [ + 'source' => 'name' + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } + + public function getProductsCountAttribute() + { + return $this->products()->count(); + } + + + /** + * @return HasMany + */ + public function products(): HasMany + { + return $this->hasMany(Product::class, 'author_id'); + } +} diff --git a/packages/marvel/src/Database/Models/Availability.php b/packages/marvel/src/Database/Models/Availability.php new file mode 100644 index 0000000..6d88ef1 --- /dev/null +++ b/packages/marvel/src/Database/Models/Availability.php @@ -0,0 +1,16 @@ + 'json', + ]; + + /** + * @return BelongsTo + */ + public function shop(): BelongsTo + { + return $this->belongsTo(Shop::class, 'shop_id'); + } +} diff --git a/packages/marvel/src/Database/Models/Banner.php b/packages/marvel/src/Database/Models/Banner.php new file mode 100644 index 0000000..fc69319 --- /dev/null +++ b/packages/marvel/src/Database/Models/Banner.php @@ -0,0 +1,28 @@ + 'json', + ]; + + + + /** + * @return BelongsTo + */ + public function type(): BelongsTo + { + return $this->belongsTo(Type::class, 'type_id'); + } +} diff --git a/packages/marvel/src/Database/Models/BecameSeller.php b/packages/marvel/src/Database/Models/BecameSeller.php new file mode 100644 index 0000000..16e2764 --- /dev/null +++ b/packages/marvel/src/Database/Models/BecameSeller.php @@ -0,0 +1,27 @@ + 'json', + ]; + + public static function getData($language = DEFAULT_LANGUAGE) + { + $data = static::where('language', $language)->first(); + + if (!$data) { + $data = static::where('language', DEFAULT_LANGUAGE)->first(); + } + + return $data; + } +} diff --git a/packages/marvel/src/Database/Models/Category.php b/packages/marvel/src/Database/Models/Category.php new file mode 100644 index 0000000..0acc3b6 --- /dev/null +++ b/packages/marvel/src/Database/Models/Category.php @@ -0,0 +1,111 @@ + 'json', + 'banner_image' => 'json', + ]; + + protected $appends = ['parent_id', 'translated_languages']; + + /** + * Get the user's full name. + * + * @return string + */ + public function getParentIdAttribute() + { + if (isset($this->attributes['parent'])) { + return $this->parent; + } + } + + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } + + /** + * Return the sluggable configuration array for this model. + * + * @return array + */ + public function sluggable(): array + { + return [ + 'slug' => [ + 'source' => 'name' + ] + ]; + } + + + /** + * @return BelongsTo + */ + public function type(): BelongsTo + { + return $this->belongsTo(Type::class, 'type_id'); + } + + /** + * @return BelongsToMany + */ + public function products(): BelongsToMany + { + return $this->belongsToMany(Product::class, 'category_product'); + } + + /** + * @return HasMany + */ + public function children() + { + return $this->hasMany('Marvel\Database\Models\Category', 'parent', 'id')->with('children')->withCount('products'); + } + + /** + * @return HasMany + */ + public function subCategories() + { + return $this->hasMany('Marvel\Database\Models\Category', 'parent', 'id')->with('subCategories', 'parent')->withCount('products'); + } + + /** + * @return HasOne + */ + public function parent() + { + return $this->hasOne('Marvel\Database\Models\Category', 'id', 'parent')->with('parent'); + } + + /** + * @return HasOne + */ + public function parentCategory() + { + return $this->hasOne('Marvel\Database\Models\Category', 'id', 'parent')->with('parentCategory'); + } +} diff --git a/packages/marvel/src/Database/Models/Commission.php b/packages/marvel/src/Database/Models/Commission.php new file mode 100644 index 0000000..98e7fa8 --- /dev/null +++ b/packages/marvel/src/Database/Models/Commission.php @@ -0,0 +1,17 @@ + 'json', + ]; +} diff --git a/packages/marvel/src/Database/Models/Conversation.php b/packages/marvel/src/Database/Models/Conversation.php new file mode 100644 index 0000000..44ed02c --- /dev/null +++ b/packages/marvel/src/Database/Models/Conversation.php @@ -0,0 +1,77 @@ +belongsTo(User::class, 'user_id'); + } + + /** + * @return belongsTo + */ + public function shop(): BelongsTo + { + return $this->belongsTo(Shop::class, 'shop_id'); + } + + /** + * @return hasMany + */ + public function messages(): HasMany + { + return $this->hasMany(Message::class, 'conversation_id'); + } + + /** + * Returns the latest message from a conversation. + * + * @return Message + */ + public function getLatestMessageAttribute() + { + return $this->messages()->latest()->first(); + } + + /** + * Get all of the conversations participants. + */ + public function participants() + { + return $this->hasMany(Participant::class, 'conversation_id'); + } + + public function getUnseenAttribute() + { + if (Auth::check()) { + $instance = $this->participants()->whereNull('last_read')->where('user_id', auth()->user()->id)->where('type', 'user')->count(); + + if (0 == $instance) { + $instance = $this->participants()->whereNull('last_read')->whereIn('shop_id', auth()->user()->shops()->pluck('id'))->where('type', 'shop')->count(); + } + + return $instance; + } else { + return '0'; + } + } +} diff --git a/packages/marvel/src/Database/Models/Coupon.php b/packages/marvel/src/Database/Models/Coupon.php new file mode 100644 index 0000000..d2302de --- /dev/null +++ b/packages/marvel/src/Database/Models/Coupon.php @@ -0,0 +1,68 @@ + 'json', + ]; + + protected static function boot() + { + parent::boot(); + // Order by updated_at desc + static::addGlobalScope('order', function (Builder $builder) { + $builder->orderBy('updated_at', 'desc'); + }); + } + + /** + * @return HasMany + */ + public function orders(): HasMany + { + return $this->hasMany(Order::class, 'coupon_id'); + } + + /** + * @return bool + */ + public function getIsValidAttribute() + { + return Carbon::now()->between($this->active_from, $this->expire_at); + } + /** + * @return BelongsTo + */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class); + } + + /** + * @return BelongsTo + */ + public function shop(): BelongsTo + { + return $this->belongsTo(Shop::class); + } +} diff --git a/packages/marvel/src/Database/Models/DeliveryTime.php b/packages/marvel/src/Database/Models/DeliveryTime.php new file mode 100644 index 0000000..06cc642 --- /dev/null +++ b/packages/marvel/src/Database/Models/DeliveryTime.php @@ -0,0 +1,39 @@ + [ + 'source' => 'title' + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } +} diff --git a/packages/marvel/src/Database/Models/DigitalFile.php b/packages/marvel/src/Database/Models/DigitalFile.php new file mode 100644 index 0000000..3f17976 --- /dev/null +++ b/packages/marvel/src/Database/Models/DigitalFile.php @@ -0,0 +1,25 @@ +morphTo(__FUNCTION__, 'fileable_type', 'fileable_id'); + } +} diff --git a/packages/marvel/src/Database/Models/DownloadToken.php b/packages/marvel/src/Database/Models/DownloadToken.php new file mode 100644 index 0000000..acd9a04 --- /dev/null +++ b/packages/marvel/src/Database/Models/DownloadToken.php @@ -0,0 +1,21 @@ +belongsTo(DigitalFile::class, 'digital_file_id'); + } +} diff --git a/packages/marvel/src/Database/Models/Faqs.php b/packages/marvel/src/Database/Models/Faqs.php new file mode 100644 index 0000000..6729430 --- /dev/null +++ b/packages/marvel/src/Database/Models/Faqs.php @@ -0,0 +1,56 @@ + [ + 'source' => 'faq_title', + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } + /** + * @return BelongsTo + */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class); + } + + /** + * @return BelongsTo + */ + public function shop(): BelongsTo + { + return $this->belongsTo(Shop::class); + } +} diff --git a/packages/marvel/src/Database/Models/Feedback.php b/packages/marvel/src/Database/Models/Feedback.php new file mode 100644 index 0000000..7aaa594 --- /dev/null +++ b/packages/marvel/src/Database/Models/Feedback.php @@ -0,0 +1,37 @@ +belongsTo(User::class, 'user_id'); + } + + /** + * Get all of the models that own feedbacks. + */ + public function model() + { + return $this->morphTo(); + } + +} diff --git a/packages/marvel/src/Database/Models/FlashSale.php b/packages/marvel/src/Database/Models/FlashSale.php new file mode 100644 index 0000000..250b31d --- /dev/null +++ b/packages/marvel/src/Database/Models/FlashSale.php @@ -0,0 +1,63 @@ + 'json', + 'sale_builder' => 'json', + 'image' => 'json' + ]; + + /** + * Return the sluggable configuration array for this model. + * + * @return array + */ + public function sluggable(): array + { + return [ + 'slug' => [ + 'source' => 'title', + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } + + /** + * @return BelongsToMany + */ + public function products(): BelongsToMany + { + return $this->belongsToMany(Product::class, 'flash_sale_products')->withPivot('flash_sale_id', 'product_id'); + } + + /** + * @return HasMany + */ + public function flashSaleRequests(): HasMany + { + return $this->hasMany(FlashSaleRequests::class); + } +} \ No newline at end of file diff --git a/packages/marvel/src/Database/Models/FlashSaleRequests.php b/packages/marvel/src/Database/Models/FlashSaleRequests.php new file mode 100644 index 0000000..735fcbc --- /dev/null +++ b/packages/marvel/src/Database/Models/FlashSaleRequests.php @@ -0,0 +1,36 @@ +belongsTo(FlashSale::class, 'flash_sale_id'); + } + + /** + * products + * + * @return BelongsToMany + */ + public function products(): BelongsToMany + { + return $this->belongsToMany(Product::class, "flash_sale_requests_products"); + } +} diff --git a/packages/marvel/src/Database/Models/Language.php b/packages/marvel/src/Database/Models/Language.php new file mode 100644 index 0000000..4603cdd --- /dev/null +++ b/packages/marvel/src/Database/Models/Language.php @@ -0,0 +1,12 @@ + 'json', + 'cover_image' => 'json', + 'socials' => 'json', + ]; + + /** + * Return the sluggable configuration array for this model. + * + * @return array + */ + public function sluggable(): array + { + return [ + 'slug' => [ + 'source' => 'name' + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } + + public function getProductsCountAttribute() + { + return $this->products()->count(); + } + + + /** + * @return HasMany + */ + public function products(): HasMany + { + return $this->hasMany(Product::class, 'manufacturer_id'); + } + + /** + * @return BelongsTo + */ + public function type(): BelongsTo + { + return $this->belongsTo(Type::class, 'type_id'); + } +} diff --git a/packages/marvel/src/Database/Models/Message.php b/packages/marvel/src/Database/Models/Message.php new file mode 100644 index 0000000..9f226af --- /dev/null +++ b/packages/marvel/src/Database/Models/Message.php @@ -0,0 +1,47 @@ +body); + // } + + /** + * @return belongsTo + */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class, 'user_id'); + } + + /** + * @return belongsTo + */ + public function conversation(): BelongsTo + { + return $this->belongsTo(Conversation::class, 'conversation_id'); + } + + /** + * @return belongsTo + */ + public function participant(): HasOne + { + return $this->hasOne(Participant::class, 'message_id'); + } + +} diff --git a/packages/marvel/src/Database/Models/NotifyLogs.php b/packages/marvel/src/Database/Models/NotifyLogs.php new file mode 100644 index 0000000..8e41279 --- /dev/null +++ b/packages/marvel/src/Database/Models/NotifyLogs.php @@ -0,0 +1,45 @@ +belongsTo(User::class, 'receiver')->with('profile'); + } + + + /** + * @return BelongsTo + */ + public function sender_user(): BelongsTo + { + return $this->belongsTo(User::class, 'sender')->with('profile'); + } +} diff --git a/packages/marvel/src/Database/Models/Order.php b/packages/marvel/src/Database/Models/Order.php new file mode 100644 index 0000000..0926165 --- /dev/null +++ b/packages/marvel/src/Database/Models/Order.php @@ -0,0 +1,126 @@ + 'json', + 'billing_address' => 'json', + 'payment_intent_info' => 'json', + ]; + + protected $hidden = [ + // 'created_at', + 'updated_at', + 'deleted_at' + ]; + + protected static function boot() + { + parent::boot(); + // Order by created_at desc + static::addGlobalScope('order', function (Builder $builder) { + $builder->orderBy('created_at', 'desc'); + }); + } + + protected $with = ['customer', 'products.variation_options']; + + /** + * @return belongsToMany + */ + public function products(): belongsToMany + { + return $this->belongsToMany(Product::class) + ->withPivot('order_quantity', 'unit_price', 'subtotal', 'variation_option_id') + ->withTimestamps(); + } + + /** + * @return belongsTo + */ + public function coupon(): belongsTo + { + return $this->belongsTo(Coupon::class, 'coupon_id'); + } + + /** + * @return belongsTo + */ + public function customer(): belongsTo + { + return $this->belongsTo(User::class, 'customer_id'); + } + + /** + * @return BelongsTo + */ + public function shop(): BelongsTo + { + return $this->belongsTo(Shop::class, 'shop_id'); + } + + /** + * @return HasMany + */ + public function children() + { + return $this->hasMany('Marvel\Database\Models\Order', 'parent_id', 'id'); + } + + /** + * @return HasOne + */ + public function parent_order() + { + return $this->hasOne('Marvel\Database\Models\Order', 'id', 'parent_id'); + } + + /** + * @return HasOne + */ + public function refund() + { + return $this->hasOne(Refund::class, 'order_id'); + } + /** + * @return HasOne + */ + public function wallet_point() + { + return $this->hasOne(OrderWalletPoint::class, 'order_id'); + } + + /** + * @return HasMany + */ + public function payment_intent() + { + return $this->hasMany(PaymentIntent::class); + } + + /** + * @return HasMany + */ + public function reviews(): HasMany + { + return $this->hasMany(Review::class); + } +} diff --git a/packages/marvel/src/Database/Models/OrderWalletPoint.php b/packages/marvel/src/Database/Models/OrderWalletPoint.php new file mode 100644 index 0000000..7c4c27b --- /dev/null +++ b/packages/marvel/src/Database/Models/OrderWalletPoint.php @@ -0,0 +1,21 @@ +belongsTo(Order::class, 'order_id'); + } +} diff --git a/packages/marvel/src/Database/Models/OrderedFile.php b/packages/marvel/src/Database/Models/OrderedFile.php new file mode 100644 index 0000000..50c63b7 --- /dev/null +++ b/packages/marvel/src/Database/Models/OrderedFile.php @@ -0,0 +1,29 @@ +belongsTo(DigitalFile::class, 'digital_file_id'); + } + + /** + * @return BelongsTo + */ + public function order(): BelongsTo + { + return $this->belongsTo(Order::class, 'tracking_number', 'tracking_number'); + } +} diff --git a/packages/marvel/src/Database/Models/OwnershipTransfer.php b/packages/marvel/src/Database/Models/OwnershipTransfer.php new file mode 100644 index 0000000..67765ff --- /dev/null +++ b/packages/marvel/src/Database/Models/OwnershipTransfer.php @@ -0,0 +1,75 @@ +orderBy('created_at', 'desc'); + }); + + static::creating(function ($ownershipTransfer) { + $ownershipTransfer->transaction_identifier = static::generateTracker(); + $ownershipTransfer->created_by = Auth::id(); + }); + } + + /** + * @return belongsTo + */ + public function previous_owner(): belongsTo + { + return $this->belongsTo(User::class, 'from')->with(['profile']); + } + /** + * @return belongsTo + */ + public function current_owner(): belongsTo + { + return $this->belongsTo(User::class, 'to')->with(['profile']); + } + /** + * @return belongsTo + */ + public function shop(): belongsTo + { + // TODO : 'orders' can be fetched too. But need to discuss. + return $this->belongsTo(Shop::class, 'shop_id')->with(['balance', 'refunds', 'withdraws']); + } + /** + * @return belongsTo + */ + public function transferred_by(): belongsTo + { + return $this->belongsTo(User::class, 'created_by'); + } + + public static function generateTracker(): string + { + $currentDate = date('Y-m-d'); + $totalRecordsToday = static::whereDate('created_at', now()->toDateString())->count() + 1; + // Format the total records as a three-digit string (e.g., "0001") + $formattedTotalRecords = sprintf('%04u', $totalRecordsToday); + + return $currentDate . '-' . $formattedTotalRecords; + } +} diff --git a/packages/marvel/src/Database/Models/Participant.php b/packages/marvel/src/Database/Models/Participant.php new file mode 100644 index 0000000..f1e13df --- /dev/null +++ b/packages/marvel/src/Database/Models/Participant.php @@ -0,0 +1,45 @@ +belongsTo(User::class, 'user_id'); + } + + /** + * @return belongsTo + */ + public function shop(): BelongsTo + { + return $this->belongsTo(Shop::class, 'shop_id'); + } + + /** + * Get all of the models that own participants. + */ + public function conversation(): BelongsTo + { + return $this->belongsTo(Conversation::class, 'conversation_id'); + } + + /** + * Get all of the models that own participants. + */ + public function message(): BelongsTo + { + return $this->belongsTo(Message::class, 'message_id'); + } + +} diff --git a/packages/marvel/src/Database/Models/PasswordReset.php b/packages/marvel/src/Database/Models/PasswordReset.php new file mode 100644 index 0000000..085fc92 --- /dev/null +++ b/packages/marvel/src/Database/Models/PasswordReset.php @@ -0,0 +1,15 @@ +hasMany(PaymentMethod::class); + } + + /** + * @return BelongsTo + */ + public function users(): BelongsTo + { + return $this->BelongsTo(User::class, 'user_id'); + } +} diff --git a/packages/marvel/src/Database/Models/PaymentIntent.php b/packages/marvel/src/Database/Models/PaymentIntent.php new file mode 100644 index 0000000..67d5e42 --- /dev/null +++ b/packages/marvel/src/Database/Models/PaymentIntent.php @@ -0,0 +1,38 @@ + 'json', + ]; + + protected $hidden = [ + 'created_at', + 'updated_at', + 'deleted_at' + ]; + + /** + * @return belongsTo + */ + public function order(): belongsTo + { + return $this->belongsTo(Order::class, 'order_id'); + } +} diff --git a/packages/marvel/src/Database/Models/PaymentMethod.php b/packages/marvel/src/Database/Models/PaymentMethod.php new file mode 100644 index 0000000..2dfc4ab --- /dev/null +++ b/packages/marvel/src/Database/Models/PaymentMethod.php @@ -0,0 +1,26 @@ +BelongsTo(PaymentGateway::class, 'payment_gateway_id'); + } +} diff --git a/packages/marvel/src/Database/Models/Permission.php b/packages/marvel/src/Database/Models/Permission.php new file mode 100644 index 0000000..5b41c41 --- /dev/null +++ b/packages/marvel/src/Database/Models/Permission.php @@ -0,0 +1,23 @@ +morphedByMany( + getModelForGuard($this->attributes['guard_name']), + 'model', + config('permission.table_names.model_has_permissions'), + 'permission_id', + config('permission.column_names.model_morph_key') + )->with('profile', 'address', 'shop'); + } +} diff --git a/packages/marvel/src/Database/Models/Product.php b/packages/marvel/src/Database/Models/Product.php new file mode 100644 index 0000000..ee76833 --- /dev/null +++ b/packages/marvel/src/Database/Models/Product.php @@ -0,0 +1,330 @@ + 'json', + 'gallery' => 'json', + 'video' => 'json', + ]; + + protected $appends = [ + 'ratings', + 'total_reviews', + 'rating_count', + 'my_review', + 'in_wishlist', + 'blocked_dates', + 'translated_languages', + 'sold' + ]; + + /** + * Return the sluggable configuration array for this model. + * + * @return array + */ + public function sluggable(): array + { + return [ + 'slug' => [ + 'source' => 'name' + ] + ]; + } + + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } + + /** + * Get the user's full name. + * + * @return string + */ + public function getBlockedDatesAttribute() + { + return $this->getBlockedDates(); + } + + function getBlockedDates() + { + $_blockedDates = $this->fetchBlockedDatesForAProduct(); + $_flatBlockedDates = []; + foreach ($_blockedDates as $date) { + $from = Carbon::parse($date->from); + $to = Carbon::parse($date->to); + $dateRange = CarbonPeriod::create($from, $to); + $_blockedDates = $dateRange->toArray(); + unset($_blockedDates[count($_blockedDates) - 1]); + $_flatBlockedDates = array_unique(array_merge($_flatBlockedDates, $_blockedDates)); + } + return $_flatBlockedDates; + } + + public function fetchBlockedDatesForAProduct() + { + return Availability::where('product_id', $this->id)->where('bookable_type', 'Marvel\Database\Models\Product')->whereDate('to', '>=', Carbon::now())->get(); + } + + /** + * @return BelongsTo + */ + public function type(): BelongsTo + { + return $this->belongsTo(Type::class, 'type_id'); + } + + /** + * @return BelongsTo + */ + public function shop(): BelongsTo + { + return $this->belongsTo(Shop::class, 'shop_id'); + } + + /** + * @return BelongsTo + */ + public function author(): BelongsTo + { + return $this->belongsTo(Author::class, 'author_id'); + } + + /** + * @return BelongsTo + */ + public function manufacturer(): BelongsTo + { + return $this->belongsTo(Manufacturer::class, 'manufacturer_id'); + } + + /** + * @return BelongsTo + */ + public function shipping(): BelongsTo + { + return $this->belongsTo(Shipping::class, 'shipping_class_id'); + } + + /** + * @return BelongsToMany + */ + public function categories(): BelongsToMany + { + return $this->belongsToMany(Category::class, 'category_product'); + } + + /** + * @return BelongsToMany + */ + public function tags(): BelongsToMany + { + return $this->belongsToMany(Tag::class, 'product_tag'); + } + + /** + * @return HasMany + */ + public function variation_options(): HasMany + { + return $this->hasMany(Variation::class, 'product_id'); + } + + /** + * @return belongsToMany + */ + public function orders(): belongsToMany + { + return $this->belongsToMany(Order::class)->withTimestamps(); + } + + /** + * @return BelongsToMany + */ + public function variations(): BelongsToMany + { + return $this->belongsToMany(AttributeValue::class, 'attribute_product'); + } + + /** + * @return HasMany + */ + public function reviews(): HasMany + { + return $this->hasMany(Review::class, 'product_id'); + } + + /** + * @return HasMany + */ + public function questions(): HasMany + { + return $this->hasMany(Question::class, 'product_id'); + } + + /** + * @return HasMany + */ + public function wishlists(): HasMany + { + return $this->hasMany(Wishlist::class, 'product_id'); + } + + public function getRatingsAttribute() + { + return round($this->reviews()->avg('rating'), 2); + } + + public function getTotalReviewsAttribute() + { + return $this->reviews()->count(); + } + + public function getRatingCountAttribute() + { + return $this->reviews()->orderBy('rating', 'DESC')->groupBy('rating')->select('rating', DB::raw('count(*) as total'))->get(); + } + + public function getMyReviewAttribute() + { + if (auth()->user() && !empty($this->reviews()->where('user_id', auth()->user()->id)->first())) { + return $this->reviews()->where('user_id', auth()->user()->id)->get(); + } + return null; + } + + public function getInWishlistAttribute() + { + if (auth()->user() && !empty($this->wishlists()->where('user_id', auth()->user()->id)->first())) { + return true; + } + return false; + } + + public function digital_file() + { + return $this->morphOne(DigitalFile::class, 'fileable'); + } + + public function availabilities() + { + return $this->morphMany(Availability::class, 'bookable'); + } + + + /** + * @return BelongsToMany + */ + public function dropoff_locations(): BelongsToMany + { + return $this->belongsToMany(Resource::class, 'dropoff_location_product', 'product_id', 'resource_id'); + } + /** + * @return BelongsToMany + */ + public function pickup_locations(): BelongsToMany + { + return $this->belongsToMany(Resource::class, 'pickup_location_product', 'product_id', 'resource_id'); + } + /** + * @return BelongsToMany + */ + public function deposits(): BelongsToMany + { + return $this->belongsToMany(Resource::class, 'deposit_product', 'product_id', 'resource_id'); + } + /** + * @return BelongsToMany + */ + public function persons(): BelongsToMany + { + return $this->belongsToMany(Resource::class, 'person_product', 'product_id', 'resource_id'); + } + /** + * @return BelongsToMany + */ + public function features(): BelongsToMany + { + return $this->belongsToMany(Resource::class, 'feature_product', 'product_id', 'resource_id'); + } + + /** + * @return int|mixed + */ + public function getSoldAttribute() + { + return DB::table('order_product') + ->join('orders', 'orders.id', '=', 'order_product.order_id') + ->where('order_product.product_id', '=', $this->id) + ->where('orders.parent_id', '=', null) + ->sum('order_quantity'); + } + + /** + * @return BelongsToMany + */ + public function flash_sales(): BelongsToMany + { + return $this->belongsToMany(FlashSale::class, 'flash_sale_products')->withPivot('flash_sale_id', 'product_id'); + } + + /** + * flash_sale_requests + * + * @return BelongsToMany + */ + public function flash_sale_requests(): BelongsToMany + { + return $this->belongsToMany(FlashSaleRequests::class, "flash_sale_requests_products"); + } + + public function loadRelated($slug, $limit = 10, $language = DEFAULT_LANGUAGE) + { + $relatedProducts = []; + try { + $product = $this->where('slug', $slug)->firstOrFail(); + $categories = $product->categories()->pluck('id'); + + $relatedProducts = $this->where('language', $language) + ->whereHas('categories', function ($query) use ($categories) { + $query->whereIn('categories.id', $categories); + })->with('type')->limit($limit)->get(); + } catch (Exception $e) { + logger($e->getMessage()); // logging the error + } + $this->setRelation('related_products', $relatedProducts); + return $this; + } +} diff --git a/packages/marvel/src/Database/Models/Profile.php b/packages/marvel/src/Database/Models/Profile.php new file mode 100644 index 0000000..b97968f --- /dev/null +++ b/packages/marvel/src/Database/Models/Profile.php @@ -0,0 +1,27 @@ + 'json', + 'avatar' => 'json', + 'notifications' => 'json', + ]; + + /** + * @return BelongsTo + */ + public function customer(): BelongsTo + { + return $this->belongsTo(User::class, 'customer_id'); + } +} diff --git a/packages/marvel/src/Database/Models/Provider.php b/packages/marvel/src/Database/Models/Provider.php new file mode 100644 index 0000000..c1a796b --- /dev/null +++ b/packages/marvel/src/Database/Models/Provider.php @@ -0,0 +1,18 @@ +BelongsTo(Product::class, 'product_id'); + } + + /** + * @return belongsTo + */ + public function user(): belongsTo + { + return $this->belongsTo(User::class, 'user_id'); + } + + /** + * Get all of the questions feedbacks. + */ + public function feedbacks() + { + return $this->morphMany(Feedback::class, 'model'); + } + + /** + * Get all of the questions abusive reports. + */ + public function abusive_reports() + { + return $this->morphOne(AbusiveReport::class, 'model'); + } + + /** + * Positive feedback count of question. + * @return int + */ + public function getPositiveFeedbacksCountAttribute() + { + return $this->feedbacks()->wherePositive(1)->count(); + } + + /** + * Negative feedback count of question. + * @return int + */ + public function getNegativeFeedbacksCountAttribute() + { + return $this->feedbacks()->whereNegative(1)->count(); + } + + /** + * Get authenticated user feedback + * @return object | null + */ + public function getMyFeedbackAttribute() + { + if (auth()->user()) { + return $this->feedbacks()->where('user_id', auth()->user()->id)->first(); + } + return null; + } + + /** + * Count no of abusive reports in the question. + * @return int + */ + public function getAbusiveReportsCountAttribute() + { + return $this->abusive_reports()->count(); + } +} diff --git a/packages/marvel/src/Database/Models/Refund.php b/packages/marvel/src/Database/Models/Refund.php new file mode 100644 index 0000000..8f2b616 --- /dev/null +++ b/packages/marvel/src/Database/Models/Refund.php @@ -0,0 +1,60 @@ + 'json', + ]; + + protected $dispatchesEvents = [ + 'created' => RefundRequested::class, + 'updated' => RefundUpdate::class, + ]; + + /** + * @return BelongsTo + */ + public function customer(): BelongsTo + { + return $this->belongsTo(User::class, 'customer_id'); + } + /** + * @return BelongsTo + */ + public function order(): BelongsTo + { + return $this->belongsTo(Order::class, 'order_id'); + } + /** + * @return BelongsTo + */ + public function shop(): BelongsTo + { + return $this->belongsTo(Shop::class, 'shop_id'); + } + /** + * @return BelongsTo + */ + public function refund_policy(): BelongsTo + { + return $this->belongsTo(RefundPolicy::class, 'refund_policy_id'); + } + /** + * @return BelongsTo + */ + public function refund_reason(): BelongsTo + { + return $this->belongsTo(RefundReason::class, 'refund_reason_id'); + } +} diff --git a/packages/marvel/src/Database/Models/RefundPolicy.php b/packages/marvel/src/Database/Models/RefundPolicy.php new file mode 100644 index 0000000..e8869b8 --- /dev/null +++ b/packages/marvel/src/Database/Models/RefundPolicy.php @@ -0,0 +1,56 @@ + [ + 'source' => 'title', + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } + + /** + * @return BelongsTo + */ + public function shop(): BelongsTo + { + return $this->belongsTo(Shop::class); + } + + /** + * @return BelongsTo + */ + + public function refunds(): HasMany + { + return $this->hasMany(Refund::class); + } +} diff --git a/packages/marvel/src/Database/Models/RefundReason.php b/packages/marvel/src/Database/Models/RefundReason.php new file mode 100644 index 0000000..3b77bba --- /dev/null +++ b/packages/marvel/src/Database/Models/RefundReason.php @@ -0,0 +1,40 @@ + [ + 'source' => 'name' + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } +} diff --git a/packages/marvel/src/Database/Models/Resource.php b/packages/marvel/src/Database/Models/Resource.php new file mode 100644 index 0000000..6c588b9 --- /dev/null +++ b/packages/marvel/src/Database/Models/Resource.php @@ -0,0 +1,44 @@ + 'json', + ]; + + /** + * Return the sluggable configuration array for this model. + * + * @return array + */ + public function sluggable(): array + { + return [ + 'slug' => [ + 'source' => 'name' + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } +} diff --git a/packages/marvel/src/Database/Models/Review.php b/packages/marvel/src/Database/Models/Review.php new file mode 100644 index 0000000..d15a888 --- /dev/null +++ b/packages/marvel/src/Database/Models/Review.php @@ -0,0 +1,95 @@ + 'json', + ]; + + protected $appends = [ + 'positive_feedbacks_count', + 'negative_feedbacks_count', + 'my_feedback', + 'abusive_reports_count' + ]; + + /** + * @return BelongsTo + */ + public function product(): BelongsTo + { + return $this->BelongsTo(Product::class, 'product_id'); + } + + /** + * @return belongsTo + */ + public function user(): belongsTo + { + return $this->belongsTo(User::class, 'user_id'); + } + + /** + * Get all of the reviews feedbacks. + */ + public function feedbacks() + { + return $this->morphMany(Feedback::class, 'model'); + } + + public function abusive_reports() + { + return $this->morphMany(AbusiveReport::class, 'model'); + } + + /** + * Positive feedback count of review . + * @return int + */ + public function getPositiveFeedbacksCountAttribute() + { + return $this->feedbacks()->wherePositive(1)->count(); + } + + /** + * Negative feedback count of review . + * @return int + */ + public function getNegativeFeedbacksCountAttribute() + { + return $this->feedbacks()->whereNegative(1)->count(); + } + + /** + * Get authenticated user feedback + * @return object | null + */ + public function getMyFeedbackAttribute() + { + if(auth()->user()) { + return $this->feedbacks()->where('user_id', auth()->user()->id)->first(); + } + return null; + } + + /** + * Count no of abusive reports in the review. + * @return int + */ + public function getAbusiveReportsCountAttribute() { + return $this->abusive_reports()->count(); + } + +} diff --git a/packages/marvel/src/Database/Models/Settings.php b/packages/marvel/src/Database/Models/Settings.php new file mode 100644 index 0000000..b7b47c8 --- /dev/null +++ b/packages/marvel/src/Database/Models/Settings.php @@ -0,0 +1,27 @@ + 'json', + ]; + + public static function getData($language = DEFAULT_LANGUAGE) + { + $data = static::where('language', $language)->first(); + + if (!$data) { + $data = static::where('language', DEFAULT_LANGUAGE)->first(); + } + + return $data; + } +} diff --git a/packages/marvel/src/Database/Models/Shipping.php b/packages/marvel/src/Database/Models/Shipping.php new file mode 100644 index 0000000..9c401c2 --- /dev/null +++ b/packages/marvel/src/Database/Models/Shipping.php @@ -0,0 +1,30 @@ +orderBy('updated_at', 'desc'); + }); + } + + /** + * @return HasMany + */ + public function products(): HasMany + { + return $this->hasMany(Product::class, 'shipping_class_id'); + } +} diff --git a/packages/marvel/src/Database/Models/Shop.php b/packages/marvel/src/Database/Models/Shop.php new file mode 100644 index 0000000..d77df6a --- /dev/null +++ b/packages/marvel/src/Database/Models/Shop.php @@ -0,0 +1,166 @@ + 'json', + 'cover_image' => 'json', + 'address' => 'json', + 'settings' => 'json', + ]; + + /** + * Return the sluggable configuration array for this model. + * + * @return array + */ + public function sluggable(): array + { + return [ + 'slug' => [ + 'source' => 'name' + ] + ]; + } + + /** + * @return HasOne + */ + public function balance(): HasOne + { + return $this->hasOne(Balance::class, 'shop_id'); + } + + /** + * @return BelongsTo + */ + public function owner(): BelongsTo + { + return $this->belongsTo(User::class, 'owner_id'); + } + + /** + * @return HasMany + */ + public function orders(): HasMany + { + return $this->hasMany(Order::class, 'shop_id'); + } + + /** + * @return HasMany + */ + public function attributes(): HasMany + { + return $this->hasMany(Attribute::class, 'shop_id'); + } + + /** + * @return HasMany + */ + public function products(): HasMany + { + return $this->hasMany(Product::class, 'shop_id'); + } + + /** + * @return HasMany + */ + public function withdraws(): HasMany + { + return $this->hasMany(Withdraw::class, 'shop_id'); + } + + /** + * @return HasMany + */ + public function staffs(): HasMany + { + return $this->hasMany(User::class, 'shop_id'); + } + + /** + * @return HasMany + */ + public function refunds(): HasMany + { + return $this->hasMany(User::class, 'shop_id'); + } + + /** + * @return BelongsToMany + */ + public function categories(): BelongsToMany + { + return $this->belongsToMany(Category::class, 'category_shop'); + } + + /** + * @return BelongsToMany + */ + public function users(): BelongsToMany + { + return $this->BelongsToMany(User::class, 'user_shop'); + } + + /** + * @return HasMany + */ + public function conversations(): HasMany + { + return $this->hasMany(Conversation::class, 'shop_id'); + } + + /** + * faqs + * + * @return HasMany + */ + public function faqs(): HasMany + { + return $this->HasMany(Faqs::class); + } + + /** + * terms and conditions + * + * @return HasMany + */ + public function terms_and_conditions(): HasMany + { + return $this->HasMany(TermsAndConditions::class); + } + /** + * faqs + * + * @return HasMany + */ + public function coupons(): HasMany + { + return $this->HasMany(Coupon::class); + } + /** + * ownership transfers + * + * @return HasOne + */ + public function ownership_history(): HasOne + { + return $this->hasOne(OwnershipTransfer::class, 'shop_id'); + } +} diff --git a/packages/marvel/src/Database/Models/StoreNotice.php b/packages/marvel/src/Database/Models/StoreNotice.php new file mode 100644 index 0000000..7d2e6c2 --- /dev/null +++ b/packages/marvel/src/Database/Models/StoreNotice.php @@ -0,0 +1,111 @@ +created_by = Auth::id(); + }); + static::updating(function ($storeNotice) { + $storeNotice->updated_by = Auth::id(); + }); + } + + /** + * @return BelongsTo + */ + public function creator(): BelongsTo + { + return $this->belongsTo(User::class, 'created_by'); + } + /** + * @return BelongsTo + */ + public function updater(): BelongsTo + { + return $this->belongsTo(User::class, 'updated_by'); + } + + /** + * @return BelongsToMany + */ + public function read_status(): BelongsToMany + { + return $this->belongsToMany(User::class, 'store_notice_read')->withPivot('is_read'); + } + + /** + * @return BelongsToMany + */ + public function users(): BelongsToMany + { + return $this->belongsToMany(User::class, 'store_notice_user'); + } + + /** + * @return BelongsToMany + */ + public function shops(): BelongsToMany + { + return $this->belongsToMany(Shop::class, 'store_notice_shop'); + } + + /** + * @return string + */ + public function getCreatorRoleAttribute(): string + { + try { + $permissionArr = $this->creator->permissions->pluck('name')->toArray(); + if (in_array(Permission::SUPER_ADMIN, $permissionArr)) { + return ucfirst(str_replace('_', ' ', Permission::SUPER_ADMIN)); + } + return ucfirst(str_replace('_', ' ', Permission::STORE_OWNER)); + } catch (\Throwable $th) { + return ''; + } + } + + /** + * @return bool + */ + public function getIsReadAttribute(): bool + { + try { + $readStatusArr = $this->read_status; + foreach ($readStatusArr as $readStatus) { + if ($readStatus->id === Auth::id() && $readStatus->pivot->is_read) { + return true; + } + } + return false; + } catch (\Throwable $th) { + return false; + } + } +} diff --git a/packages/marvel/src/Database/Models/StoreNoticeRead.php b/packages/marvel/src/Database/Models/StoreNoticeRead.php new file mode 100644 index 0000000..7aac521 --- /dev/null +++ b/packages/marvel/src/Database/Models/StoreNoticeRead.php @@ -0,0 +1,34 @@ +belongsTo(User::class, 'user_id'); + } + + /** + * StoreNotice + * + * @return BelongsTo + */ + public function StoreNotice(): BelongsTo + { + return $this->belongsTo(StoreNotice::class, 'store_notice_id'); + } +} diff --git a/packages/marvel/src/Database/Models/Tag.php b/packages/marvel/src/Database/Models/Tag.php new file mode 100644 index 0000000..bdb0fdd --- /dev/null +++ b/packages/marvel/src/Database/Models/Tag.php @@ -0,0 +1,63 @@ + 'json', + ]; + + /** + * Return the sluggable configuration array for this model. + * + * @return array + */ + public function sluggable(): array + { + return [ + 'slug' => [ + 'source' => 'name' + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } + + + /** + * @return BelongsTo + */ + public function type(): BelongsTo + { + return $this->belongsTo(Type::class, 'type_id'); + } + + /** + * @return BelongsToMany + */ + public function products(): BelongsToMany + { + return $this->belongsToMany(Product::class, 'product_tag'); + } +} diff --git a/packages/marvel/src/Database/Models/Tax.php b/packages/marvel/src/Database/Models/Tax.php new file mode 100644 index 0000000..92d2d20 --- /dev/null +++ b/packages/marvel/src/Database/Models/Tax.php @@ -0,0 +1,27 @@ +orderBy('updated_at', 'desc'); + }); + } +} diff --git a/packages/marvel/src/Database/Models/TermsAndConditions.php b/packages/marvel/src/Database/Models/TermsAndConditions.php new file mode 100644 index 0000000..4c10d28 --- /dev/null +++ b/packages/marvel/src/Database/Models/TermsAndConditions.php @@ -0,0 +1,57 @@ + [ + 'source' => 'title', + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } + + /** + * @return BelongsTo + */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class); + } + + /** + * @return BelongsTo + */ + public function shop(): BelongsTo + { + return $this->belongsTo(Shop::class); + } +} diff --git a/packages/marvel/src/Database/Models/Type.php b/packages/marvel/src/Database/Models/Type.php new file mode 100644 index 0000000..3754831 --- /dev/null +++ b/packages/marvel/src/Database/Models/Type.php @@ -0,0 +1,72 @@ + [ + 'source' => 'name', + ] + ]; + } + + public function scopeWithUniqueSlugConstraints(Builder $query, Model $model): Builder + { + return $query->where('language', $model->language); + } + + protected $casts = [ + 'promotional_sliders' => 'json', + 'images' => 'json', + 'settings' => 'json', + ]; + + /** + * @return HasMany + */ + public function products(): HasMany + { + return $this->hasMany(Product::class, 'type_id'); + } + + /** + * @return HasMany + */ + public function categories(): HasMany + { + return $this->hasMany(Category::class, 'type_id'); + } + + /** + * @return HasMany + */ + public function banners(): HasMany + { + return $this->hasMany(Banner::class, 'type_id'); + } +} diff --git a/packages/marvel/src/Database/Models/User.php b/packages/marvel/src/Database/Models/User.php new file mode 100644 index 0000000..3f6a0b2 --- /dev/null +++ b/packages/marvel/src/Database/Models/User.php @@ -0,0 +1,223 @@ + 'datetime', + ]; + + protected $appends = ['email_verified']; + + protected static function boot() + { + parent::boot(); + // Order by updated_at desc + static::addGlobalScope('order', function (Builder $builder) { + $builder->orderBy('updated_at', 'desc'); + }); + } + + public function getEmailVerifiedAttribute(): bool + { + return $this->hasVerifiedEmail(); + } + + + /** + * @return HasMany + */ + public function address(): HasMany + { + return $this->hasMany(Address::class, 'customer_id'); + } + + /** + * @return HasMany + */ + public function conversations(): HasMany + { + return $this->hasMany(Conversation::class, 'user_id'); + } + + /** + * @return HasMany + */ + public function orders(): HasMany + { + return $this->hasMany(Order::class, 'customer_id')->with(['products.variation_options', 'reviews']); + } + + /** + * @return HasOne + */ + public function profile(): HasOne + { + return $this->hasOne(Profile::class, 'customer_id'); + } + + /** + * @return HasOne + */ + public function wallet(): HasOne + { + return $this->hasOne(Wallet::class, 'customer_id'); + } + + /** + * @return HasMany + */ + public function shops(): HasMany + { + return $this->hasMany(Shop::class, 'owner_id'); + } + + /** + * @return HasMany + */ + public function refunds(): HasMany + { + return $this->hasMany(Shop::class, 'customer_id'); + } + + /** + * @return BelongsTo + */ + public function managed_shop(): BelongsTo + { + return $this->belongsTo(Shop::class, 'shop_id'); + } + + /** + * @return HasMany + */ + public function providers(): HasMany + { + return $this->hasMany(Provider::class, 'user_id', 'id'); + } + + /** + * @return HasMany + */ + public function reviews(): HasMany + { + return $this->hasMany(Review::class, 'user_id'); + } + + /** + * @return HasMany + */ + public function questions(): HasMany + { + return $this->hasMany(Question::class, 'user_id'); + } + + /** + * @return HasMany + */ + public function ordered_files(): HasMany + { + return $this->hasMany(OrderedFile::class, 'customer_id'); + } + + /** + * Follow shop + * + * @return BelongsToMany + */ + public function follow_shops(): BelongsToMany + { + return $this->belongsToMany(Shop::class, 'user_shop'); + } + + + /** + * Follow shop + * + * @return HasMany + */ + public function payment_gateways(): HasMany + { + return $this->HasMany(PaymentGateway::class, 'user_id'); + } + + /** + * faqs + * + * @return HasMany + */ + public function faqs(): HasMany + { + return $this->HasMany(Faqs::class); + } + + /** + * terms and conditions + * + * @return HasMany + */ + public function terms_and_conditions(): HasMany + { + return $this->HasMany(TermsAndConditions::class); + } + + /** + * coupons + * + * @return HasMany + */ + public function coupon(): HasMany + { + return $this->HasMany(Coupon::class); + } + + public function loadLastOrder() + { + $data = $this->orders()->whereNull('parent_id') + ->where('order_status', OrderStatus::COMPLETED) + ->latest()->first(); + $this->setRelation('last_order', $data); + + return $this; + } +} diff --git a/packages/marvel/src/Database/Models/Variation.php b/packages/marvel/src/Database/Models/Variation.php new file mode 100644 index 0000000..90a6f6e --- /dev/null +++ b/packages/marvel/src/Database/Models/Variation.php @@ -0,0 +1,78 @@ + 'json', + 'image' => 'json', + ]; + + protected function sku(): Attribute + { + return Attribute::make( + get: fn (string $value) => $value, + set: fn (string $value) => globalSlugify((string)$value, Variation::class, 'sku', '_'), + ); + } + + /** + * Get the user's full name. + * + * @return string + */ + public function getBlockedDatesAttribute() + { + return $this->getBlockedDates(); + } + + function getBlockedDates() + { + $_blockedDates = $this->fetchBlockedDatesForAVariation(); + $_flatBlockedDates = []; + foreach ($_blockedDates as $date) { + $from = Carbon::parse($date->from); + $to = Carbon::parse($date->to); + $dateRange = CarbonPeriod::create($from, $to); + $_blockedDates = $dateRange->toArray(); + unset($_blockedDates[count($_blockedDates) - 1]); + $_flatBlockedDates = array_unique(array_merge($_flatBlockedDates, $_blockedDates)); + } + return $_flatBlockedDates; + } + + public function fetchBlockedDatesForAVariation() + { + return Availability::where('bookable_id', $this->id)->where('bookable_type', 'Marvel\Database\Models\Variation')->whereDate('to', '>=', Carbon::now())->get(); + } + + public function digital_file() + { + return $this->morphOne(DigitalFile::class, 'fileable'); + } + + public function availabilities() + { + return $this->morphMany(Availability::class, 'bookable'); + } + + public function product() + { + return $this->belongsTo(Product::class, 'product_id'); + } +} diff --git a/packages/marvel/src/Database/Models/Wallet.php b/packages/marvel/src/Database/Models/Wallet.php new file mode 100644 index 0000000..0c99463 --- /dev/null +++ b/packages/marvel/src/Database/Models/Wallet.php @@ -0,0 +1,23 @@ +belongsTo(User::class, 'customer_id'); + } +} diff --git a/packages/marvel/src/Database/Models/Wishlist.php b/packages/marvel/src/Database/Models/Wishlist.php new file mode 100644 index 0000000..14755e2 --- /dev/null +++ b/packages/marvel/src/Database/Models/Wishlist.php @@ -0,0 +1,36 @@ +belongsTo(Product::class); + } + + function veriation() + { + return $this->belongsTo(Variation::class); + } + + /** + * Get the user that owns the comment. + */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class); + } +} diff --git a/packages/marvel/src/Database/Models/Withdraw.php b/packages/marvel/src/Database/Models/Withdraw.php new file mode 100644 index 0000000..d111e05 --- /dev/null +++ b/packages/marvel/src/Database/Models/Withdraw.php @@ -0,0 +1,23 @@ +belongsTo(Shop::class, 'shop_id'); + } +} diff --git a/packages/marvel/src/Database/Repositories/AbusiveReportRepository.php b/packages/marvel/src/Database/Repositories/AbusiveReportRepository.php new file mode 100644 index 0000000..5263195 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/AbusiveReportRepository.php @@ -0,0 +1,64 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return AbusiveReport::class; + } + /** + * @param $request + * @return LengthAwarePaginator|JsonResponse|Collection|mixed + */ + public function storeAbusiveReport($request, $model) + { + try { + $model_id = $request['model_id']; + $model_type = $request['model_type']; + $model_name = "Marvel\\Database\\Models\\{$model_type}"; + $isAbusiveReportExist = $this->where('model_id', $model_id)->where('model_type', $model_name)->exists(); + if ($isAbusiveReportExist) { + throw new BadRequestHttpException(YOU_HAVE_ALREADY_GIVEN_ABUSIVE_REPORT_FOR_THIS); + } + return $model->abusive_reports()->create($request->only($this->dataArray)); + } catch (Exception $th) { + throw new HttpException(400, COULD_NOT_CREATE_THE_RESOURCE); + } + } +} diff --git a/packages/marvel/src/Database/Repositories/AddressRepository.php b/packages/marvel/src/Database/Repositories/AddressRepository.php new file mode 100644 index 0000000..a51db0a --- /dev/null +++ b/packages/marvel/src/Database/Repositories/AddressRepository.php @@ -0,0 +1,17 @@ + 'like', + 'shop_id', + 'language', + ]; + + protected $dataArray = [ + 'name', + 'slug', + 'shop_id', + 'language', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + /** + * Configure the Model + **/ + public function model() + { + return Attribute::class; + } + + public function storeAttribute($request) + { + try { + $request['slug'] = $this->makeSlug($request); + $attribute = $this->create($request->only($this->dataArray)); + if (isset($request['values']) && count($request['values'])) { + $attribute->values()->createMany($request['values']); + } + return $attribute; + } catch (\Throwable $th) { + throw new HttpException(400, COULD_NOT_CREATE_THE_RESOURCE); + } + } + + public function updateAttribute($request, $attribute) + { + try { + if (isset($request['values'])) { + foreach ($attribute->values as $value) { + $key = array_search($value->id, array_column($request['values'], 'id')); + if (!$key && $key !== 0) { + AttributeValue::findOrFail($value->id)->delete(); + } + } + foreach ($request['values'] as $value) { + if (isset($value['id'])) { + AttributeValue::findOrFail($value['id'])->update($value); + } else { + $value['attribute_id'] = $attribute->id; + AttributeValue::create($value); + } + } + } + $attribute->update($request->only($this->dataArray)); + return $this->with('values')->findOrFail($attribute->id); + } catch (\Throwable $th) { + throw new HttpException(400, COULD_NOT_UPDATE_THE_RESOURCE); + } + } +} diff --git a/packages/marvel/src/Database/Repositories/AttributeValueRepository.php b/packages/marvel/src/Database/Repositories/AttributeValueRepository.php new file mode 100644 index 0000000..3cf068f --- /dev/null +++ b/packages/marvel/src/Database/Repositories/AttributeValueRepository.php @@ -0,0 +1,37 @@ + 'like', + 'shop_id', + 'language', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + /** + * Configure the Model + **/ + public function model() + { + return AttributeValue::class; + } +} diff --git a/packages/marvel/src/Database/Repositories/AuthorRepository.php b/packages/marvel/src/Database/Repositories/AuthorRepository.php new file mode 100644 index 0000000..78546f7 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/AuthorRepository.php @@ -0,0 +1,81 @@ + 'like', + 'is_approved', + 'language', + ]; + + protected $dataArray = [ + 'name', + 'slug', + 'is_approved', + 'image', + 'cover_image', + 'bio', + 'quote', + 'born', + 'death', + 'languages', + 'socials', + 'language', + ]; + + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Author::class; + } + + public function storeAuthor($request) + { + $data = $request->only($this->dataArray); + $data['slug'] = $this->makeSlug($request); + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $data['is_approved'] = true; + } else { + $data['is_approved'] = false; + } + return $this->create($data); + } + + public function updateAuthor($request, $author) + { + $data = $request->only($this->dataArray); + if (!$request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $data['is_approved'] = false; + } + $data = $request->only($this->dataArray); + if (!empty($request->slug) && $request->slug != $author['slug']) { + $data['slug'] = $this->makeSlug($request); + } + $author->update($data); + return $this->findOrFail($author->id); + } +} diff --git a/packages/marvel/src/Database/Repositories/AvailabilityRepository.php b/packages/marvel/src/Database/Repositories/AvailabilityRepository.php new file mode 100644 index 0000000..993b6bd --- /dev/null +++ b/packages/marvel/src/Database/Repositories/AvailabilityRepository.php @@ -0,0 +1,39 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return Availability::class; + } +} diff --git a/packages/marvel/src/Database/Repositories/BaseRepository.php b/packages/marvel/src/Database/Repositories/BaseRepository.php new file mode 100644 index 0000000..7d61757 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/BaseRepository.php @@ -0,0 +1,251 @@ +findByField($field, $value, $columns = ['*']); + + return $model->first(); + } + + + /** + * The function finds a model by a specific field and value, and throws an exception if it is not + * found. + * + * @param string field The "field" parameter is used to specify the column name in the database table that + * you want to search for. It is typically a string value representing the name of the column. + * @param mixed value The "value" parameter is the value that you want to search for in the specified + * field. It is used to find a specific record in the database table based on the given field and + * value. + * @param array columns The "columns" parameter is an optional parameter that specifies which columns + * from the database table should be retrieved. By default, it is set to ['*'], which means all + * columns will be retrieved. However, you can pass an array of specific column names to retrieve + * only those columns. + * + * @return \Illuminate\Database\Eloquent\Model first model that matches the given field and value. + */ + public function findOneByFieldOrFail($field, $value = null, $columns = ['*']) + { + $model = $this->findByField($field, $value, $columns = ['*']); + if (!$model->first()) { + throw new MarvelException(NOT_FOUND); + } + return $model->first(); + } + + + /** + * Find data by field and value + * + * @param string $field + * @param string $value + * @param array $columns + * @return mixed + */ + public function findOneWhere(array $where, $columns = ['*']) + { + $model = $this->findWhere($where, $columns); + + return $model->first(); + } + + /** + * Find data by id + * + * @param int $id + * @param array $columns + * @return mixed + */ + public function find($id, $columns = ['*']) + { + $this->applyCriteria(); + $this->applyScope(); + $model = $this->model->find($id, $columns); + $this->resetModel(); + + return $this->parserResult($model); + } + + /** + * Find data by id + * + * @param int $id + * @param array $columns + * @return mixed + */ + public function findOrFail($id, $columns = ['*']) + { + $this->applyCriteria(); + $this->applyScope(); + $model = $this->model->findOrFail($id, $columns); + $this->resetModel(); + + return $this->parserResult($model); + } + + /** + * Count results of repository + * + * @param array $where + * @param string $columns + * @return int + */ + public function count(array $where = [], $columns = '*') + { + $this->applyCriteria(); + $this->applyScope(); + + if ($where) { + $this->applyConditions($where); + } + + $result = $this->model->count($columns); + $this->resetModel(); + $this->resetScope(); + + return $result; + } + + /** + * @param string $columns + * @return mixed + */ + public function sum($columns) + { + $this->applyCriteria(); + $this->applyScope(); + + $sum = $this->model->sum($columns); + $this->resetModel(); + + return $sum; + } + + /** + * @param string $columns + * @return mixed + */ + public function avg($columns) + { + $this->applyCriteria(); + $this->applyScope(); + + $avg = $this->model->avg($columns); + $this->resetModel(); + + return $avg; + } + + /** + * @return mixed + */ + public function getModel() + { + return $this->model; + } + + public function hasPermission($user, $shop_id = null) + { + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + return true; + } + try { + $shop = Shop::findOrFail($shop_id); + } catch (Exception $e) { + return false; + } + if (!$shop->is_active) { + throw new MarvelException(SHOP_NOT_APPROVED); + } + if ($user && $user->hasPermissionTo(Permission::STORE_OWNER)) { + if ($shop->owner_id === $user->id) { + return true; + } + } elseif ($user && $user->hasPermissionTo(Permission::STAFF)) { + if ($shop->staffs->contains($user)) { + return true; + } + } + return false; + } + + function csvToArray($filename = '', $delimiter = ',') + { + if (!file_exists($filename) || !is_readable($filename)) { + return false; + } + $header = null; + $data = array(); + if (($handle = fopen($filename, 'r')) !== false) { + while (($row = fgetcsv($handle, 0, $delimiter)) !== false) { + if (!$header) { + $exclude = ['id', 'slug', 'deleted_at', 'created_at', 'updated_at', 'shipping_class_id']; + $row = array_diff($row, $exclude); + $header = $row; + } else { + $data[] = array_combine($header, $row); + } + } + fclose($handle); + } + + return $data; + } + + + /** + * It takes a request object, and a key, and returns a slug. + * + * @param Request request The request object + * @param string key The key of the request that you want to slugify. + * + * @return string A string + */ + public function makeSlug(Request $request, string $key = '', ?int $update = null): string + { + $slugText = match (true) { + !empty($request->slug) => $request->slug, + !empty($request->name) => $request->name, + !empty($request->title) => $request->title, + !empty($request[$key]) => $request[$key], + empty($request->slug) => 'auto-generated-string', + }; + if (empty($key)) { + return globalSlugify(slugText: $slugText, model: $this->model(), update: $update); + } + return globalSlugify(slugText: $request[$key], model: $this->model(), key: $key, update: $update); + } + + public function findBySlugOrId(int | string $value, string $language = DEFAULT_LANGUAGE) + { + return match (true) { + is_numeric($value) => $this->where('id', $value)->where('language', $language)->firstOrFail(), + is_string($value) => $this->where('slug', $value)->where('language', $language)->firstOrFail(), + }; + } +} diff --git a/packages/marvel/src/Database/Repositories/BecameSellersRepository.php b/packages/marvel/src/Database/Repositories/BecameSellersRepository.php new file mode 100644 index 0000000..b508e33 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/BecameSellersRepository.php @@ -0,0 +1,44 @@ +getAppSettingsData(); + // return [ + // 'app_settings' => $appData, + // ]; + // } + + // private function getAppSettingsData(): array + // { + // $config = new MarvelVerification(); + // $apiData = $config->jsonSerialize(); + // try { + // $licenseKey = $config->getPrivateKey(); + // $last_checking_time = $config->getLastCheckingTime() ?? Carbon::now(); + // $lastCheckingTimeDifferenceFromNow = Carbon::parse($last_checking_time)->diffInMinutes(Carbon::now()); + // if ($lastCheckingTimeDifferenceFromNow > 20) { + // $apiData = $config->verify($licenseKey)->jsonSerialize(); + // } + // } catch (Exception $e) { + // } + // return [ + // 'last_checking_time' => Carbon::now(), + // 'trust' => $apiData['trust'] ?? false, + // ]; + // } +} diff --git a/packages/marvel/src/Database/Repositories/CategoryRepository.php b/packages/marvel/src/Database/Repositories/CategoryRepository.php new file mode 100644 index 0000000..e18c5ac --- /dev/null +++ b/packages/marvel/src/Database/Repositories/CategoryRepository.php @@ -0,0 +1,71 @@ + 'like', + 'parent', + 'language', +// 'type.slug', + ]; + + protected $dataArray = [ + 'name', + 'slug', + 'type_id', + 'icon', + 'image', + 'details', + 'banner_image', + 'language', + 'parent', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return Category::class; + } + + public function saveCategory(Request $request) { + $data = $request->only($this->dataArray); + $data['slug'] = $this->makeSlug($request); + return $this->create($data); + } + + public function updateCategory($request, $category) + { + $data = $request->only($this->dataArray); + if (!empty($request->slug) && $request->slug != $category['slug']) { + $data['slug'] = $this->makeSlug($request); + } + $category->update($data); + return $this->findOrFail($category->id); + } +} diff --git a/packages/marvel/src/Database/Repositories/CheckoutRepository.php b/packages/marvel/src/Database/Repositories/CheckoutRepository.php new file mode 100644 index 0000000..4a8f552 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/CheckoutRepository.php @@ -0,0 +1,217 @@ +customer_id); + } catch (\Throwable $th) { + throw new ModelNotFoundException(NOT_FOUND); + } + } else { + $user = $request->user() ?? null; + } + $wallet = $user->wallet ?? null; + $settings = Settings::getData(); + $minimumOrderAmount = isset($settings['options']['minimumOrderAmount']) ? $settings['options']['minimumOrderAmount'] : 0; + $unavailable_products = $this->checkStock($request['products']); + $amount = $this->getOrderAmount($request, $unavailable_products); + $shipping_charge = !empty($settings['options']['freeShipping']) && $settings['options']['freeShippingAmount'] <= $amount ? 0 : $this->calculateShippingCharge($request, $amount); + $tax = $this->calculateTax($request, $shipping_charge, $amount); + $total = $amount + $tax + $shipping_charge; + if ($total < $minimumOrderAmount) { + throw new HttpException(400, 'Minimum order amount is ' . $minimumOrderAmount); + } + return [ + 'total_tax' => $tax, + 'shipping_charge' => $shipping_charge, + 'unavailable_products' => $unavailable_products, + 'wallet_amount' => isset($wallet->available_points) ? $wallet->available_points : 0, + 'wallet_currency' => isset($wallet->available_points) ? $this->walletPointsToCurrency($wallet->available_points) : 0 + ]; + } + + public function getOrderAmount($request, $unavailable_products) + { + if (count($unavailable_products)) { + return $this->calculateAmountWithAvailable($request['products'], $unavailable_products); + } + return $request['amount']; + } + + public function calculateTax($request, $shipping_charge, $amount) + { + $tax_class = $this->getTaxClass($request); + if ($tax_class) { + return $this->getTotalTax($amount, $tax_class); + } + return $tax_class; + } + + public function calculateAmountWithAvailable($products, $unavailable_products) + { + $amount = 0; + foreach ($products as $product) { + if (!in_array($product['product_id'], $unavailable_products)) { + $amount += $product['subtotal']; + } + } + return $amount; + } + + public function calculateShippingCharge($request, $amount) + { + try { + $ordered_products = $request['products']; + $physical_products = Product::whereIn('id', Arr::pluck($ordered_products, 'product_id'))->where('is_digital', false)->get(); + if (!count($physical_products)) { + return 0; + } + $settings = Settings::getData(); + $class_id = $settings['options']['shippingClass']; + if ($class_id) { + $shipping_class = Shipping::find($class_id); + return $this->getShippingCharge($shipping_class, $amount); + } else { + return $this->calculateShippingChargeByProduct($request['products']); + } + } catch (\Throwable $th) { + return 0; + } + } + + protected function calculateShippingChargeByProduct($products) + { + $total_charge = 0; + foreach ($products as $product) { + $total_charge += $this->calculateEachProductCharge($product['product_id'], $product['subtotal']); + } + return $total_charge; + } + + protected function calculateEachProductCharge($id, $amount) + { + $product = Product::with('shipping')->findOrFail($id); + if (isset($product->shipping)) { + return $this->getShippingCharge($product->shipping, $amount); + } + return 0; + } + + public function checkStock($products) + { + $unavailable_products = []; + foreach ($products as $product) { + if (isset($product['variation_option_id'])) { + $is_not_in_stock = $this->isVariationInStock($product['variation_option_id'], $product['order_quantity']); + } else { + $is_not_in_stock = $this->isInStock($product['product_id'], $product['order_quantity']); + } + if ($is_not_in_stock) { + $unavailable_products[] = $is_not_in_stock; + } + } + return $unavailable_products; + } + + protected function isInStock($id, $order_quantity) + { + try { + $product = Product::findOrFail($id); + if ($order_quantity > $product->quantity) { + return $id; + } + return false; + } catch (Exception $e) { + return false; + } + } + + protected function isVariationInStock($variation_id, $order_quantity) + { + try { + $variationOption = Variation::findOrFail($variation_id); + if ($order_quantity > $variationOption->quantity) { + return $variationOption->product_id; + } + return false; + } catch (Exception $e) { + return false; + } + } + + protected function getShippingCharge($shipping_class, $amount) + { + switch ($shipping_class->type) { + case 'fixed': + return $shipping_class->amount; + break; + case 'percentage': + return ($shipping_class->amount * $amount) / 100; + break; + default: + return 0; + } + } + + protected function getTaxClass($request) + { + try { + $settings = Settings::getData(); + + // Get tax settings from settings + $tax_class = $settings['options']['taxClass']; + return Tax::findOrFail($tax_class); + } catch (\Throwable $th) { + return 0; + } + + // switch ($tax_type) { + // case 'global': + // return Tax::where('is_global', '=', true)->first(); + // break; + // case 'billing_address': + // $billing_address = $request['billing_address']; + // return $this->getTaxClassByAddress($billing_address); + // break; + // case 'shipping_address': + // $shipping_address = $request['shipping_address']; + // return $this->getTaxClassByAddress($shipping_address); + // break; + // } + } + + protected function getTaxClassByAddress($address) + { + return Tax::where('country', '=', $address['country']) + ->orWhere('state', '=', $address['state']) + ->orWhere('city', '=', $address['city']) + ->orWhere('zip', '=', $address['zip']) + ->orderBy('priority', 'asc') + ->first(); + } + + protected function getTotalTax($amount, $tax_class) + { + return ($amount * $tax_class->rate) / 100; + } +} diff --git a/packages/marvel/src/Database/Repositories/CommissionRepository.php b/packages/marvel/src/Database/Repositories/CommissionRepository.php new file mode 100644 index 0000000..b56a984 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/CommissionRepository.php @@ -0,0 +1,64 @@ +deleteCommission($commissionItems, $language); + + foreach ($commissionItems as $key => $commissionItem) { + $commissionExists = $this->where('id', $commissionItem['id'])->exists(); + + $commissionData = [ + "level" => $commissionItem['level'], + "sub_level" => $commissionItem['sub_level'], + "description" => $commissionItem['description'], + "min_balance" => $commissionItem['min_balance'], + "max_balance" => $commissionItem['max_balance'], + "commission" => $commissionItem['commission'], + "image" => json_encode($commissionItem['image']), + 'language' => $language, + "updated_at" => Carbon::now(), + ]; + + if (!$commissionExists) { + $commissionData['created_at'] = Carbon::now(); + $this->insert($commissionData); + } else { + $this->where('id', $commissionItem['id'])->update($commissionData); + } + } + } + + public function deleteCommission($commissionItems, $language) { + // Get all commission IDs from the request + $commissionIdsInRequest = array_column($commissionItems, 'id'); + + // Get all commission IDs from the database for the given language + $existingCommissionIds = $this->where('language', $language)->pluck('id')->toArray(); + + // Find commissions to delete (exist in DB but not in request) + $commissionsToDelete = array_diff($existingCommissionIds, $commissionIdsInRequest); + + // Delete commissions that need to be removed + if (!empty($commissionsToDelete)) { + $this->whereIn('id', $commissionsToDelete)->delete(); + } + } + + +} diff --git a/packages/marvel/src/Database/Repositories/ConversationRepository.php b/packages/marvel/src/Database/Repositories/ConversationRepository.php new file mode 100644 index 0000000..6ff2c0b --- /dev/null +++ b/packages/marvel/src/Database/Repositories/ConversationRepository.php @@ -0,0 +1,40 @@ + 'like', + 'user.name' => 'like', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return Conversation::class; + } + +} diff --git a/packages/marvel/src/Database/Repositories/CouponRepository.php b/packages/marvel/src/Database/Repositories/CouponRepository.php new file mode 100644 index 0000000..0806991 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/CouponRepository.php @@ -0,0 +1,147 @@ + 'like', + 'shop_id', + 'language', + + ]; + + protected $dataArray = [ + 'code', + 'language', + 'description', + 'image', + 'type', + 'amount', + 'minimum_cart_amount', + 'active_from', + 'expire_at', + 'target', + 'is_approve', + 'user_id', + 'shop_id', + ]; + + public function getDataArray(): array + { + return $this->dataArray; + } + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + /** + * Configure the Model + **/ + public function model() + { + return Coupon::class; + } + + /** + * storeCoupon + * + * @param mixed $request + * @return mixed + */ + public function storeCoupon(Request $request) + { + try { + $data = $request->only($this->dataArray); + $data['user_id'] = $request->user()->id; + $data['is_approve'] = $request->user()->hasPermissionTo(Permission::SUPER_ADMIN); + return $this->create($data); + } catch (Exception $th) { + throw new MarvelBadRequestException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + public function verifyCoupon(Request $request) + { + $code = $request->code; + $sub_total = $request->sub_total; + $item = $request->item ?? null; + try { + $coupon = $this->findOneByFieldOrFail('code', $code); + $settings = Settings::getData(); + $is_satisfy = $sub_total >= $coupon->minimum_cart_amount; + $is_freeShipping = $settings['options']['freeShipping']; + $freeShippingAmount = $settings['options']['freeShippingAmount']; + $couponShopId = $coupon->shop_id; + $useFreeShipping = $is_freeShipping && $freeShippingAmount <= $sub_total; + + if (!$coupon->is_approve || (empty($request->user()) && $coupon->target)) { + return ["is_valid" => false, "message" => $coupon->is_approve ? THIS_COUPON_CODE_IS_ONLY_FOR_VERIFIED_USERS : THIS_COUPON_CODE_IS_NOT_APPROVED]; + } + + $onlyThisShopProductApplyCoupon = true; + if ($couponShopId && $item) { + $totalCartAmount = array_reduce( + $item, + fn ($sum, $product) => $sum + (isset($product['shop_id']) && $product['shop_id'] == $couponShopId ? $product['price'] * $product['quantity'] : 0), + 0 + ); + + $isLessThanSubtotal = $sub_total >= $totalCartAmount; + + switch ($coupon->type) { + case CouponType::FIXED_COUPON: + $onlyThisShopProductApplyCoupon = $isLessThanSubtotal && $totalCartAmount > $coupon->amount; + break; + case CouponType::PERCENTAGE_COUPON: + $couponPercentageAmount = ($totalCartAmount * $coupon->amount) / 100; + $onlyThisShopProductApplyCoupon = $isLessThanSubtotal && $totalCartAmount > $couponPercentageAmount; + break; + case CouponType::FREE_SHIPPING_COUPON: + $onlyThisShopProductApplyCoupon = $isLessThanSubtotal && $useFreeShipping; + break; + } + } + + if (!$onlyThisShopProductApplyCoupon) { + return ["is_valid" => false, "message" => COUPON_CODE_IS_NOT_APPLICABLE_IN_THIS_SHOP_PRODUCT]; + } + + if ( + $coupon->is_valid && + $useFreeShipping && + $coupon->type == CouponType::FREE_SHIPPING_COUPON + ) { + return ["is_valid" => false, "message" => ALREADY_FREE_SHIPPING_ACTIVATED]; + } elseif ($coupon->is_valid && $is_satisfy && $onlyThisShopProductApplyCoupon) { + return ["is_valid" => true, "coupon" => $coupon]; + } elseif ($coupon->is_valid && !$is_satisfy) { + return ["is_valid" => false, "message" => COUPON_CODE_IS_NOT_APPLICABLE]; + } else { + return ["is_valid" => false, "message" => INVALID_COUPON_CODE]; + } + } catch (\Exception $th) { + return ["is_valid" => false, "message" => INVALID_COUPON_CODE]; + } + } +} diff --git a/packages/marvel/src/Database/Repositories/DeliveryTimeRepository.php b/packages/marvel/src/Database/Repositories/DeliveryTimeRepository.php new file mode 100644 index 0000000..0f38027 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/DeliveryTimeRepository.php @@ -0,0 +1,17 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } +} diff --git a/packages/marvel/src/Database/Repositories/FaqsRepository.php b/packages/marvel/src/Database/Repositories/FaqsRepository.php new file mode 100644 index 0000000..2567789 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/FaqsRepository.php @@ -0,0 +1,102 @@ + 'like', + 'shop_id', + 'language', + 'faq_type', + 'issued_by' + ]; + + /** + * @var array + */ + protected $dataArray = [ + 'faq_title', + 'faq_description', + 'language', + ]; + + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Faqs::class; + } + + + + /** + * storeFaqs + * + * @param mixed $request + * @return void + */ + public function storeFaqs($request) + { + try { + if (isset($request['shop_id'])) { + $shop = Shop::findOrFail($request['shop_id']); + } + + $faqs = []; + $faqs['faq_title'] = $request['faq_title']; + $faqs['faq_description'] = $request['faq_description']; + $faqs['user_id'] = $request->user()->id; + $faqs['shop_id'] = isset($request['shop_id']) ? $request['shop_id'] : null; + $faqs['faq_type'] = isset($request['shop_id']) ? 'shop' : 'global'; + $faqs['issued_by'] = isset($request['shop_id']) ? $shop->name : 'Super Admin'; + $faqs['language'] = $request['language'] ?? DEFAULT_LANGUAGE; + + $this->create($faqs); + return $faqs; + } catch (Exception $th) { + throw new Exception(SOMETHING_WENT_WRONG, $th->getMessage()); + } + } + + + /** + * updateFaqs + * + * @param mixed $request + * @param mixed $faqs + * @return void + */ + public function updateFaqs(Request $request, Faqs $faqs) + { + try { + $faqs->update($request->only($this->dataArray)); + return $faqs; + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } +} diff --git a/packages/marvel/src/Database/Repositories/FeedbackRepository.php b/packages/marvel/src/Database/Repositories/FeedbackRepository.php new file mode 100644 index 0000000..cb9b0a8 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/FeedbackRepository.php @@ -0,0 +1,29 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Feedback::class; + } +} diff --git a/packages/marvel/src/Database/Repositories/FlashSaleRepository.php b/packages/marvel/src/Database/Repositories/FlashSaleRepository.php new file mode 100644 index 0000000..2571312 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/FlashSaleRepository.php @@ -0,0 +1,161 @@ + 'like', + 'language', + 'slug' + ]; + + /** + * @var array + */ + protected $dataArray = [ + 'title', + 'description', + 'start_date', + 'end_date', + 'language', + 'slug', + 'image', + 'cover_image', + 'rate', + 'type', + 'sale_status', + 'sale_builder' + ]; + + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return FlashSale::class; + } + + + + /** + * storeFlashSale + * + * @param mixed $request + * @return void + */ + public function storeFlashSale($request) + { + try { + // only admin can create flash deals + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $data = $request->only($this->dataArray); + $flash_sale = $this->create($data); + if (isset($request['sale_builder']['product_ids'])) { + $flash_sale->products()->attach($request['sale_builder']['product_ids']); + $this->setProductInFlashSale($request['sale_builder']['product_ids']); + } + return $flash_sale; + } + + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (Exception $th) { + throw new Exception(SOMETHING_WENT_WRONG, $th->getMessage()); + } + } + + + /** + * updateFlashSale + * + * @param mixed $request + * @param mixed $id + * @return void + */ + public function updateFlashSale(Request $request, $id) + { + try { + // only admin can update flash deals + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $flash_sale = $this->findOrFail($id); + + $data = $request->only($this->dataArray); + if (isset($request['sale_builder']['product_ids'])) { + $flash_sale->products()->sync($request['sale_builder']['product_ids']); + $this->setProductInFlashSale($request['sale_builder']['product_ids']); + } + + if ($flash_sale['sale_builder']['product_ids'] != $request['sale_builder']['product_ids']) { + $this->unsetProductFromFlashSale($flash_sale['sale_builder']['product_ids'], $request['sale_builder']['product_ids']); + } + + $flash_sale->update($data); + return $flash_sale; + } + + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + /** + * setProductInFlashSale + * + * @param array $product_ids + * @return void + */ + public function setProductInFlashSale($product_ids) + { + foreach ($product_ids as $key => $product_id) { + $product = Product::findOrFail($product_id); + $product->in_flash_sale = true; + $product->save(); + } + } + + + /** + * unsetProductFromFlashSale + * + * @param array $previous_list + * @param array $new_list + * @return void + */ + public function unsetProductFromFlashSale($previous_list, $new_list) + { + $final_list = array_diff($previous_list, $new_list); + + if (isset($final_list)) { + foreach ($final_list as $key => $product_id) { + $product = Product::findOrFail($product_id); + $product->in_flash_sale = false; + $product->save(); + } + } + } +} diff --git a/packages/marvel/src/Database/Repositories/FlashSaleVendorRequestRepository.php b/packages/marvel/src/Database/Repositories/FlashSaleVendorRequestRepository.php new file mode 100644 index 0000000..50a1ebb --- /dev/null +++ b/packages/marvel/src/Database/Repositories/FlashSaleVendorRequestRepository.php @@ -0,0 +1,194 @@ + 'like', + 'request_status', + ]; + + /** + * @var array + */ + protected $dataArray = [ + 'language', + 'title', + 'note', + 'flash_sale_id' + ]; + + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return FlashSaleRequests::class; + } + + + /** + * storeFlashSaleRequest + * + * @param mixed $request + * @return void + */ + public function storeFlashSaleRequest($request) + { + try { + + $data = $request->only($this->dataArray); + $data['request_status'] = false; + $flash_sale_request = $this->create($data); + if (isset($request['requested_product_ids'])) { + $flash_sale_request->products()->attach($request['requested_product_ids']); + } + return $flash_sale_request; + } catch (Exception $th) { + throw new Exception(SOMETHING_WENT_WRONG, $th->getMessage()); + } + } + + + public function updateFlashSaleRequest($request, $id) + { + try { + $flash_sale_request = $this->findOrFail($id); + + $data = $request->only($this->dataArray); + $data['request_status'] = false; + if (isset($request['requested_product_ids'])) { + $flash_sale_request->products()->sync($request['requested_product_ids']); + } + + // if ($flash_sale_request['sale_builder']['product_ids'] != $request['sale_builder']['product_ids']) { + // $this->unsetProductFromFlashSale($flash_sale_request['sale_builder']['product_ids'], $request['sale_builder']['product_ids']); + // } + + $flash_sale_request->update($data); + return $flash_sale_request; + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + + /** + * approveFlashSaleVendorRequestFunc + * + * @param string $id + * @return void + */ + public function approveFlashSaleVendorRequestFunc($id) + { + try { + $flash_sale_request = $this->findOrFail($id); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + $flash_sale_request->request_status = true; + $products = $flash_sale_request->products; + // $flash_sale = FlashSale::where("id", "=", $flash_sale_request->flash_sale_id)->with('products')->first(); + + + $attached_products_array = []; + + if (isset($products)) { + $flash_sale = FlashSale::with('products')->findOrFail($flash_sale_request->flash_sale_id); + foreach ($products as $product) { + // Create a new record in the flash_sale_product pivot table + if (!in_array($product->id, $flash_sale->products->pluck('id')->toArray())) { + $flash_sale->products()->attach($flash_sale_request->flash_sale_id, ['product_id' => $product->id]); + } + array_push($attached_products_array, $product->id); + } + } + + + + $flash_sale_request->save(); + + $prepare_flash_sale_data = [ + 'attached_product_ids' => $attached_products_array, + 'requested_flash_sale' => $flash_sale + ]; + + event(new FlashSaleProcessed('append_attached_products', DEFAULT_LANGUAGE, $prepare_flash_sale_data)); + + return $flash_sale_request; + } + + + /** + * disapproveFlashSaleVendorRequestFunc + * + * @param string $id + * @return void + */ + public function disapproveFlashSaleVendorRequestFunc($id) + { + try { + $flash_sale_request = $this->findOrFail($id); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + + $flash_sale_request->request_status = false; + $products = $flash_sale_request->products; + // $flash_sale = FlashSale::where("id", "=", $flash_sale_request->flash_sale_id)->with('products')->first(); + + + $detached_products_array = []; + + if (isset($products)) { + // $flash_sale = FlashSale::with('products')->findOrFail($flash_sale_request->flash_sale_id); + $flash_sale = FlashSale::with('products')->where("id", "=", $flash_sale_request->flash_sale_id)->first(); + foreach ($products as $product) { + // Create a new record in the flash_sale_product pivot table + if (in_array($product->id, $flash_sale->products->pluck('id')->toArray())) { + $flash_sale->products()->detach($product->id); + } + array_push($detached_products_array, $product->id); + } + + $flash_sale->save(); + } + + + $flash_sale_request->save(); + + $prepare_flash_sale_data = [ + 'detached_product_ids' => $detached_products_array, + 'requested_flash_sale' => $flash_sale + ]; + + event(new FlashSaleProcessed('remove_attached_products', DEFAULT_LANGUAGE, $prepare_flash_sale_data)); + + + // $flash_sale_request->save(); + return $flash_sale_request; + } +} diff --git a/packages/marvel/src/Database/Repositories/LanguageRepository.php b/packages/marvel/src/Database/Repositories/LanguageRepository.php new file mode 100644 index 0000000..540f399 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/LanguageRepository.php @@ -0,0 +1,17 @@ + 'like', + 'is_approved', + 'type.slug', + 'language', + + ]; + + protected $dataArray = [ + 'name', + 'slug', + 'image', + 'type_id', + 'is_approved', + 'cover_image', + 'description', + 'socials', + 'website', + 'language', + ]; + + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Manufacturer::class; + } + + public function storeManufacturer($request) + { + $data = $request->only($this->dataArray); + $data['slug'] = $this->makeSlug($request); + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $data['is_approved'] = true; + } else { + $data['is_approved'] = false; + } + return $this->create($data); + } + + public function updateManufacturer($request, $Manufacturer) + { + $data = $request->only($this->dataArray); + if (!empty($request->slug) && $request->slug != $Manufacturer['slug']) { + $data['slug'] = $this->makeSlug($request); + } + $Manufacturer->update($data); + return $this->findOrFail($Manufacturer->id); + } +} diff --git a/packages/marvel/src/Database/Repositories/MessageRepository.php b/packages/marvel/src/Database/Repositories/MessageRepository.php new file mode 100644 index 0000000..731b69c --- /dev/null +++ b/packages/marvel/src/Database/Repositories/MessageRepository.php @@ -0,0 +1,84 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return Message::class; + } + + /** + * @param $request + * @return LengthAwarePaginator|JsonResponse|Collection|mixed + */ + public function storeMessage($request) + { + $type = ''; + $conversation_id = $request->conversation_id; + try { + $conversation = Conversation::findOrFail($conversation_id); + $authorize = [ + 'user' => false, + 'shop' => false + ]; + if ($request->user()->id == $conversation->user_id) { + $authorize['user'] = true; + $type = "shop"; + } + if ( + in_array($conversation->shop_id, $request->user()->shops()->pluck('id')->toArray()) || + $conversation->shop_id === $request->user()->shop_id + ) { + $authorize['shop'] = true; + $type = "user"; + } + if (false === $authorize['user'] && false === $authorize['shop']) { + throw new MarvelException(NOT_AUTHORIZED); + } + + $message = $this->create([ + 'body' => $request->message, + 'conversation_id' => $conversation_id, + 'user_id' => $request->user()->id, + ]); + + $message->conversation->update(['updated_at' => now()]); + + event(new MessageSent($message, $conversation, $type, $request->user())); + + return $message; + } catch (\Exception $e) { + throw new MarvelException(NOT_AUTHORIZED); + } + } +} diff --git a/packages/marvel/src/Database/Repositories/NotifyLogsRepository.php b/packages/marvel/src/Database/Repositories/NotifyLogsRepository.php new file mode 100644 index 0000000..150feaf --- /dev/null +++ b/packages/marvel/src/Database/Repositories/NotifyLogsRepository.php @@ -0,0 +1,41 @@ + 'like', + 'language', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return NotifyLogs::class; + } +} diff --git a/packages/marvel/src/Database/Repositories/OrderRepository.php b/packages/marvel/src/Database/Repositories/OrderRepository.php new file mode 100644 index 0000000..ac6478a --- /dev/null +++ b/packages/marvel/src/Database/Repositories/OrderRepository.php @@ -0,0 +1,577 @@ + 'like', + 'shop_id', + 'language', + ]; + /** + * @var string[] + */ + protected array $dataArray = [ + 'tracking_number', + 'customer_id', + 'shop_id', + 'language', + 'order_status', + 'payment_status', + 'amount', + 'sales_tax', + 'paid_total', + 'total', + 'delivery_time', + 'payment_gateway', + 'altered_payment_gateway', + 'discount', + 'coupon_id', + 'logistics_provider', + 'billing_address', + 'shipping_address', + 'delivery_fee', + 'customer_contact', + 'customer_name', + 'note', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Order::class; + } + + /** + * Store order + * + * @param $request + * @param $settings + * @return LengthAwarePaginator|JsonResponse|Collection|mixed + * @throws Exception + */ + public function storeOrder($request, $settings): mixed + { + $request['tracking_number'] = $this->generateTrackingNumber(); + // $request->merge([ + // 'payable' => $request['paid_total'], // amount to be paid through paymentGateway + // 'wallet_currency' => 0 + // ]); + + $fullWalletOrCODPayment = $request?->isFullWalletPayment ? PaymentGatewayType::FULL_WALLET_PAYMENT : PaymentGatewayType::CASH_ON_DELIVERY; + $payment_gateway_type = !empty($request->payment_gateway) ? $request->payment_gateway : $fullWalletOrCODPayment; + + switch ($payment_gateway_type) { + case PaymentGatewayType::CASH_ON_DELIVERY: + $request['order_status'] = OrderStatus::PROCESSING; + $request['payment_status'] = PaymentStatus::CASH_ON_DELIVERY; + break; + + case PaymentGatewayType::CASH: + $request['order_status'] = OrderStatus::PROCESSING; + $request['payment_status'] = PaymentStatus::CASH; + break; + + // case PaymentGatewayType::FULL_WALLET_PAYMENT: + // $request['order_status'] = OrderStatus::PROCESSING; + // $request['payment_status'] = PaymentStatus::WALLET; + // break; + + default: + $request['order_status'] = OrderStatus::PENDING; + $request['payment_status'] = PaymentStatus::PENDING; + break; + } + + $useWalletPoints = isset($request->use_wallet_points) ? $request->use_wallet_points : false; + if ($request->user() && $request->user()->hasPermissionTo(Permission::SUPER_ADMIN) && isset($request['customer_id'])) { + $request['customer_id'] = $request['customer_id']; + } else { + $request['customer_id'] = $request->user()->id ?? null; + } + try { + $user = User::findOrFail($request['customer_id']); + if ($user) { + $request['customer_name'] = $user->name; + } + } catch (Exception $e) { + $user = null; + } + + if (!$user) { + $settings = Settings::getData($request->language); + if (isset($settings->options['guestCheckout']) && !$settings->options['guestCheckout']) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + } + $request['amount'] = $this->calculateSubtotal($request['products']); + + if (isset($request->coupon_id)) { + try { + $coupon = Coupon::findOrFail($request['coupon_id']); + $request['discount'] = $this->calculateDiscount($coupon, $request['amount']); + } catch (Exception $th) { + throw $th; + } + } + + if (isset($coupon) && $coupon->type === CouponType::FREE_SHIPPING_COUPON) { + $request['delivery_fee'] = 0; + } else { + $request['delivery_fee'] = $request['delivery_fee']; + } + + $request['paid_total'] = $request['amount'] + $request['sales_tax'] + $request['delivery_fee'] - $request['discount']; + $request['total'] = $request['paid_total']; + if (($useWalletPoints || $request->isFullWalletPayment) && $user) { + $wallet = $user->wallet; + $amount = null; + if (isset($wallet->available_points)) { + $amount = round($request['paid_total'], 2) - $this->walletPointsToCurrency($wallet->available_points); + } + + if ($amount !== null && $amount <= 0) { + $request['order_status'] = OrderStatus::COMPLETED; + $request['payment_gateway'] = PaymentGatewayType::FULL_WALLET_PAYMENT; + $request['payment_status'] = PaymentStatus::SUCCESS; + $order = $this->createOrder($request); + $this->storeOrderWalletPoint($request['paid_total'], $order->id); + $this->manageWalletAmount($request['paid_total'], $user->id); + return $order; + } + } else { + $amount = round($request['paid_total'], 2); + } + + $order = $this->createOrder($request); + + if (($useWalletPoints || $request->isFullWalletPayment) && $user) { + $this->storeOrderWalletPoint(round($request['paid_total'], 2) - $amount, $order->id); + $this->manageWalletAmount(round($request['paid_total'], 2), $user->id); + } + + $eligible = $this->checkOrderEligibility(); + if (!$eligible) { + throw new MarvelBadRequestException('COULD_NOT_PROCESS_THE_ORDER_PLEASE_CONTACT_WITH_THE_ADMIN'); + } + // Create Intent + if (!in_array($order->payment_gateway, [ + PaymentGatewayType::CASH, PaymentGatewayType::CASH_ON_DELIVERY, PaymentGatewayType::FULL_WALLET_PAYMENT + ])) { + $order['payment_intent'] = $this->processPaymentIntent($request, $settings); + } + + + if ($payment_gateway_type === PaymentGatewayType::CASH_ON_DELIVERY || $payment_gateway_type === PaymentGatewayType::CASH) { + $this->orderStatusManagementOnCOD($order, OrderStatus::PENDING, OrderStatus::PROCESSING); + } else { + $this->orderStatusManagementOnPayment($order, OrderStatus::PENDING, PaymentStatus::PENDING); + } + + event(new OrderProcessed($order)); + + return $order; + } + + + /** + * updateOrder + * + * @param mixed $request + * @return void + */ + public function updateOrder($request) + { + $order = Order::findOrFail($request->id); + $user = $request->user(); + if (isset($order->shop_id)) { + if ($this->hasPermission($user, $order->shop_id)) { + return $this->changeOrderStatus($order, $request->order_status); + } + } else if ($user->hasPermissionTo(Permission::SUPER_ADMIN)) { + return $this->changeOrderStatus($order, $request->order_status); + } else { + throw new AuthorizationException(NOT_AUTHORIZED); + } + } + + /** + * storeOrderWalletPoint + * + * @param mixed $amount + * @param mixed $order_id + * @return void + */ + public function storeOrderWalletPoint($amount, $order_id) + { + if ($amount > 0) { + OrderWalletPoint::create(['amount' => $amount, 'order_id' => $order_id]); + } + } + + + /** + * manageWalletAmount + * + * @param mixed $total + * @param mixed $customer_id + * @return void + */ + public function manageWalletAmount($total, $customer_id) + { + try { + $total = $this->currencyToWalletPoints($total); + $wallet = Wallet::where('customer_id', $customer_id)->first(); + $available_points = $wallet->available_points - $total >= 0 ? $wallet->available_points - $total : 0; + if ($available_points === 0) { + $spend = $wallet->points_used + $wallet->available_points; + } else { + $spend = $wallet->points_used + $total; + } + $wallet->available_points = $available_points; + $wallet->points_used = $spend; + $wallet->save(); + } catch (Exception $e) { + throw $e; + } + } + + /** + * @param $request + * @return array|LengthAwarePaginator|Collection|mixed + */ + protected function createOrder($request) + { + try { + $orderInput = $request->only($this->dataArray); + $order = $this->create($orderInput); + $products = $this->processProducts($request['products'], $request['customer_id'], $order); + $order->products()->attach($products); + $this->createChildOrder($order->id, $request); + // $this->calculateShopIncome($order); + $invoiceData = $this->createInvoiceDataForEmail($request, $order); + $customer = $request->user() ?? null; + event(new OrderCreated($order, $invoiceData, $customer)); + return $order; + } catch (Exception $e) { + throw $e; + } + } + /** + * This function creates an array of data for an email invoice, including order information, + * settings, translated text, and URL. + * + * @param request This is an HTTP request object that contains information about the current + * request being made to the server. It is used to retrieve data from the request, such as the + * language and whether the text should be displayed right-to-left (RTL). + * @param order The order object that contains information about the order, such as the customer + * details, order items, and total amount. + * + * @return array An array containing order data, settings data, translated text, RTL status, + * language, and a URL. + */ + public function createInvoiceDataForEmail($request, $order): array + { + $language = $request->language ?? DEFAULT_LANGUAGE; + $isRTL = $request->is_rtl ?? false; + + $translatedText = $this->formatInvoiceTranslateText($request->invoice_translated_text); + $settings = Settings::getData($language); + return [ + 'order' => $order, + 'settings' => $settings, + 'translated_text' => $translatedText, + 'is_rtl' => $isRTL, + 'language' => $language, + 'url' => config('shop.shop_url') . '/orders/' . $order->tracking_number + ]; + } + + /** + * calculateShopIncome + * + * @param mixed $parent_order + * @return void + */ + protected function calculateShopIncome($parent_order) + { + foreach ($parent_order->children as $order) { + $balance = Balance::where('shop_id', '=', $order->shop_id)->first(); + $adminCommissionRate = $balance->admin_commission_rate; + $shop_earnings = ($order->total * (100 - $adminCommissionRate)) / 100; + $balance->total_earnings = $balance->total_earnings + $shop_earnings; + $balance->current_balance = $balance->current_balance + $shop_earnings; + $balance->save(); + } + } + + /** + * processProducts + * + * @param mixed $products + * @param mixed $customer_id + * @param mixed $order + * @return void + */ + protected function processProducts($products, $customer_id, $order) + { + foreach ($products as $key => $product) { + if (!isset($product['variation_option_id'])) { + $product['variation_option_id'] = null; + $products[$key] = $product; + } + try { + if ($order->parent_id === null) { + $productData = Product::with('digital_file')->findOrFail($product['product_id']); + + // if rental product + $isRentalProduct = $productData->is_rental; + if ($isRentalProduct) { + $this->processRentalProduct($product, $order->id); + } + + + if ($productData->product_type === ProductType::SIMPLE) { + $this->storeOrderedFile($productData, $product['order_quantity'], $customer_id, $order->tracking_number); + } else if ($productData->product_type === ProductType::VARIABLE) { + $variation_option = Variation::with('digital_file')->findOrFail($product['variation_option_id']); + $this->storeOrderedFile($variation_option, $product['order_quantity'], $customer_id, $order->tracking_number); + } + } + } catch (Exception $e) { + throw $e; + } + } + return $products; + } + + + /** + * storeOrderedFile + * + * @param mixed $item + * @param mixed $order_quantity + * @param mixed $customer_id + * @return void + */ + public function storeOrderedFile($item, $order_quantity, $customer_id, $order_tracking_number) + { + if ($item->is_digital) { + $digital_file = $item->digital_file; + for ($i = 0; $i < $order_quantity; $i++) { + OrderedFile::create([ + 'purchase_key' => Str::random(16), + 'digital_file_id' => $digital_file->id, + 'customer_id' => $customer_id, + 'tracking_number' => $order_tracking_number + ]); + } + } + } + + /** + * processRentalProduct + * + * @param mixed $product + * @param mixed $orderId + * @return void + */ + protected function processRentalProduct($product, $orderId) + { + $product['from'] = Carbon::parse($product['from']); + $product['to'] = Carbon::parse($product['to']); + $product['booking_duration'] = $product['from']->diffAsCarbonInterval($product['to']); + $product['order_id'] = $orderId; + $product['language'] = $orderId; + unset($product['unit_price']); + unset($product['subtotal']); + try { + if ($product['variation_option_id'] === null) { + $productData = Product::findOrFail($product['product_id']); + unset($product['variation_option_id']); + $product['language'] = $productData->language; + if (TRANSLATION_ENABLED) { + $this->processAllTranslatedProducts($productData, $product); + } else { + $productData->availabilities()->create($product); + } + } else { + $variation_option = Variation::findOrFail($product['variation_option_id']); + unset($product['variation_option_id']); + if (TRANSLATION_ENABLED) { + $this->processAllTranslatedVariations($variation_option, $product); + } else { + $variation_option->availabilities()->create($product); + } + } + } catch (\Throwable $th) { + throw new ModelNotFoundException(NOT_FOUND); + } + } + + /** + * processAllTranslatedProducts + * + * @param mixed $product + * @param mixed $orderedItem + * @return void + */ + public function processAllTranslatedProducts($product, $orderedItem) + { + $translatedProducts = Product::where('sku', $product->sku)->get(); + foreach ($translatedProducts as $translatedProduct) { + $orderedItem['language'] = $translatedProduct->language; + $orderedItem['product_id'] = $translatedProduct->id; + $translatedProduct->availabilities()->create($orderedItem); + } + } + + /** + * processAllTranslatedVariations + * + * @param mixed $variation + * @param mixed $orderedItem + * @return void + */ + public function processAllTranslatedVariations($variation, $orderedItem) + { + $translatedVariations = Variation::where('sku', $variation->sku)->get(); + foreach ($translatedVariations as $translatedVariation) { + $orderedItem['language'] = $translatedVariation->language; + $translatedVariation->availabilities()->create($orderedItem); + } + } + + + /** + * createChildOrder + * + * @param mixed $id + * @param mixed $request + * @return void + * @throws Exception + */ + public function createChildOrder($id, $request): void + { + $products = $request->products; + $productsByShop = []; + $language = $request->language ?? DEFAULT_LANGUAGE; + + foreach ($products as $key => $cartProduct) { + $product = Product::findOrFail($cartProduct['product_id']); + $productsByShop[$product->shop_id][] = $cartProduct; + } + + foreach ($productsByShop as $shop_id => $cartProduct) { + $amount = array_sum(array_column($cartProduct, 'subtotal')); + $orderInput = [ + 'tracking_number' => $this->generateTrackingNumber(), + 'shop_id' => $shop_id, + 'order_status' => $request->order_status, + 'payment_status' => $request->payment_status, + 'customer_id' => $request->customer_id, + 'shipping_address' => $request->shipping_address, + 'billing_address' => $request->billing_address, + 'customer_contact' => $request->customer_contact, + 'customer_name' => $request->customer_name, + 'delivery_time' => $request->delivery_time, + 'delivery_fee' => 0, + 'sales_tax' => 0, + 'discount' => 0, + 'parent_id' => $id, + 'amount' => $amount, + 'total' => $amount, + 'paid_total' => $amount, + 'language' => $language, + "payment_gateway" => $request->payment_gateway, + ]; + + $order = $this->create($orderInput); + $order->products()->attach($this->processProducts($cartProduct, $request['customer_id'], $order)); + event(new OrderReceived($order)); + } + } + + /** + * Helper method to generate unique tracking number + * + * @return string + * @throws Exception + */ + public function generateTrackingNumber(): string + { + $today = date('Ymd'); + $trackingNumbers = Order::where('tracking_number', 'like', $today . '%')->pluck('tracking_number'); + + do { + $trackingNumber = $today . random_int(100000, 999999); + } while ($trackingNumbers->contains($trackingNumber)); + + return $trackingNumber; + } + + public function checkOrderEligibility(): bool + { + $settings = Settings::getData(); + $useMustVerifyLicense = isset($settings->options['app_settings']['trust']) ? $settings->options['app_settings']['trust'] : false; + return $useMustVerifyLicense; + } +} diff --git a/packages/marvel/src/Database/Repositories/OwnershipTransferRepository.php b/packages/marvel/src/Database/Repositories/OwnershipTransferRepository.php new file mode 100644 index 0000000..d6b1ddc --- /dev/null +++ b/packages/marvel/src/Database/Repositories/OwnershipTransferRepository.php @@ -0,0 +1,143 @@ + 'like', + 'shop_id', + 'status', + 'from', + 'to' + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return OwnershipTransfer::class; + } + + public function updateOwnershipTransfer(Request $request) + { + $id = $request?->id; + $transferHistory = $this->findOrFail($id); + + $shopId = $transferHistory->shop_id ?? null; + $shop = $transferHistory->shop; + + $currentBalance = $shop->balance?->current_balance; + $totalIncompleteOrders = Order::where('shop_id', $shopId) + ->whereIn( + 'order_status', + [ + OrderStatus::PENDING, + OrderStatus::PROCESSING, + OrderStatus::AT_LOCAL_FACILITY, + OrderStatus::OUT_FOR_DELIVERY + ] + )->count(); + + $nonApprovedWithdrawCount = count(array_filter($shop->withdraws->toArray(), function ($withdraw) { + return $withdraw['status'] !== 'approved'; + })); + + // Required : no running order, all order must be completed. + // Required : balance should be or less than $1.00, then the shop can be transferred. + // Required : no running withdrawal request. + // + // if those 3 above condition is true, then a shop status can be changed. + if ($totalIncompleteOrders || (round($currentBalance, 2) > 1.00) || $nonApprovedWithdrawCount) { + throw new MarvelBadRequestException(COULD_NOT_SETTLE_THE_TRANSITION); + } + $transferHistory->update(['status' => $request['status']]); + return $transferHistory->refresh(); + } + + public function getOwnershipTransferHistory($request) + { + $ownershipTransfer = $this->where('transaction_identifier', '=', $request->transaction_identifier)->with(['shop'])->firstOrFail(); + if ($request->request_view_type === 'detail') { + $orderInfoRelatedToShop = $this->orderInfoRelatedToShop($ownershipTransfer->shop->id) ?? []; + $balanceInfoRelatedToShop = $this->balanceInfoRelatedToShop($ownershipTransfer->shop->id) ?? []; + $refundInfoRelatedToShop = $this->refundInfoRelatedToShop($ownershipTransfer->shop->id) ?? []; + $withdrawInfoRelatedToShop = $this->withdrawInfoRelatedToShop($ownershipTransfer->shop->id) ?? []; + + $ownershipTransfer->setRelation('order_info', $orderInfoRelatedToShop); + $ownershipTransfer->setRelation('balance_info', $balanceInfoRelatedToShop); + $ownershipTransfer->setRelation('refund_info', $refundInfoRelatedToShop); + $ownershipTransfer->setRelation('withdrawal_info', $withdrawInfoRelatedToShop); + } + return $ownershipTransfer; + } + + public function orderInfoRelatedToShop($shop_id) + { + $query = DB::table('orders') + ->whereNotNull('orders.parent_id') + ->whereDate('orders.created_at', '<=', Carbon::now()) + ->where('orders.shop_id', '=', $shop_id) + ->select( + 'orders.order_status', + DB::raw('count(*) as order_count') + ) + ->groupBy('orders.order_status') + ->pluck('order_count', 'order_status'); + + return [ + 'pending' => $query[OrderStatus::PENDING] ?? 0, + 'processing' => $query[OrderStatus::PROCESSING] ?? 0, + 'complete' => $query[OrderStatus::COMPLETED] ?? 0, + 'cancelled' => $query[OrderStatus::CANCELLED] ?? 0, + 'refunded' => $query[OrderStatus::REFUNDED] ?? 0, + 'failed' => $query[OrderStatus::FAILED] ?? 0, + 'localFacility' => $query[OrderStatus::AT_LOCAL_FACILITY] ?? 0, + 'outForDelivery' => $query[OrderStatus::OUT_FOR_DELIVERY] ?? 0, + ]; + } + + public function balanceInfoRelatedToShop($shop_id) + { + $shopBalanceInfo = DB::table('balances')->where('shop_id', '=', $shop_id)->first(); + return $shopBalanceInfo; + } + + public function refundInfoRelatedToShop($shop_id) + { + $shopRefundInfo = DB::table('refunds')->where('shop_id', '=', $shop_id)->get(); + return $shopRefundInfo; + } + + public function withdrawInfoRelatedToShop($shop_id) + { + $shopRefundInfo = DB::table('withdraws')->where('shop_id', '=', $shop_id)->get(); + return $shopRefundInfo; + } +} diff --git a/packages/marvel/src/Database/Repositories/ParticipantRepository.php b/packages/marvel/src/Database/Repositories/ParticipantRepository.php new file mode 100644 index 0000000..f83ca84 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/ParticipantRepository.php @@ -0,0 +1,34 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return Participant::class; + } + +} diff --git a/packages/marvel/src/Database/Repositories/PaymentIntentRepository.php b/packages/marvel/src/Database/Repositories/PaymentIntentRepository.php new file mode 100644 index 0000000..4c912ba --- /dev/null +++ b/packages/marvel/src/Database/Repositories/PaymentIntentRepository.php @@ -0,0 +1,55 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return PaymentIntent::class; + } + + /** + * getPaymentIntent + * + * @param mixed $request + * @param mixed $settings + * @return void + */ + public function getPaymentIntent($request, $settings) + { + return $this->processPaymentIntent($request, $settings); + } +} diff --git a/packages/marvel/src/Database/Repositories/PaymentMethodRepository.php b/packages/marvel/src/Database/Repositories/PaymentMethodRepository.php new file mode 100644 index 0000000..b7f4ea2 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/PaymentMethodRepository.php @@ -0,0 +1,144 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + throw $e; + } + } + + /** + * Configure the Model + **/ + public function model() + { + return PaymentMethod::class; + } + + + /** + * setStripeIntent + * + * @param mixed $request + * @return void + */ + public function setStripeIntent($request) + { + # code... + $customer = $this->createPaymentCustomer($request); + $setupIntent = Payment::setIntent([ + 'customer' => $customer->customer_id, + 'payment_method_types' => ['card'], + 'usage' => 'on_session' + ]); + + return $setupIntent; + } + + + /** + * saveStripeCard + * + * @param mixed $request + * @return PaymentMethod + * @throws Exception + */ + public function saveStripeCard($request) + { + $retrieved_payment_method = Payment::retrievePaymentMethod($request['method_key']); + + if ($this->paymentMethodAlreadyExists($retrieved_payment_method->card->fingerprint)) { + return PaymentMethod::where("fingerprint", "=", $retrieved_payment_method->card->fingerprint)->first(); + } else { + $attached_payment_method = Payment::attachPaymentMethodToCustomer($retrieved_payment_method->id, $request); + return $this->saveCard($attached_payment_method, $request); + } + } + + + + + /** + * storeCards + * + * @param mixed $request + * @param mixed $settings + * @return void + */ + public function storeCards($request) + { + try { + switch ($request['payment_gateway']) { + case 'stripe': + # code... + $retrieved_payment_method = Payment::retrievePaymentMethod($request['method_key']); + if ($this->paymentMethodAlreadyExists($retrieved_payment_method->card->fingerprint)) { + return PaymentMethod::where("fingerprint", "=", $retrieved_payment_method->card->fingerprint)->first(); + } else { + // attach card with customer + $attached_payment_method = Payment::attachPaymentMethodToCustomer($retrieved_payment_method->id, $request); + return $this->saveCard($attached_payment_method, $request); + } + break; + + case 'razorpay': + break; + } + } catch (Exception $e) { + throw new HttpException(400, COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * setDefaultPaymentMethod + * + * @param mixed $request + * @return void + */ + public function setDefaultPaymentMethod($request) + { + $payment_method = PaymentMethod::where('id', '=', $request['method_id'])->firstOrFail(); + /* Updating the default card to false if the payment gateway is stripe. */ + PaymentMethod::where('id', '!=', $request['method_id'])->where([ + 'default_card' => true, + "payment_gateway_id" => $payment_method?->payment_gateway_id, + ])->update(['default_card' => false]); + + $payment_method->default_card = true; + $payment_method->save(); + event(new PaymentMethods($payment_method)); + return $payment_method; + } +} diff --git a/packages/marvel/src/Database/Repositories/ProductRepository.php b/packages/marvel/src/Database/Repositories/ProductRepository.php new file mode 100644 index 0000000..1e99028 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/ProductRepository.php @@ -0,0 +1,758 @@ + 'like', + 'shop_id', + 'status', + 'is_rental', + 'type.slug' => 'in', + 'dropoff_locations.slug' => 'in', + 'pickup_locations.slug' => 'in', + 'persons.slug' => 'in', + 'deposits.slug' => 'in', + 'features.slug' => 'in', + 'categories.slug' => 'in', + 'tags.slug' => 'in', + 'author.slug', + 'manufacturer.slug' => 'in', + 'min_price' => 'between', + 'max_price' => '>=', + 'price' => 'between', + 'language', + 'metas.key', + 'metas.value', + 'product_type', + 'visibility' + ]; + + protected $dataArray = [ + 'name', + 'slug', + 'price', + 'sale_price', + 'max_price', + 'min_price', + 'type_id', + 'author_id', + 'language', + 'manufacturer_id', + 'product_type', + 'quantity', + 'unit', + 'is_digital', + 'is_external', + 'external_product_url', + 'external_product_button_text', + 'description', + 'sku', + 'image', + 'gallery', + 'video', + 'status', + 'height', + 'length', + 'width', + 'in_stock', + 'is_taxable', + 'shop_id', + 'sold_quantity', + 'visibility' + ]; + public function getProductDataArray(): array + { + return $this->dataArray; + } + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Product::class; + } + + + /** + * processFlashSaleProducts + * + * @param Request $request + * @return object + */ + public function processFlashSaleProducts(Request $request, $products_query) + { + $user = $request->user(); + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + + // if condition : during deal data build + // else condition : when he entered into vendor shop & check + if ($request->searchedByUser === 'super_admin_builder') { + + $shop_id = $request->shop_id ?? null; + $author_id = $request->author ?? null; + $manufacturer_id = $request->manufacturer ?? null; + + $products_query = $products_query->where('in_flash_sale', '=', false) + ->where('sale_price', '=', null) + ->whereNotIn('id', function ($query) { + $query->select('product_id')->from('flash_sale_requests_products'); + }) + ->when($shop_id, function ($products_query) use ($shop_id) { + return $products_query->where('shop_id', '=', $shop_id); + }) + ->when($author_id, function ($products_query) use ($author_id) { + return $products_query->where('author_id', '=', $author_id); + }) + ->when($manufacturer_id, function ($products_query) use ($manufacturer_id) { + return $products_query->where('manufacturer_id', '=', $manufacturer_id); + }); + } else { + $products_query = $products_query->where('in_flash_sale', '=', true)->where('shop_id', '=', $request->shop_id); + } + + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + + // if condition : when he want to see shop specific products + // else condition : fetched all deal products of vendor's listed all shops. This can be used in vendor root page route + if ($request->shop_id) { + // if : fetching shop product for building flash sale request + // else : just seeing which products are selected for flash sale of this shop + if ($request->searchedByUser === 'vendor') { + $products_query = $products_query->where('in_flash_sale', '=', false) + ->where('shop_id', '=', $request->shop_id) + ->where('sale_price', '=', null); + } else { + $products_query = $products_query->where('in_flash_sale', '=', true); + } + } else { + $products_query = $products_query->where('in_flash_sale', '=', true)->whereIn('shop_id', $user->shops->pluck('id')); + } + + break; + + case $user->hasPermissionTo(Permission::STAFF): + + // staff can see only his assigned shop's deals product + $products_query = $products_query->where('in_flash_sale', '=', true); + break; + + + case $user->hasPermissionTo(Permission::CUSTOMER): + + // customer can see all the products of a deal + $products_query = $products_query->where('in_flash_sale', '=', true); + break; + } + + return $products_query; + } + + + /** + * storeProduct + * + * @param mixed $request + * @param mixed $setting + * @return void + */ + public function storeProduct($request, $setting) + { + try { + $data = $request->only($this->dataArray); + $data['slug'] = $this->makeSlug($request); + + if ($setting->options["isProductReview"]) { + if ($request->status == ProductStatus::DRAFT) { + $data['status'] = ProductStatus::DRAFT; + } elseif ($request->status == ProductStatus::UNDER_REVIEW) { + $data['status'] = ProductStatus::UNDER_REVIEW; + } else { + throw new HttpException(406, 'The selected status is invalid.'); + } + } + + if ($request->product_type == ProductType::SIMPLE) { + $data['max_price'] = $data['price']; + $data['min_price'] = $data['price']; + } + + $product = $this->create($data); + + if (empty($product->slug) || is_numeric($product->slug)) { + $product->slug = $this->customSlugify($product->name); + } + + if (isset($request['metas'])) { + foreach ($request['metas'] as $value) { + $metas[$value['key']] = $value['value']; + $product->setMeta($metas); + } + } + + if (isset($request['categories'])) { + $product->categories()->attach($request['categories']); + } + if (isset($request['dropoff_locations'])) { + $product->dropoff_locations()->attach($request['dropoff_locations']); + } + if (isset($request['pickup_locations'])) { + $product->pickup_locations()->attach($request['pickup_locations']); + } + if (isset($request['persons'])) { + $product->persons()->attach($request['persons']); + } + if (isset($request['features'])) { + $product->features()->attach($request['features']); + } + if (isset($request['deposits'])) { + $product->deposits()->attach($request['deposits']); + } + if (isset($request['tags'])) { + $product->tags()->attach($request['tags']); + } + if (isset($request['variations'])) { + $product->variations()->attach($request['variations']); + } + if (isset($request['variation_options'])) { + + foreach ($request['variation_options']['upsert'] as $variation_option) { + + if (isset($variation_option['is_digital']) && $variation_option['is_digital']) { + $file = $variation_option['digital_file']; + unset($variation_option['digital_file']); + + unset($variation_option['inform_purchased_customer']); + unset($variation_option['product_update_message']); + } + + $new_variation_option = $product->variation_options()->create($variation_option); + + if (isset($variation_option['is_digital']) && $variation_option['is_digital']) { + $digital_file = $new_variation_option->digital_file()->create($file); + $new_variation_option->update([ + 'digital_file_tracker' => $digital_file->id + ]); + } + } + } + + if (isset($request['is_digital']) && ($request['is_digital'] === true || $request['is_digital'] === 1) && isset($request['digital_file'])) { + $digitalFileArray['attachment_id'] = $request['digital_file']['attachment_id']; + $digitalFileArray['url'] = $request['digital_file']['url']; + $product->digital_file()->create($digitalFileArray); + } + + $product->save(); + return $product; + } catch (Exception $e) { + throw $e; + } + } + + public function checkProductForPublish($request, $product) + { + $status = ''; + if ($product->shop['owner']['id'] == $request->user()->id) { + if ($product->status == ProductStatus::DRAFT || $product->status == ProductStatus::UNDER_REVIEW || $product->status == ProductStatus::REJECTED) { + if ($request->status == ProductStatus::DRAFT) { + $status = ProductStatus::DRAFT; + } elseif ($request->status == ProductStatus::UNDER_REVIEW) { + $status = ProductStatus::UNDER_REVIEW; + } else { + $status = ProductStatus::DRAFT; + } + } elseif ($product->status == ProductStatus::APPROVED || $product->status == ProductStatus::PUBLISH || $product->status == ProductStatus::UNPUBLISH) { + if ($request->status == ProductStatus::PUBLISH) { + $status = ProductStatus::PUBLISH; + } elseif ($request->status == ProductStatus::UNPUBLISH) { + $status = ProductStatus::UNPUBLISH; + } else { + $status = ProductStatus::UNPUBLISH; + } + } + } elseif ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + if ($request->status == ProductStatus::APPROVED) { + $status = ProductStatus::PUBLISH; + event(new ProductReviewApproved($product)); + } elseif ($request->status == ProductStatus::REJECTED) { + $status = ProductStatus::REJECTED; + event(new ProductReviewRejected($product)); + } elseif ($request->status == ProductStatus::PUBLISH) { + return ProductStatus::PUBLISH; + } elseif ($request->status == ProductStatus::UNPUBLISH) { + $status = ProductStatus::UNPUBLISH; + } else { + $status = ProductStatus::REJECTED; + } + } else { + $status = ProductStatus::REJECTED; + } + return $status; + } + + /** + * updateProduct + * + * @param $request + * @param $id + * @param $setting + * @return void + */ + public function updateProduct($request, $id, $setting) + { + try { + $product = $this->findOrFail($id); + + if (is_array($request['metas'])) { + foreach ($request['metas'] as $key => $value) { + $metas[$value['key']] = $value['value']; + $product->setMeta($metas); + } + } + + if (isset($request['categories'])) { + $product->categories()->sync($request['categories']); + } + if (isset($request['tags'])) { + $product->tags()->sync($request['tags']); + } + if (isset($request['dropoff_locations'])) { + $product->dropoff_locations()->sync($request['dropoff_locations']); + } + if (isset($request['pickup_locations'])) { + $product->pickup_locations()->sync($request['pickup_locations']); + } + if (isset($request['variations'])) { + $product->variations()->sync($request['variations']); + } + if (isset($request['persons'])) { + $product->persons()->sync($request['persons']); + } + if (isset($request['features'])) { + $product->features()->sync($request['features']); + } + if (isset($request['deposits'])) { + $product->deposits()->sync($request['deposits']); + } + if (isset($request['digital_file'])) { + $file = $request['digital_file']; + if (isset($file['id'])) { + $product->digital_file()->where('id', $file['id'])->update($file); + } else { + $product->digital_file()->create($file); + } + } + if (isset($request['variation_options'])) { + if (isset($request['variation_options']['upsert'])) { + foreach ($request['variation_options']['upsert'] as $key => $variation) { + + $variation['sale_price'] = isset($variation['sale_price']) ? $variation['sale_price'] : null; + + if (isset($variation['is_digital']) && $variation['is_digital']) { + + $file = $variation['digital_file']; + unset($variation['digital_file']); + unset($variation['inform_purchased_customer']); + unset($variation['product_update_message']); + + if (isset($variation['id'])) { + $product->variation_options()->where('id', $variation['id'])->update($variation); + + try { + $updated_variation = Variation::findOrFail($variation['id']); + } catch (Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + + if (TRANSLATION_ENABLED) { + Variation::where('sku', $updated_variation->sku)->where('id', '=', $updated_variation->id)->update([ + 'price' => $updated_variation->price, + 'sale_price' => $updated_variation->sale_price, + 'quantity' => $updated_variation->quantity, + ]); + } + + + if (isset($updated_variation->digital_file_tracker)) { + if (isset($file['attachment_id'])) { + $updated_variation->digital_file()->where('fileable_id', $updated_variation->id)->update($file); + $updated_digital_file = DigitalFile::where('fileable_id', $updated_variation->id)->first(); + $updated_variation->update([ + 'digital_file_tracker' => $updated_digital_file->id, + ]); + } + } else { + $created_digital_file = $updated_variation->digital_file()->create($file); + $updated_variation->update([ + 'digital_file_tracker' => $created_digital_file->id, + ]); + } + } else { + $new_variation = $product->variation_options()->create($variation); + $digital_file = $new_variation->digital_file()->create($file); + $new_variation->update([ + 'digital_file_tracker' => $digital_file->id + ]); + } + } else { + if (isset($variation['id'])) { + $product->variation_options()->where('id', $variation['id'])->update($variation); + } else { + $product->variation_options()->create($variation); + } + } + } + } + if (isset($request['variation_options']['delete'])) { + foreach ($request['variation_options']['delete'] as $key => $id) { + try { + $product->variation_options()->where('id', $id)->delete(); + } catch (Exception $e) { + // + } + } + } + } + $data = $request->only($this->dataArray); + $data['sale_price'] = isset($request['sale_price']) ? $request['sale_price'] : null; + + if ($setting->options["isProductReview"]) { + $data['status'] = $this->checkProductForPublish($request, $product); + } + + if ($request->product_type == ProductType::VARIABLE) { + $data['price'] = NULL; + $data['sale_price'] = NULL; + $data['sku'] = NULL; + } + if ($request->product_type == ProductType::SIMPLE) { + $data['max_price'] = $data['price']; + $data['min_price'] = $data['price']; + } + + if (!empty($request->slug) && $request->slug != $product->slug) { + $stringifySlug = $this->makeSlug($request); + $data['slug'] = $this->makeSlug($request); + + if (TRANSLATION_ENABLED) { + $this->where('slug', $product->slug)->where('id', '!=', $product->id)->update([ + 'slug' => $stringifySlug + ]); + } + } + + $product->update($data); + if ($product->product_type === ProductType::SIMPLE) { + $product->variations()->delete(); + $product->variation_options()->delete(); + } + $product->save(); + + if (TRANSLATION_ENABLED) { + $this->where('sku', $product->sku)->where('id', '=', $product->id)->update([ + 'price' => $product->price, + 'sale_price' => $product->sale_price, + 'max_price' => $product->max_price, + 'min_price' => $product->min_price, + 'unit' => $product->unit, + 'quantity' => $product->quantity, + ]); + } + + if ($setting->options["enableEmailForDigitalProduct"]) { + if ($request->product_type == 'variable') { + foreach ($request['variation_options']['upsert'] as $variation_data) { + if ($variation_data['inform_purchased_customer']) { + event(new DigitalProductUpdateEvent($product, $request->user(), [ + 'inform_customer' => $variation_data['inform_purchased_customer'], + 'update_message' => $variation_data['product_update_message'] ?? '' + ])); + } + } + } else { + if ($request->inform_purchased_customer) { + event(new DigitalProductUpdateEvent($product, $request->user(), [ + 'inform_customer' => $request->inform_purchased_customer, + 'update_message' => $request->product_update_message + ])); + } + } + } + + return $product; + } catch (Exception $e) { + throw $e; + } + } + + /** + * getBestSellingProducts + * + * @param $request + * @return void + */ + + public function getBestSellingProducts($request) + { + $limit = $request->limit ? $request->limit : 10; + $language = $request->language ?? DEFAULT_LANGUAGE; + $range = !empty($request->range) && $request->range !== 'undefined' ? $request->range : ''; + $type_id = $request->type_id ? $request->type_id : ''; + if (isset($request->type_slug) && empty($type_id)) { + try { + $type = Type::where('slug', $request->type_slug)->where('language', $language)->firstOrFail(); + $type_id = $type->id; + } catch (ModelNotFoundException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + $products_query = Product::leftJoin('order_product', 'order_product.product_id', 'products.id') + ->leftJoin('orders', 'order_product.order_id', '=', 'orders.id') + ->with(['type', 'shop']) + ->selectRaw('products.*, sum(order_product.order_quantity) total_sales') + ->where('orders.parent_id', null) + ->where('orders.order_status', 'order-completed') + ->where('orders.language', $language) + ->groupBy('order_product.product_id') + ->orderBy('total_sales', 'desc'); + + if (isset($request->shop_id)) { + $products_query = $products_query->where('shop_id', "=", $request->shop_id); + } + if ($range) { + $products_query = $products_query->whereDate('created_at', '>', Carbon::now()->subDays($range)); + } + if ($type_id) { + $products_query = $products_query->where('type_id', '=', $type_id); + } + return $products_query->take($limit)->get(); + } + + public function fetchRelated($slug, $limit = 10, $language = DEFAULT_LANGUAGE) + { + try { + $product = $this->findOneByFieldOrFail('slug', $slug); + $categories = $product->categories->pluck('id'); + + return $this->where('language', $language)->whereHas('categories', function ($query) use ($categories) { + $query->whereIn('categories.id', $categories); + })->with('type')->limit($limit)->get(); + } catch (Exception $e) { + return []; + } + } + + public function getUnavailableProducts($from, $to) + { + $_blockedDates = Availability::whereDate('from', '<=', $from) + ->whereDate('to', '>=', $to) + ->get()->groupBy('product_id'); + + $unavailableProducts = []; + + foreach ($_blockedDates as $productId => $date) { + if (!$this->isProductAvailableAt($from, $to, $productId, $date)) { + $unavailableProducts[] = $productId; + } + } + return $unavailableProducts; + } + + public function isProductAvailableAt($from, $to, $productId, $_blockedDates, $requestedQuantity = 1) + { + $quantity = 0; + try { + $product = Product::findOrFail($productId); + } catch (\Throwable $th) { + throw $th; + } + + foreach ($_blockedDates as $singleDate) { + $period = Period::make($singleDate['from'], $singleDate['to'], Precision::DAY, Boundaries::EXCLUDE_END); + $range = Period::make($from, $to, Precision::DAY, Boundaries::EXCLUDE_END); + if ($period->overlapsWith($range)) { + $quantity += $singleDate->order_quantity; + } + } + return $product->quantity - $quantity > $requestedQuantity; + } + + + public function fetchBlockedDatesForAProductInRange($from, $to, $productId) + { + return Availability::where('product_id', $productId)->whereDate('from', '>=', $from)->whereDate('to', '<=', $to)->get(); + } + + public function fetchBlockedDatesForAVariationInRange($from, $to, $variation_id) + { + return Availability::where('bookable_id', $variation_id)->where('bookable_type', 'Marvel\Database\Models\Variation')->whereDate('from', '>=', $from)->whereDate('to', '<=', $to)->get(); + } + + public function isVariationAvailableAt($from, $to, $variationId, $_blockedDates, $requestedQuantity) + { + $quantity = 0; + try { + $variation = Variation::findOrFail($variationId); + } catch (\Throwable $th) { + throw $th; + } + + foreach ($_blockedDates as $singleDate) { + $period = Period::make($singleDate['from'], $singleDate['to'], Precision::DAY, Boundaries::EXCLUDE_END); + $range = Period::make($from, $to, Precision::DAY, Boundaries::EXCLUDE_END); + if ($period->overlapsWith($range)) { + $quantity += $singleDate->order_quantity; + } + } + return $variation->quantity - $quantity >= $requestedQuantity; + } + + + public function calculatePrice($bookedDay, $product_id, $variation_id, $quantity, $persons, $dropoff_location_id, $pickup_location_id, $deposits, $features) + { + $price = 0; + $person_price = 0; + $deposit_price = 0; + $feature_price = 0; + $dropoff_location_price = 0; + $pickup_location_price = 0; + + if ($variation_id) { + $variation_price = $this->calculateVariationPrice($variation_id); + $price += $variation_price * $bookedDay * $quantity; + } else { + $product_price = $this->calculateProductPrice($product_id); + $price += $product_price * $bookedDay * $quantity; + } + if ($dropoff_location_id) { + $dropoff_location_price = $this->calculateLocationPrice($dropoff_location_id); + } + if ($pickup_location_id) { + $pickup_location_price = $this->calculateLocationPrice($pickup_location_id); + } + if ($features) { + $feature_price = $this->calculateResourcePrice($features); + } + if ($persons) { + $person_price = $this->calculateResourcePrice($persons); + } + if ($deposits) { + $deposit_price = $this->calculateResourcePrice($deposits); + } + + return [ + 'totalPrice' => $price + $person_price + $deposit_price + $feature_price + $dropoff_location_price, $pickup_location_price, + 'personPrice' => $person_price, + 'depositPrice' => $deposit_price, + 'featurePrice' => $feature_price, + 'dropoffLocationPrice' => $dropoff_location_price, + 'pickupLocationPrice' => $pickup_location_price + ]; + } + + public function calculateProductPrice($product_id) + { + try { + $product = Product::findOrFail($product_id); + } catch (\Throwable $th) { + throw $th; + } + return $product->sale_price ? $product->sale_price : $product->price; + } + + public function calculateVariationPrice($variation_id) + { + try { + $variation = Variation::findOrFail($variation_id); + } catch (\Throwable $th) { + throw $th; + } + return $variation->sale_price ? $variation->sale_price : $variation->price; + } + + public function calculateLocationPrice($location_id) + { + try { + $location = Resource::findOrFail($location_id); + } catch (\Throwable $th) { + throw $th; + } + return $location->price; + } + + public function calculateResourcePrice($resources) + { + $price = 0; + foreach ($resources as $resource_id) { + try { + $resource = Resource::findOrFail($resource_id); + } catch (\Throwable $th) { + throw $th; + } + if ($resource->price) { + $price += $resource->price; + } + } + return $price; + } + + public function customSlugify($text, string $divider = '-') + { + $slug = preg_replace('~[^\pL\d]+~u', $divider, $text); + $slugCount = Product::where('slug', $slug)->orWhere('slug', 'like', $slug . '%')->count(); + + if (empty($slugCount)) { + return $slug; + } + + return $slug . $divider . $slugCount; + } +} diff --git a/packages/marvel/src/Database/Repositories/ProfileRepository.php b/packages/marvel/src/Database/Repositories/ProfileRepository.php new file mode 100644 index 0000000..cecf830 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/ProfileRepository.php @@ -0,0 +1,36 @@ + 'like', + 'customer.email' => 'like', + 'customer.name' => 'like', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Profile::class; + } +} diff --git a/packages/marvel/src/Database/Repositories/QuestionRepository.php b/packages/marvel/src/Database/Repositories/QuestionRepository.php new file mode 100644 index 0000000..ae6d882 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/QuestionRepository.php @@ -0,0 +1,89 @@ + 'like', + 'answer' + ]; + /** + * @var array[] + */ + protected $dataArray = [ + 'product_id', + 'shop_id', + 'user_id', + 'question', + 'answer' + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return Question::class; + } + + /** + * @param $request + * @return LengthAwarePaginator|JsonResponse|Collection|mixed + */ + public function storeQuestion($request) + { + try { + $request['user_id'] = $request->user()->id; + $questionInput = $request->only($this->dataArray); + return $this->create($questionInput); + } catch (Exception $e) { + throw new HttpException(404, SOMETHING_WENT_WRONG); + } + } + + public function updateQuestion($request, $id) + { + try { + $question = $this->findOrFail($id); + + $question->update($request->only($this->dataArray)); + + if (!empty($question->answer)) { + event(new QuestionAnswered($question)); + } + + return $question; + } catch (ValidatorException $e) { + throw new HttpException(404, SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Database/Repositories/RefundPolicyRepository.php b/packages/marvel/src/Database/Repositories/RefundPolicyRepository.php new file mode 100644 index 0000000..6d187e1 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/RefundPolicyRepository.php @@ -0,0 +1,73 @@ + 'like', + 'slug' => 'like', + 'target', + 'status', + 'shop_id', + 'description' => 'like', + 'shop.slug', + ]; + + protected $dataArray = [ + 'title', + 'slug', + 'target', + 'status', + 'description', + 'shop_id', + 'language', + ]; + /** + * Configure the Model + **/ + public function model() + { + return RefundPolicy::class; + } + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + public function storeRefundPolicy(Request $request) + { + $data = $request->only($this->dataArray); + $data['slug'] = $this->makeSlug($request); + $refundPolicy = $this->create($data); + return $refundPolicy; + } + + public function updateRefundPolicy(Request $request, RefundPolicy $refundPolicy) + { + $data = $request->only($this->dataArray); + $data['slug'] = $this->makeSlug(request: $request, update: $refundPolicy->id); + $refundPolicy->update($data); + return $refundPolicy; + } + + public function findRefundPolicy(int | string $value, string $language = DEFAULT_LANGUAGE): RefundPolicy + { + return match (true) { + is_numeric($value) => $this->where('id', $value)->where('language', $language)->firstOrFail(), + is_string($value) => $this->where('slug', $value)->where('language', $language)->firstOrFail(), + }; + } +} diff --git a/packages/marvel/src/Database/Repositories/RefundReasonRepository.php b/packages/marvel/src/Database/Repositories/RefundReasonRepository.php new file mode 100644 index 0000000..b216476 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/RefundReasonRepository.php @@ -0,0 +1,63 @@ + 'like', + ]; + + protected $dataArray = [ + 'name', + 'slug', + 'language', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return RefundReason::class; + } + + public function storeRefundReason(Request $request) + { + $data = $request->only($this->dataArray); + $data['slug'] = $this->makeSlug($request); + $refundReason = $this->create($data); + return $refundReason; + } + + public function updateRefundReason($request, $item) + { + $data = $request->only($this->dataArray); + if (!empty($request->slug) && $request->slug != $item['slug']) { + $data['slug'] = $this->makeSlug($request); + } + $item->update($data); + return $this->findOrFail($item->id); + } +} diff --git a/packages/marvel/src/Database/Repositories/RefundRepository.php b/packages/marvel/src/Database/Repositories/RefundRepository.php new file mode 100644 index 0000000..9647076 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/RefundRepository.php @@ -0,0 +1,128 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + public function storeRefund($request) + { + $user = $request->user(); + $refunds = $this->where('order_id', $request->order_id)->get(); + if (count($refunds)) { + throw new MarvelException(ORDER_ALREADY_HAS_REFUND_REQUEST); + } + try { + $order = Order::findOrFail($request->order_id); + if ($order->parent !== null) { + throw new MarvelException(REFUND_ONLY_ALLOWED_FOR_MAIN_ORDER); + } + } catch (Exception $th) { + throw new MarvelException(NOT_FOUND); + } + if ($user->id !== $order->customer_id || $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + throw new MarvelException(NOT_AUTHORIZED); + } + $data = $request->only($this->dataArray); + $data['customer_id'] = $order->customer_id; + $data['amount'] = $order->amount; + $refund = $this->create($data); + $this->createChildOrderRefund($order->children, $data); + return $this->find($refund->id); + } + + public function createChildOrderRefund($orders, $data) + { + try { + foreach ($orders as $order) { + $data['order_id'] = $order->id; + $data['customer_id'] = $order->customer_id; + $data['shop_id'] = $order->shop_id; + $data['amount'] = $order->amount; + $this->create($data); + } + } catch (Exception $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function updateRefund($request, $refund) + { + if ($refund->shop_id !== null) { + throw new MarvelException(WRONG_REFUND); + } + $data = $request->only(['status']); + $refund->update($data); + $this->changeShopSpecificRefundStatus($refund->order_id, $data); + + if ($refund['status'] == RefundStatus::APPROVED) { + $orderData['order_status'] = OrderStatus::REFUNDED; + $orderData['payment_status'] = PaymentStatus::REFUNDED; + $this->changeOrderStatus($refund->order_id, $orderData); + } + return $refund; + } + + private function changeShopSpecificRefundStatus($order_id, $data) + { + $order = Order::with('children')->findOrFail($order_id); + + $childOrderIds = array_map(function ($childOrder) { + return $childOrder['id']; + }, $order->children->toArray()); + + $this->whereIn('order_id', $childOrderIds)->update($data); + } + + private function changeOrderStatus($parentOrderId, array $data) + { + $parentOrder = Order::findOrFail($parentOrderId); + $parentOrder->update($data); + Order::where('parent_id', $parentOrder->id)->update($data); + } +} diff --git a/packages/marvel/src/Database/Repositories/ResourceRepository.php b/packages/marvel/src/Database/Repositories/ResourceRepository.php new file mode 100644 index 0000000..15032d6 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/ResourceRepository.php @@ -0,0 +1,42 @@ + 'like', + 'type', + 'is_approved', + 'language', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return Resource::class; + } +} diff --git a/packages/marvel/src/Database/Repositories/ReviewRepository.php b/packages/marvel/src/Database/Repositories/ReviewRepository.php new file mode 100644 index 0000000..3e62f0a --- /dev/null +++ b/packages/marvel/src/Database/Repositories/ReviewRepository.php @@ -0,0 +1,92 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return Review::class; + } + + + /** + * @param $request + * @return LengthAwarePaginator|JsonResponse|Collection|mixed + */ + public function storeReview($request) + { + // add logic to verified purchase and only one rating on each product + try { + $reviewInput = $request->only($this->dataArray); + $review = $this->create($reviewInput); + + event(new ReviewCreated($review)); + return $review; + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG); + } + } + + public function updateReview($request, $id) + { + try { + $review = $this->findOrFail($id); + $review->update($request->only($this->dataArray)); + return $review; + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Database/Repositories/SettingsRepository.php b/packages/marvel/src/Database/Repositories/SettingsRepository.php new file mode 100644 index 0000000..175f076 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/SettingsRepository.php @@ -0,0 +1,47 @@ +getAppSettingsData(); + return [ + 'app_settings' => $appData, + ]; + } + + private function getAppSettingsData(): array + { + $config = new MarvelVerification(); + $apiData = $config->jsonSerialize(); + try { + $licenseKey = $config->getPrivateKey(); + $last_checking_time = $config->getLastCheckingTime() ?? Carbon::now(); + $lastCheckingTimeDifferenceFromNow = Carbon::parse($last_checking_time)->diffInMinutes(Carbon::now()); + if ($lastCheckingTimeDifferenceFromNow > 20) { + $apiData = $config->verify($licenseKey)->jsonSerialize(); + } + } catch (Exception $e) { + } + return [ + 'last_checking_time' => Carbon::now(), + 'trust' => $apiData['trust'] ?? false, + ]; + } +} diff --git a/packages/marvel/src/Database/Repositories/ShippingRepository.php b/packages/marvel/src/Database/Repositories/ShippingRepository.php new file mode 100644 index 0000000..cba7764 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/ShippingRepository.php @@ -0,0 +1,36 @@ + 'like', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Shipping::class; + } +} diff --git a/packages/marvel/src/Database/Repositories/ShopRepository.php b/packages/marvel/src/Database/Repositories/ShopRepository.php new file mode 100644 index 0000000..92b2428 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/ShopRepository.php @@ -0,0 +1,197 @@ + 'like', + 'is_active', + 'categories.slug', + 'users.name' + ]; + + /** + * @var array + */ + protected $dataArray = [ + 'name', + 'slug', + 'description', + 'cover_image', + 'logo', + 'is_active', + 'address', + 'settings', + 'notifications', + ]; + + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Shop::class; + } + + public function storeShop($request) + { + try { + $data = $request->only($this->dataArray); + $data['slug'] = $this->makeSlug($request); + $data['owner_id'] = $request->user()->id; + $shop = $this->create($data); + if (isset($request['categories'])) { + $shop->categories()->attach($request['categories']); + } + if (isset($request['balance']['payment_info'])) { + $shop->balance()->create($request['balance']); + } + + // TODO : why this code is needed + // $shop->categories = $shop->categories; + // $shop->staffs = $shop->staffs; + return $shop; + } catch (Exception $e) { + throw new HttpException(400, COULD_NOT_CREATE_THE_RESOURCE); + } + } + + public function updateShop($request, $id) + { + try { + $shop = $this->findOrFail($id); + if (isset($request['categories'])) { + $shop->categories()->sync($request['categories']); + } + if (isset($request['balance'])) { + if (isset($request['balance']['admin_commission_rate']) && $shop->balance->admin_commission_rate !== $request['balance']['admin_commission_rate']) { + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $this->updateBalance($request['balance'], $id); + } + } else { + $this->updateBalance($request['balance'], $id); + } + } + $data = $request->only($this->dataArray); + if (!empty($request->slug) && $request->slug != $shop['slug']) { + $data['slug'] = $this->makeSlug($request); + } + $shop->update($data); + + // TODO : why this code is needed + // $shop->categories = $shop->categories; + // $shop->staffs = $shop->staffs; + // $shop->balance = $shop->balance; + + + // 1. Shop owner maintenance time set korbe.. then ekta event fire hobe jeita shop notifications (email, sms) send korbe super-admin, vendor, staff, oi specific shop er front-end a ekta notice dekhabe with countdown. + // 2. countDown start er 1 day ago or 6 hours ago ekta final email/sms dibe vendor, staff k + // 3. countdown onStart a sob product private + // 4. countdown onComplete a sob product public + + if (isset($request['settings']['isShopUnderMaintenance'])) { + if ($request['settings']['isShopUnderMaintenance']) { + event(new ShopMaintenance($shop, 'enable')); + } else { + event(new ShopMaintenance($shop, 'disable')); + } + } + + return $shop; + } catch (Exception $e) { + throw new HttpException(400, COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + public function maintenanceShopEvent($request, $id) + { + $shop = $this->findOrFail($id); + if ($request['isShopUnderMaintenance'] && $request['isMaintenance']) { + Product::where('shop_id', '=', $id)->update(['visibility' => ProductVisibilityStatus::VISIBILITY_PRIVATE]); + event(new ShopMaintenance($shop, 'start')); + } else { + Product::where('shop_id', '=', $id)->update(['visibility' => ProductVisibilityStatus::VISIBILITY_PUBLIC]); + event(new ShopMaintenance($shop, 'disable')); + } + } + + public function updateBalance($balance, $shop_id) + { + if (isset($balance['id'])) { + Balance::findOrFail($balance['id'])->update($balance); + } else { + $balance['shop_id'] = $shop_id; + Balance::create($balance); + } + } + + public function transferShopOwnership(TransferShopOwnerShipRequest $request) + { + $user = $request->user(); + $shopId = $request->shop_id ?? null; + + if (!$this->hasPermission($user, $shopId)) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + + $shop = $this->findOrFail($shopId); + $previousOwner = $shop->owner; + + $newOwnerId = $request->vendor_id; + $newOwner = User::findOrFail($newOwnerId); + + OwnershipTransfer::updateOrCreate( + [ + "shop_id" => $shopId, + ], + [ + "from" => $previousOwner->id, + "message" => $request?->message, + "to" => $newOwnerId, + "created_by" => $user->id, + "status" => DefaultStatusType::PENDING, + ] + ); + + $optional = [ + 'message' => $request?->vendorMessage, + ]; + + event(new ProcessOwnershipTransition($shop, $previousOwner, $newOwner, $optional)); + + return $shop; + } +} diff --git a/packages/marvel/src/Database/Repositories/StoreNoticeReadRepository.php b/packages/marvel/src/Database/Repositories/StoreNoticeReadRepository.php new file mode 100644 index 0000000..3f7a163 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/StoreNoticeReadRepository.php @@ -0,0 +1,114 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return StoreNoticeRead::class; + } + + + /** + * Store or Update a newly created resource in storage. + * This method will update read_status of a single StoreNotice for requested user { id in requestBody }. + * @param Request $request + * @return mixed + * @throws MarvelException + */ + public function readSingleNotice(Request $request) + { + try { + $id = $request->id; + $userId = $request->user()->id; + $exists = $this->where('store_notice_id', $id)->where('user_id', $userId)->count(); + if ($exists) { + $this->where('store_notice_id', $id)->where('user_id', $userId)->delete(); + } + $update = $this->updateOrCreate( + [ + 'store_notice_id' => $id, + 'user_id' => $request->user()->id, + 'is_read' => true + ] + ); + if (!$update) { + throw new ModelNotFoundException(NOT_FOUND); + } + return $update; + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG); + } + } + + /** + * Store or Update resources in storage. + * This method will update read_status of a multiple StoreNotice for requested user { array of id in requestBody }. + * @param Request $request + * @return mixed + * @throws MarvelException + */ + public function readAllNotice(Request $request) + { + + try { + $userId = $request->user()->id; + $noticeIdArr = $request->notices; + $exists = $this->whereIn('store_notice_id', $noticeIdArr)->where('user_id', $userId)->count(); + if ($exists) { + $this->whereIn('store_notice_id', $noticeIdArr)->where('user_id', $userId)->delete(); + } + $insertionArr = Arr::map($noticeIdArr, fn ($noticeId) => [ + 'store_notice_id' => $noticeId, + 'user_id' => $userId, + 'is_read' => true + ]); + $insert = $this->insert($insertionArr); + if (!$insert) { + throw new HttpException(400, NOT_FOUND); + } + return $this->whereIn('store_notice_id', $noticeIdArr)->where('user_id', $userId)->get(); + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Database/Repositories/StoreNoticeRepository.php b/packages/marvel/src/Database/Repositories/StoreNoticeRepository.php new file mode 100644 index 0000000..30b5ae9 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/StoreNoticeRepository.php @@ -0,0 +1,208 @@ + 'like', + 'effective_from', + 'expired_at', + 'type', + 'receiver.id', + 'shops.slug', + 'users.id', + 'creator_role' => 'like', + ]; + + /** + * @var array + */ + protected $dataArray = [ + 'priority', + 'notice', + 'description', + 'effective_from', + 'expired_at', + 'type', + ]; + + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return StoreNotice::class; + } + + /** + * @param Request $request + * @return mixed + * @throws MarvelException + */ + public function fetchStoreNotices(Request $request): mixed + { + + try { + + $storeNotices = $this->where('id', '!=', null); + + /* for Guest user Requesting from shop */ + + if (!$request->user()) { + $shop_id = $request['shop_id'] ?? 0; + if (isset($shop_id)) { + $shop = Shop::where('id', $shop_id)->orWhere('slug', $shop_id)->first(); + return $storeNotices + ->where([ + 'created_by' => $shop->owner_id ?? 0, + ])->whereRelation('shops', 'id', $shop_id) + ->whereDate('expired_at', '>=', now()); + } + } + + if (!$request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + /* Block for authenticated user [vendor or staff] */ + if (isset($request['shop_id'])) { + /* code for customers */ + $shop_id = $request['shop_id']; + $shop = Shop::findOrFail($shop_id); + $storeNotices + ->where([ + 'created_by' => $shop->owner_id ?? 0, + ])->whereRelation('shops', 'id', $shop_id); + } elseif ($request->user()->managed_shop) { + /* Block for staff notices */ + $shop_id = $request->user()->managed_shop->id ?? 0; + $storeNotices + ->where([ + 'created_by' => $request->user()->managed_shop->owner_id ?? 0, + ])->whereRelation('shops', 'id', $shop_id); + } else { + /* Block for Store owner notices */ + $storeNotices->where('created_by', $request->user()->id) + ->orWhereRelation('users', 'id', $request->user()->id); + } + } + if (isset($request['shop_id'])) { + $storeNotices->whereRelation('shops', 'id', $request['shop_id']); + } + return $storeNotices->whereDate('expired_at', '>=', now()); + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG); + } + } + + /** + * @param Request $request + * @return array[] + */ + public function fetchStoreNoticeType(Request $request) + { + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $typeArr = [ + ['name' => "ALL VENDOR", 'value' => StoreNoticeType::ALL_VENDOR], + ['name' => "SPECIFIC VENDOR", 'value' => StoreNoticeType::SPECIFIC_VENDOR] + ]; + return $typeArr; + } + $typeArr = [ + ['name' => "ALL SHOP", 'value' => StoreNoticeType::ALL_SHOP], + ['name' => "SPECIFIC SHOP", 'value' => StoreNoticeType::SPECIFIC_SHOP] + ]; + return $typeArr; + } + + /** + * This method will generate User list or Shop list based on requested user permission + * @param Request $request + * @return Builder[]|\Illuminate\Database\Eloquent\Collection|\Illuminate\Http\Response + * @throws MarvelException + */ + public function fetchUserToSendNotification(Request $request) + { + try { + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + return User::permission(Permission::STORE_OWNER)->orderBy('name')->get(); + } else { + return $request->user()->shops->where('is_active', 1); + } + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG); + } + } + + + /** + * It creates a new store notice, syncs the users and shops, and syncs the read status. + * + * @param Request request The request object + * + * @return StoreNotice storeNotice is being returned. + */ + public function saveStoreNotice(Request $request) + { + try { + $storeNotice = $this->create($request->only($this->dataArray)); + $this->syncUsersOrShops($request, $storeNotice); + $this->syncReadStatus($storeNotice); + event(new StoreNoticeEvent($storeNotice, 'create', $request->user())); + return $storeNotice; + } catch (Exception $e) { + throw new HttpException(400, COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Updating Specific resource in storage + * + * @param \Marvel\Database\Models\StoreNotice $storeNotice + * @param array $data + * @return mixed + */ + public function updateStoreNotice(Request $request, StoreNotice $storeNotice) + { + + try { + $storeNotice->update($request->only($this->dataArray)); + $this->syncUsersOrShops($request, $storeNotice); + $this->syncReadStatus($storeNotice); + event(new StoreNoticeEvent($storeNotice, 'update', $request->user())); + return $storeNotice; + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Database/Repositories/TagRepository.php b/packages/marvel/src/Database/Repositories/TagRepository.php new file mode 100644 index 0000000..d065a40 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/TagRepository.php @@ -0,0 +1,61 @@ + 'like', + 'type.slug', + 'language' + ]; + + protected $dataArray = [ + 'name', + 'slug', + 'type_id', + 'icon', + 'image', + 'details', + 'language', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + + /** + * Configure the Model + **/ + public function model() + { + return Tag::class; + } + + public function updateTag($request, $tag) + { + $data = $request->only($this->dataArray); + if (!empty($request->slug) && $request->slug != $tag['slug']) { + $data['slug'] = $this->makeSlug($request); + } + $tag->update($data); + return $this->findOrFail($tag->id); + } +} diff --git a/packages/marvel/src/Database/Repositories/TaxRepository.php b/packages/marvel/src/Database/Repositories/TaxRepository.php new file mode 100644 index 0000000..6e91f13 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/TaxRepository.php @@ -0,0 +1,36 @@ + 'like', + ]; + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Tax::class; + } +} diff --git a/packages/marvel/src/Database/Repositories/TermsAndConditionsRepository.php b/packages/marvel/src/Database/Repositories/TermsAndConditionsRepository.php new file mode 100644 index 0000000..492d901 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/TermsAndConditionsRepository.php @@ -0,0 +1,106 @@ + 'like', + 'shop_id', + 'language', + 'type', + 'issued_by', + 'is_approved' + ]; + + /** + * @var array + */ + protected $dataArray = [ + 'title', + 'description', + 'language', + 'slug', + ]; + + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return TermsAndConditions::class; + } + + + + /** + * storeTermsAndConditions + * + * @param mixed $request + * @return void + */ + public function storeTermsAndConditions($request) + { + try { + if (isset($request['shop_id']) && !empty($request['shop_id'])) { + // $shop = Shop::where('id', '=', $request['shop_id'])->first(); + $shop = Shop::findOrFail($request['shop_id']); + } + + $termsAndConditions = []; + $termsAndConditions['title'] = $request['title']; + $termsAndConditions['description'] = $request['description']; + $termsAndConditions['user_id'] = $request->user()->id; + $termsAndConditions['shop_id'] = isset($request['shop_id']) ? $request['shop_id'] : null; + $termsAndConditions['type'] = isset($request['shop_id']) ? 'shop' : 'global'; + $termsAndConditions['issued_by'] = isset($request['shop_id']) && isset($shop) ? $shop->name : 'Super Admin'; + $termsAndConditions['language'] = $request['language'] ?? DEFAULT_LANGUAGE; + $termsAndConditions['is_approved'] = isset($request['shop_id']) && isset($shop) ? false : true; + + $this->create($termsAndConditions); + return $termsAndConditions; + } catch (Exception $th) { + throw new Exception(SOMETHING_WENT_WRONG, $th->getMessage()); + } + } + + + /** + * updateTermsAndConditions + * + * @param mixed $request + * @param mixed $termsAndConditions + * @return void + */ + public function updateTermsAndConditions(Request $request, TermsAndConditions $termsAndConditions) + { + try { + $termsAndConditions->update($request->only($this->dataArray)); + return $termsAndConditions; + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } +} diff --git a/packages/marvel/src/Database/Repositories/TypeRepository.php b/packages/marvel/src/Database/Repositories/TypeRepository.php new file mode 100644 index 0000000..2897685 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/TypeRepository.php @@ -0,0 +1,91 @@ + 'like', + 'language', + ]; + + protected $dataArray = [ + 'name', + 'slug', + 'icon', + 'promotional_sliders', + 'images', + 'settings', + 'language', + ]; + + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Type::class; + } + + public function storeType($request) + { + $request['slug'] = $this->makeSlug($request); + $type = $this->create($request->only($this->dataArray)); + if (isset($request['banners']) && count($request['banners'])) { + $type->banners()->createMany($request['banners']); + } + return $type; + } + + public function updateType($request, $type) + { + + Type::whereJsonContains('settings->isHome', true)->where('slug', '!=', $type->slug) + ->update([ + 'settings->isHome' => false + ]); + + if (isset($request['banners'])) { + foreach ($type->banners as $banner) { + $key = array_search($banner->id, array_column($request['banners'], 'id')); + if (!$key && $key !== 0) { + Banner::findOrFail($banner->id)->delete(); + } + } + foreach ($request['banners'] as $banner) { + if (isset($banner['id'])) { + Banner::findOrFail($banner['id'])->update($banner); + } else { + $banner['type_id'] = $type->id; + Banner::create($banner); + } + } + } + $data = $request->only($this->dataArray); + if (!empty($request->slug) && $request->slug != $type['slug']) { + $data['slug'] = $this->makeSlug($request); + } + $type->update($data); + return $this->with('banners')->findOrFail($type->id); + } +} diff --git a/packages/marvel/src/Database/Repositories/UserRepository.php b/packages/marvel/src/Database/Repositories/UserRepository.php new file mode 100644 index 0000000..a481396 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/UserRepository.php @@ -0,0 +1,147 @@ + 'like', + 'email' => 'like', + ]; + + /** + * @var array + */ + protected $dataArray = [ + 'name', + 'email', + 'shop_id' + ]; + + /** + * Configure the Model + **/ + public function model() + { + return User::class; + } + + public function boot() + { + try { + $this->pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + public function storeUser($request) + { + try { + $user = $this->create([ + 'name' => $request->name, + 'email' => $request->email, + 'password' => Hash::make($request->password), + ]); + $user->givePermissionTo(UserPermission::CUSTOMER); + if (isset($request['address']) && count($request['address'])) { + $user->address()->createMany($request['address']); + } + if (isset($request['profile'])) { + $user->profile()->create($request['profile']); + } + $user->profile = $user->profile; + $user->address = $user->address; + $user->shop = $user->shop; + $user->managed_shop = $user->managed_shop; + return $user; + } catch (ValidatorException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function updateUser($request, $user) + { + try { + if (isset($request['address']) && count($request['address'])) { + foreach ($request['address'] as $address) { + if (isset($address['id'])) { + Address::findOrFail($address['id'])->update($address); + } else { + $address['customer_id'] = $user->id; + Address::create($address); + } + } + } + + if (isset($request['profile'])) { + if (isset($request['profile']['id'])) { + Profile::findOrFail($request['profile']['id'])->update($request['profile']); + } else { + $profile = $request['profile']; + $profile['customer_id'] = $user->id; + Profile::create($profile); + } + } + $user->update($request->only($this->dataArray)); + $user->profile = $user->profile; + $user->address = $user->address; + $user->shop = $user->shop; + $user->managed_shop = $user->managed_shop; + return $user; + } catch (ValidationException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function sendResetEmail($email, $token) + { + try { + Mail::to($email)->send(new ForgetPassword($token)); + return true; + } catch (\Exception $e) { + return false; + } + } + /** + * Update user email and send verification link to the user. + * @param $request + * @return string[] + */ + + public function updateEmail($request): array + { + $user = $request->user(); + $user->email = $request->email; + $user->email_verified_at = null; + $user->save(); + $user->sendEmailVerificationNotification(); + return ['message' => EMAIL_UPDATED_SUCCESSFULLY, 'status' => 'success']; + } + + public function checkIfApplicationIsValid(): bool + { + $settings = Settings::getData(); + $useMustVerifyLicense = isset($settings->options['app_settings']['trust']) ? $settings->options['app_settings']['trust'] : false; + return $useMustVerifyLicense; + } +} diff --git a/packages/marvel/src/Database/Repositories/WishlistRepository.php b/packages/marvel/src/Database/Repositories/WishlistRepository.php new file mode 100644 index 0000000..197c0d6 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/WishlistRepository.php @@ -0,0 +1,85 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + // + } + } + + /** + * @var array[] + */ + protected $dataArray = [ + 'user_id', + 'product_id', + 'variation_option_id' + ]; + + /** + * Configure the Model + **/ + public function model() + { + return Wishlist::class; + } + + /** + * @param $request + * @return LengthAwarePaginator|JsonResponse|Collection|mixed + */ + public function storeWishlist($request) + { + try { + $user_id = $request->user()->id; + $wishlist = $this->findOneWhere((['user_id' => $user_id, 'product_id' => $request['product_id']])); + if (empty($wishlist)) { + $request['user_id'] = $user_id; + $wishlistInput = $request->only($this->dataArray); + return $this->create($wishlistInput); + } + } catch (\Exception $e) { + throw new HttpException(400, ALREADY_ADDED_TO_WISHLIST_FOR_THIS_PRODUCT); + } + } + + /** + * @param $request + * @return LengthAwarePaginator|JsonResponse|Collection|mixed + */ + public function toggleWishlist($request) + { + try { + $user_id = $request->user()->id; + $wishlist = $this->findOneWhere((['user_id' => $user_id, 'product_id' => $request['product_id']])); + if (empty($wishlist)) { + $request['user_id'] = $user_id; + $wishlistInput = $request->only($this->dataArray); + $this->create($wishlistInput); + return true; + } else { + $this->delete($wishlist->id); + return false; + } + } catch (\Exception $e) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Database/Repositories/WithdrawRepository.php b/packages/marvel/src/Database/Repositories/WithdrawRepository.php new file mode 100644 index 0000000..d579d20 --- /dev/null +++ b/packages/marvel/src/Database/Repositories/WithdrawRepository.php @@ -0,0 +1,34 @@ +pushCriteria(app(RequestCriteria::class)); + } catch (RepositoryException $e) { + } + } + + /** + * Configure the Model + **/ + public function model() + { + return Withdraw::class; + } +} diff --git a/packages/marvel/src/Database/Seeders/FaqSeeder.php b/packages/marvel/src/Database/Seeders/FaqSeeder.php new file mode 100644 index 0000000..87e827b --- /dev/null +++ b/packages/marvel/src/Database/Seeders/FaqSeeder.php @@ -0,0 +1,757 @@ +shops = Shop::all()->pluck("name", "id")->toArray(); + } + /** + * Seed the application's database. + * + * @return void + */ + public function run() + { + DB::table('faqs')->insert([ + [ + "user_id" => 1, + "shop_id" => null, + "faq_title" => "What is your return policy?", + "slug" => "what-is-your-return-policy", + "faq_description" => "We have a flexible return policy. If you're not satisfied with your purchase, you can return most items within 30 days for a full refund or exchange. Please review our Return Policy for more details.", + "faq_type" => "global", + "issued_by" => "Super Admin", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "faq_title" => "Can I track my order?", + "slug" => "can-i-track-my-order", + "faq_description" => "Yes, you can track your order's status. Once your order is shipped, you will receive a tracking number via email. You can use this tracking number to monitor the progress of your delivery.", + "faq_type" => "global", + "issued_by" => "Super Admin", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "faq_title" => "How long will it take to receive my order?", + "slug" => "how-long-will-it-take-to-receive-my-order", + "faq_description" => "Delivery times may vary depending on your location and the shipping method you choose. Typically, orders are processed and shipped within 1-2 business days. You can check the estimated delivery time during checkout.", + "faq_type" => "global", + "issued_by" => "Super Admin", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "faq_title" => "What payment methods do you accept?", + "slug" => "what-payment-methods-do-you-accept", + "faq_description" => "We accept a variety of payment methods, including credit cards (Visa, MasterCard, American Express), PayPal, and more. You can choose your preferred payment option during the checkout process.", + "faq_type" => "global", + "issued_by" => "Super Admin", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "faq_title" => "How can I place an order?", + "slug" => "how-can-i-place-an-order", + "faq_description" => "To place an order, simply browse our online store, add the items you want to your cart, and proceed to checkout. Follow the prompts to enter your shipping information and payment details to complete your purchase.", + "faq_type" => "global", + "issued_by" => "Super Admin", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + ...$this->shopFAQsSeeder(), + // ...$this->shopFAQsSeederGerman(), + + ]); + } + + /** + * shopFAQsSeeder + * + * @return array + */ + private function shopFAQsSeeder(): array + { + return [ + [ + "user_id" => 1, + "shop_id" => 1, + "faq_title" => "What is the delivery process for furniture purchases?", + "slug" => "what-is-the-delivery-process-for-furniture-purchases?", + "faq_description" => "We offer convenient and reliable furniture delivery services. After making your purchase, our team will contact you to schedule a delivery time that suits your availability. Our delivery professionals will assemble and set up the furniture in your desired room. Please refer to our Delivery Information page for more details. ", + "faq_type" => "shop", + "issued_by" => $this->shops[1] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 1, + "faq_title" => "Do you provide warranty coverage for furniture items?", + "slug" => "do-you-provide-warranty-coverage-for-furniture-items?", + "faq_description" => "Yes, many of our furniture items come with manufacturer warranties that cover structural defects and craftsmanship issues. The duration and terms of the warranty may vary by product. You can find warranty information in the product descriptions, or you can contact our customer support team for specific details. ", + "faq_type" => "shop", + "issued_by" => $this->shops[1] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 2, + "faq_title" => "What is your return policy for clothing items?", + "slug" => "what-is-your-return-policy-for-clothing-items?", + "faq_description" => "We offer a hassle-free return policy for clothing purchases. If you are not completely satisfied with your clothing item, you can return it within 30 days of purchase, as long as the item is in its original condition with tags attached. For detailed information on our return process, please refer to our Returns and Exchanges page. ", + "faq_type" => "shop", + "issued_by" => $this->shops[2] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 2, + "faq_title" => "Do you offer plus-size or petite clothing options?", + "slug" => "do-you-offer-plus-size-or-petite-clothing-options?", + "faq_description" => "Yes, we strive to provide a diverse range of clothing sizes to accommodate all body types. Our inventory includes a selection of plus-size and petite clothing options in various styles and designs. You can use our size filters or contact our customer support for assistance in finding the perfect fit. ", + "faq_type" => "shop", + "issued_by" => $this->shops[2] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 11, + "faq_title" => "How can I determine the right size and style of bag for my needs when shopping online?", + "slug" => "how-can-i-determine-the-right-size-and-style-of-bag-for-my-needs-when-shopping-online?", + "faq_description" => "Finding the perfect bag online is made easier with our selection and helpful tools. Here's how to make an informed choice. Each bag product on our website includes detailed descriptions, including dimensions, capacity, and features. Read these descriptions carefully to understand the size and functionality of the bag. We provide high-quality images and, in some cases, videos that showcase the bag from different angles and show it in use. Visual aids can help you assess the bag's size and style better. Check out reviews and ratings from other customers who have purchased the same bag. Feedback from others who have used the bag for various purposes can provide valuable insights. We may offer size guides or charts to help you understand the bag's dimensions in relation to common items you might carry, such as laptops, books, or clothing. If you have specific questions or need personalized recommendations, our customer support team is here to assist you. Use our live chat feature or contact us via email or phone for expert guidance. Rest assured that we have a flexible returns and exchanges policy. If the bag doesn't meet your expectations, you can usually return or exchange it within a specified time frame. ", + "faq_type" => "shop", + "issued_by" => $this->shops[11] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 11, + "faq_title" => "What measures do you take to ensure the quality and durability of the bags you sell online?", + "slug" => "what-measures-do-you-take-to-ensure-the-quality-and-durability-of-the-bags-you-sell-online?", + "faq_description" => "We are committed to providing high-quality and durable bags to our customers. Here's how we ensure the quality and durability of the bags in our online shop. We carefully curate our collection from reputable brands known for their craftsmanship and quality. We partner with brands that have a strong track record in producing durable and long-lasting bags. Each bag product listing includes detailed information about the materials used in its construction. This allows you to assess the bag's durability and suitability for your needs. Many of our bags come with manufacturer warranties that cover defects in materials and workmanship. Check the product listing for warranty details. We value customer feedback and consider it when selecting bags for our inventory. Positive reviews and high ratings from satisfied customers are indicative of product quality. In the rare event that you receive a bag with defects or quality issues, our returns and exchanges policy allows you to return or exchange the product for your peace of mind. ", + "faq_type" => "shop", + "issued_by" => $this->shops[11] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 4, + "faq_title" => "How can I find the right makeup products for my skin tone and type when shopping online?", + "slug" => "how-can-i-find-the-right-makeup-products-for-my-skin-tone-and-type-when-shopping-online?", + "faq_description" => "Shopping for makeup online is made easier with our website's tools and resources to help you find the perfect products for your skin. Here's how to get started. Each makeup product on our website includes detailed descriptions, including shade names, undertones, and ingredients. Read these descriptions carefully to find products that match your skin tone and type. We offer shade matching tools and guides for foundations, concealers, and other complexion products. These tools can help you identify your ideal shade based on your skin undertones. Check out product reviews and ratings left by other customers who have similar skin tones or concerns. Their feedback can provide valuable insights into how a product performs. If you're unsure about a product or need personalized recommendations, our customer support team is here to assist you. Use our live chat or contact us via email or phone for expert guidance. We may offer sample sizes or testers for select products. Trying out samples can be a great way to test shades and formulas before committing to a full-sized product. Rest assured that we have a flexible returns and exchanges policy. If a product doesn't meet your expectations, you can usually return or exchange it within a specified time frame.", + "faq_type" => "shop", + "issued_by" => $this->shops[4] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 4, + "faq_title" => "How do I ensure the authenticity and quality of the makeup products purchased online?", + "slug" => "how-do-i-ensure-the-authenticity-and-quality-of-the-makeup-products-purchased-online?", + "faq_description" => "We prioritize the authenticity and quality of all our makeup products to ensure a positive shopping experience. Here's how we guarantee the authenticity and quality of our products. We are an authorized retailer for all the brands and products we carry. This means that we source our products directly from reputable manufacturers and distributors. Makeup products are delivered in their original, sealed packaging. We do not sell opened or tampered products. We only carry well-known and trusted makeup brands with a proven track record for quality and safety. Each product listing on our website includes detailed information, including brand, ingredients, and usage instructions, to help you make an informed decision. We value customer feedback and take it into account when selecting products for our inventory. Positive reviews and high ratings from satisfied customers are indicative of product quality. In the unlikely event that you receive a product that doesn't meet your expectations, our flexible returns and exchanges policy allows you to return or exchange it for your peace of mind. ", + "faq_type" => "shop", + "issued_by" => $this->shops[4] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 5, + "faq_title" => "How do I place an order for bakery products on your website?", + "slug" => "how-do-i-place-an-order-for-bakery-products-on-your-website?", + "faq_description" => "Ordering delicious bakery products from our online shop is easy and convenient. Here's a step-by-step guide to placing an order: Visit our website to explore our mouthwatering range of bakery products. You can browse by category, including bread, pastries, cakes, and more. Click on the items you'd like to purchase to view detailed descriptions, prices, and available options (e.g., flavors, sizes, and quantities). Add your desired products to your virtual shopping cart. Before proceeding to checkout, review the items in your cart to ensure you've selected everything you want. You can make adjustments, update quantities, or remove items as needed. When you're ready to complete your order, proceed to the checkout page. Here, you'll provide your delivery information and select your preferred delivery date and time slot. Choose your preferred payment method, such as credit/debit card or digital wallet, and securely enter your payment details. After successful payment, you'll receive an order confirmation via email or SMS. This confirmation will include the details of your order, delivery date, and a unique order number. On the scheduled delivery date, our team will carefully prepare your bakery items and deliver them to your doorstep. You'll receive a notification when your order is on its way. Once your delicious bakery treats arrive, simply unpack and enjoy your freshly baked goodies. ", + "faq_type" => "shop", + "issued_by" => $this->shops[5] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 5, + "faq_title" => "Do you accommodate special dietary needs or allergies?", + "slug" => "do-you-accommodate-special-dietary-needs-or-allergies?", + "faq_description" => "Yes, we strive to accommodate various dietary needs and allergies to ensure that everyone can enjoy our bakery products. Here's how we address specific dietary requirements: Each product on our website includes detailed information about allergens, such as nuts, dairy, eggs, and gluten. You can check these allergen labels to make informed choices. We offer a selection of products tailored to specific dietary preferences and restrictions. This may include gluten-free, vegan, or sugar-free options. You can easily filter products by dietary category on our website to find suitable choices. In some cases, we may be able to customize certain products to meet your specific dietary needs. If you have a special request or dietary requirement, please reach out to our customer support team, and we'll do our best to assist you. ", + "faq_type" => "shop", + "issued_by" => $this->shops[5] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 6, + "faq_title" => "How does the online ordering and delivery process work?", + "slug" => "how-does-the-online-ordering-and-delivery-process-work?", + "faq_description" => "Ordering groceries online with us is simple and convenient. Here's a step-by-step guide to our process: Visit our website or mobile app to browse our wide selection of groceries. You can search for specific items or explore categories. Add the products you need to your virtual shopping cart. Before checkout, review your cart to ensure you have everything you need. You can also customize your order, specify quantities, and make any necessary adjustments. Proceed to the checkout page to review your order one last time. You can choose your preferred payment method, including credit/debit cards or digital wallets, and complete the transaction securely. Select your preferred delivery time slot. We offer flexible delivery options to accommodate your schedule. Once your order is placed, you will receive an order confirmation via email or SMS. You can track the status of your order through your account. Our dedicated delivery team will carefully pack your groceries and deliver them to your doorstep at the chosen time. You'll receive a notification when your order is out for delivery. Receive your groceries, unpack, and enjoy your fresh and quality products. ", + "faq_type" => "shop", + "issued_by" => $this->shops[6] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 6, + "faq_title" => "What are the delivery fees and minimum order requirements?", + "slug" => "what-are-the-delivery-fees-and-minimum-order-requirements?", + "faq_description" => "We aim to provide affordable and convenient online grocery shopping. Our delivery fees and minimum order requirements are as follows: The delivery fee may vary depending on your location and the time slot you choose. We strive to keep our delivery charges competitive and transparent. You can view the applicable fees during the checkout process. To place an order for delivery, we have a minimum order requirement. This requirement helps us cover the costs associated with packing and delivering your groceries. The minimum order amount may vary based on your location, but you can easily check the specific minimum for your area on our website or app. Please note that we may offer promotions and discounts from time to time, including waived delivery fees for orders over a certain amount. Keep an eye out for these special offers to save even more on your online grocery shopping. ", + "faq_type" => "shop", + "issued_by" => $this->shops[6] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 7, + "faq_title" => "Can I order both physical books and e-books from your store?", + "slug" => "can-i-order-both-physical-books-and-e-books-from-your-store?", + "faq_description" => "Yes, you can choose from a wide selection of physical books and e-books in our store. Simply browse our catalog and select your preferred format for each title. Physical books will be delivered to your address, while e-books can be downloaded instantly upon purchase.", + "faq_type" => "shop", + "issued_by" => $this->shops[7] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 7, + "faq_title" => "Do you offer book recommendations or have a book club?", + "slug" => "do-you-offer-book-recommendations-or-have-a-book-club?", + "faq_description" => "We love books, and we're here to help you discover new reads! You can explore our Recommended Reads section for curated book recommendations. Additionally, we periodically host virtual book club events where readers can discuss and explore books together. Stay tuned for announcements on our website or social media.", + "faq_type" => "shop", + "issued_by" => $this->shops[7] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 8, + "faq_title" => "Do you provide warranty coverage for electronic gadgets?", + "slug" => "do-you-provide-warranty-coverage-for-electronic-gadgets?", + "faq_description" => "Yes, most electronic gadgets come with manufacturer warranties that cover defects and malfunctions. The warranty duration and terms vary by product and brand. You can find warranty information in the product descriptions or contact our customer support for specific details.", + "faq_type" => "shop", + "issued_by" => $this->shops[8] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 8, + "faq_title" => "Are your gadgets brand new, or do you offer refurbished options as well?", + "slug" => "are-your-gadgets-brand-new,-or-do-you-offer-refurbished-options-as-well?", + "faq_description" => "We primarily offer brand new gadgets, but we may occasionally have certified refurbished options available. Each product listing will specify whether it is new or refurbished. Refurbished gadgets undergo thorough testing and quality checks to ensure they meet high standards. ", + "faq_type" => "shop", + "issued_by" => $this->shops[8] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 9, + "faq_title" => "Can I order prescription medications from your online medicine shop?", + "slug" => "can-i-order-prescription-medications-from-your-online-medicine-shop?", + "faq_description" => "We do not offer prescription medications. Our shop specializes in over-the-counter (OTC) and wellness products. Please consult a healthcare professional for prescription medications and guidance. ", + "faq_type" => "shop", + "issued_by" => $this->shops[9] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 9, + "faq_title" => "What measures do you take to ensure the authenticity and safety of the medicines you sell?", + "slug" => "what-measures-do-you-take-to-ensure-the-authenticity-and-safety-of-the-medicines-you-sell?", + "faq_description" => "We work exclusively with trusted suppliers and brands to ensure the authenticity and safety of the medicines and wellness products in our inventory. All products are sourced from licensed manufacturers and adhere to strict quality and safety standards. ", + "faq_type" => "shop", + "issued_by" => $this->shops[9] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 10, + "faq_title" => "Can I return baby care items if they are unopened and unused?", + "slug" => "can-i-return-baby-care-items-if-they-are-unopened-and-unused?", + "faq_description" => "Yes, you can return unopened and unused baby care items within 30 days of purchase. We prioritize the safety and satisfaction of our customers, and our return policy reflects that commitment.", + "faq_type" => "shop", + "issued_by" => $this->shops[10] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 10, + "faq_title" => "Are your baby care products free from harmful chemicals and safe for infants?", + "slug" => "are-your-baby-care-products-free-from-harmful-chemicals-and-safe-for-infants?", + "faq_description" => "Absolutely. We source baby care products from reputable brands known for their commitment to safety and quality. All our products comply with safety standards and are free from harmful chemicals. You can find detailed ingredient information on product labels and descriptions. ", + "faq_type" => "shop", + "issued_by" => $this->shops[10] ?? '', + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + + // [ + // "user_id" => 1, + // "shop_id" => 12, + // "faq_title" => "Do you offer installation services for home appliances?", + // "slug" => "do-you-offer-installation-services-for-home-appliances?", + // "faq_description" => "Yes, we provide installation services for many home appliances. During the checkout process, you can select the option for installation if available for your chosen product. Our skilled technicians will ensure a safe and proper installation. ", + // "faq_type" => "shop", + // "issued_by" => "Home Appliance Shop", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "user_id" => 1, + // "shop_id" => 12, + // "faq_title" => "What is the warranty coverage for home appliances?", + // "slug" => "what-is-the-warranty-coverage-for-home-appliances?", + // "faq_description" => "Most home appliances come with manufacturer warranties that cover defects and malfunctions. Warranty terms and durations vary by product and brand. You can find warranty information in the product descriptions or contact our customer support for specific details. ", + // "faq_type" => "shop", + // "issued_by" => "Home Appliance Shop", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "user_id" => 1, + // "shop_id" => 13, + // "faq_title" => "How do I care for microgreens once they are delivered?", + // "slug" => "how-do-i-care-for-microgreens-once-they-are-delivered?", + // "faq_description" => "Micro greens are easy to care for. Upon delivery, place them in a well-lit area, preferably near a window with indirect sunlight. Water them lightly as needed to keep the soil evenly moist, but avoid over watering. ", + // "faq_type" => "shop", + // "issued_by" => "Micro Green Shop", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "user_id" => 1, + // "shop_id" => 13, + // "faq_title" => "Can I grow microgreens indoors year-round?", + // "slug" => "can-i-grow-microgreens-indoors-year-round?", + // "faq_description" => "Yes, you can! Micro greens are well-suited for indoor cultivation, allowing you to enjoy fresh greens throughout the year. With the right conditions and care, you can have a continuous supply of homegrown micro greens. ", + // "faq_type" => "shop", + // "issued_by" => "Micro Green Shop", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "user_id" => 1, + // "shop_id" => 14, + // "faq_title" => "What care instructions are provided with the plants I purchase?", + // "slug" => "what-care-instructions-are-provided-with-the-plants-i-purchase?", + // "faq_description" => "Each plant comes with care instructions specific to its type. These instructions include details on sunlight requirements, watering schedules, and general plant care tips. You can also find additional care resources on our website.", + // "faq_type" => "shop", + // "issued_by" => "Plants Shop", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "user_id" => 1, + // "shop_id" => 14, + // "faq_title" => "Do you offer a guarantee on the health of the plants upon delivery?", + // "slug" => "do-you-offer-a-guarantee-on-the-health-of-the-plants-upon-delivery?", + // "faq_description" => "We take great care in packaging and shipping plants to ensure their health upon arrival. If you receive a plant in unsatisfactory condition, please contact us within 48 hours of delivery with photos, and we will work to resolve the issue promptly. Your satisfaction is important to us. ", + // "faq_type" => "shop", + // "issued_by" => "Plants Shop", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + ]; + } + + + private function shopFAQsSeederGerman(): array + { + if (!TRANSLATION_ENABLED) { + return []; + } else { + return [ + [ + "user_id" => 1, + "shop_id" => null, + "faq_title" => "Wie lauten Ihre Rückgabebedingungen?", + "slug" => "wie-lauten-ihre-rückgabebedingungen?", + "faq_description" => "Wir haben ein flexibles Rückgaberecht. Wenn Sie mit Ihrem Kauf nicht zufrieden sind, können Sie die meisten Artikel innerhalb von 30 Tagen gegen eine vollständige Rückerstattung oder einen Umtausch zurückgeben. Weitere Informationen finden Sie in unseren Rückgabebedingungen.", + "faq_type" => "global", + "issued_by" => "Super Admin", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "faq_title" => "Kann ich meine Bestellung verfolgen?", + "slug" => "kann-ich-meine-bestellung-verfolgen?", + "faq_description" => "Ja, Sie können den Status Ihrer Bestellung verfolgen. Sobald Ihre Bestellung versandt wurde, erhalten Sie per E-Mail eine Sendungsverfolgungsnummer. Mithilfe dieser Sendungsverfolgungsnummer können Sie den Fortschritt Ihrer Lieferung überwachen.", + "faq_type" => "global", + "issued_by" => "Super Admin", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "faq_title" => "Wie lange dauert es, bis ich meine Bestellung erhalte?", + "slug" => "wie-lange-dauert-es,-bis-ich-meine-bestellung-erhalte?", + "faq_description" => "Die Lieferzeiten können je nach Standort und gewählter Versandart variieren. Normalerweise werden Bestellungen innerhalb von 1-2 Werktagen bearbeitet und versendet. Sie können die voraussichtliche Lieferzeit beim Bezahlvorgang überprüfen.", + "faq_type" => "global", + "issued_by" => "Super Admin", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "faq_title" => "Welche Zahlungsmethoden werden akzeptiert?", + "slug" => "welche-zahlungsmethoden-werden-akzeptiert?", + "faq_description" => "Wir akzeptieren eine Vielzahl von Zahlungsmethoden, darunter Kreditkarten (Visa, MasterCard, American Express), PayPal und mehr. Während des Bestellvorgangs können Sie Ihre bevorzugte Zahlungsoption auswählen.", + "faq_type" => "global", + "issued_by" => "Super Admin", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "faq_title" => "Wie kann ich eine Bestellung aufgeben?", + "slug" => "wie-kann-ich-eine-bestellung-aufgeben?", + "faq_description" => "Um eine Bestellung aufzugeben, stöbern Sie einfach in unserem Online-Shop, legen Sie die gewünschten Artikel in Ihren Warenkorb und gehen Sie zur Kasse. Befolgen Sie die Anweisungen zur Eingabe Ihrer Versandinformationen und Zahlungsdetails, um Ihren Kauf abzuschließen.", + "faq_type" => "global", + "issued_by" => "Super Admin", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 1, + "faq_title" => "Wie läuft der Lieferprozess beim Möbelkauf ab?", + "slug" => "wie-läuft-der-lieferprozess-beim-möbelkauf-ab?", + "faq_description" => "Wir bieten bequeme und zuverlässige Möbellieferdienste. Nach dem Kauf wird sich unser Team mit Ihnen in Verbindung setzen, um einen Liefertermin zu vereinbaren, der Ihrer Verfügbarkeit entspricht. Unsere Lieferprofis montieren und stellen die Möbel in Ihrem Wunschraum auf. Weitere Informationen finden Sie auf unserer Seite mit den Lieferinformationen.", + "faq_type" => "shop", + "issued_by" => $this->shops[1] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 1, + "faq_title" => "Bieten Sie eine Garantie für Möbelstücke an?", + "slug" => "bieten-sie-eine-garantie-für-möbelstücke-an?", + "faq_description" => "Ja, für viele unserer Möbelstücke gilt eine Herstellergarantie, die strukturelle Mängel und Verarbeitungsfehler abdeckt. Die Dauer und Bedingungen der Garantie können je nach Produkt variieren. Informationen zur Garantie finden Sie in den Produktbeschreibungen. Für spezifische Details können Sie sich auch an unseren Kundendienst wenden.", + "faq_type" => "shop", + "issued_by" => $this->shops[1] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 2, + "faq_title" => "Wie lauten Ihre Rückgabebedingungen für Kleidungsstücke?", + "slug" => "wie-lauten-ihre-rückgabebedingungen-für-kleidungsstücke?", + "faq_description" => "Wir bieten ein problemloses Rückgaberecht für den Kauf von Kleidung. Wenn Sie mit Ihrem Kleidungsstück nicht vollständig zufrieden sind, können Sie es innerhalb von 30 Tagen nach dem Kauf zurückgeben, sofern sich das Kleidungsstück im Originalzustand mit angebrachten Etiketten befindet. Ausführliche Informationen zu unserem Rückgabeprozess finden Sie auf unserer Seite „Rückgaben und Umtausch“.", + "faq_type" => "shop", + "issued_by" => $this->shops[2] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 2, + "faq_title" => "Bieten Sie Kleidung in Übergrößen oder Petite-Größen an?", + "slug" => "bieten-sie-kleidung-in-übergrößen-oder-petite-größen-an?", + "faq_description" => "Ja, wir sind bestrebt, ein vielfältiges Sortiment an Konfektionsgrößen für alle Körpertypen anzubieten. Unser Sortiment umfasst eine Auswahl an Kleidung in Übergrößen und Petite-Größen in verschiedenen Stilen und Designs. Sie können unsere Größenfilter verwenden oder sich an unseren Kundensupport wenden, um Hilfe bei der Suche nach der perfekten Passform zu erhalten.", + "faq_type" => "shop", + "issued_by" => $this->shops[2] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 11, + "faq_title" => "Wie kann ich beim Online-Einkauf die richtige Taschengröße und den richtigen Taschenstil für meine Bedürfnisse ermitteln?", + "slug" => "wie-kann-ich-beim-online-einkauf-die-richtige-taschengröße-und-den-richtigen-taschenstil-für-meine-bedürfnisse-ermitteln?", + "faq_description" => "Mit unserer Auswahl und hilfreichen Tools wird es einfacher, online die perfekte Tasche zu finden. So treffen Sie eine fundierte Entscheidung. Jedes Taschenprodukt auf unserer Website enthält detaillierte Beschreibungen, einschließlich Abmessungen, Kapazität und Funktionen. Lesen Sie diese Beschreibungen sorgfältig durch, um die Größe und Funktionalität der Tasche zu verstehen. Wir stellen hochwertige Bilder und teilweise auch Videos zur Verfügung, die die Tasche aus verschiedenen Blickwinkeln zeigen und sie im Einsatz zeigen. Mithilfe visueller Hilfsmittel können Sie die Größe und den Stil der Tasche besser einschätzen. Schauen Sie sich die Rezensionen und Bewertungen anderer Kunden an, die die gleiche Tasche gekauft haben. Rückmeldungen von anderen, die die Tasche für verschiedene Zwecke verwendet haben, können wertvolle Erkenntnisse liefern. Möglicherweise bieten wir Größenleitfäden oder -tabellen an, um Ihnen zu helfen, die Abmessungen der Tasche im Verhältnis zu den üblichen Gegenständen zu verstehen, die Sie möglicherweise mit sich führen, wie z. B. Laptops, Bücher oder Kleidung. Wenn Sie spezielle Fragen haben oder individuelle Empfehlungen benötigen, steht Ihnen unser Kundensupport-Team gerne zur Verfügung. Nutzen Sie unsere Live-Chat-Funktion oder kontaktieren Sie uns per E-Mail oder Telefon für eine fachkundige Beratung. Seien Sie versichert, dass wir über eine flexible Rückgabe- und Umtauschrichtlinie verfügen. Sollte die Tasche nicht Ihren Erwartungen entsprechen, können Sie sie in der Regel innerhalb einer bestimmten Frist zurückgeben oder umtauschen.", + "faq_type" => "shop", + "issued_by" => $this->shops[11] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 11, + "faq_title" => "Welche Maßnahmen ergreifen Sie, um die Qualität und Haltbarkeit der Taschen, die Sie online verkaufen, sicherzustellen?", + "slug" => "welche-maßnahmen-ergreifen-sie,-um-die-qualität-und-haltbarkeit-der-taschen,-die-sie-online-verkaufen,-sicherzustellen?", + "faq_description" => "Wir sind bestrebt, unseren Kunden hochwertige und langlebige Taschen anzubieten. So stellen wir die Qualität und Langlebigkeit der Taschen in unserem Onlineshop sicher. Wir stellen unsere Kollektion sorgfältig aus renommierten Marken zusammen, die für ihre Handwerkskunst und Qualität bekannt sind. Wir arbeiten mit Marken zusammen, die eine starke Erfolgsbilanz bei der Herstellung robuster und langlebiger Taschen vorweisen können. Jede Produktliste einer Tasche enthält detaillierte Informationen zu den bei der Herstellung verwendeten Materialien. Dadurch können Sie die Haltbarkeit und Eignung der Tasche für Ihre Bedürfnisse beurteilen. Für viele unserer Taschen gilt eine Herstellergarantie, die Material- und Verarbeitungsfehler abdeckt. Einzelheiten zur Garantie finden Sie in der Produktliste. Wir legen Wert auf Kundenfeedback und berücksichtigen es bei der Auswahl der Taschen für unseren Bestand. Positive Rezensionen und hohe Bewertungen zufriedener Kunden zeugen von der Produktqualität. Für den seltenen Fall, dass Sie eine Tasche mit Mängeln oder Qualitätsproblemen erhalten, können Sie das Produkt dank unserer Rückgabe- und Umtauschrichtlinie beruhigt zurückgeben oder umtauschen.", + "faq_type" => "shop", + "issued_by" => $this->shops[11] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 4, + "faq_title" => "Wie finde ich beim Online-Shopping die richtigen Make-up-Produkte für meinen Hautton und -typ?", + "slug" => "wie-finde-ich-beim-online-shopping-die-richtigen-make-up-produkte-für-meinen-hautton-und--typ?", + "faq_description" => "Der Online-Einkauf von Make-up wird mit den Tools und Ressourcen unserer Website einfacher, die Ihnen dabei helfen, die perfekten Produkte für Ihre Haut zu finden. Hier erfahren Sie, wie Sie beginnen. Jedes Make-up-Produkt auf unserer Website enthält detaillierte Beschreibungen, einschließlich Farbnamen, Untertönen und Inhaltsstoffen. Lesen Sie diese Beschreibungen sorgfältig durch, um Produkte zu finden, die zu Ihrem Hautton und -typ passen. Wir bieten Farbanpassungstools und Anleitungen für Grundierungen, Concealer und andere Teintprodukte. Mithilfe dieser Tools können Sie Ihren idealen Farbton anhand Ihres Hautuntertons ermitteln. Sehen Sie sich Produktrezensionen und Bewertungen anderer Kunden an, die ähnliche Hauttöne oder Bedenken haben. Ihr Feedback kann wertvolle Erkenntnisse über die Leistung eines Produkts liefern. Wenn Sie sich bei einem Produkt unsicher sind oder individuelle Empfehlungen benötigen, steht Ihnen unser Kundensupport-Team gerne zur Seite. Nutzen Sie unseren Live-Chat oder kontaktieren Sie uns per E-Mail oder Telefon für eine fachkundige Beratung. Für ausgewählte Produkte bieten wir möglicherweise Mustergrößen oder Tester an. Das Ausprobieren von Mustern kann eine gute Möglichkeit sein, Farbtöne und Formeln zu testen, bevor Sie sich für ein Produkt in Originalgröße entscheiden. Seien Sie versichert, dass wir über eine flexible Rückgabe- und Umtauschrichtlinie verfügen. Wenn ein Produkt nicht Ihren Erwartungen entspricht, können Sie es in der Regel innerhalb einer bestimmten Frist zurückgeben oder umtauschen.", + "faq_type" => "shop", + "issued_by" => $this->shops[4] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 4, + "faq_title" => "Wie stelle ich die Authentizität und Qualität der online gekauften Make-up-Produkte sicher?", + "slug" => "wie-stelle-ich-die-authentizität-und-qualität-der-online-gekauften-make-up-produkte-sicher?", + "faq_description" => "Wir legen großen Wert auf Authentizität und Qualität aller unserer Make-up-Produkte, um ein positives Einkaufserlebnis zu gewährleisten. So garantieren wir die Echtheit und Qualität unserer Produkte. Wir sind autorisierter Händler für alle von uns geführten Marken und Produkte. Das bedeutet, dass wir unsere Produkte direkt von namhaften Herstellern und Händlern beziehen. Make-up-Produkte werden in der originalen, versiegelten Verpackung geliefert. Wir verkaufen keine geöffneten oder manipulierten Produkte. Wir führen nur bekannte und vertrauenswürdige Make-up-Marken mit nachweislicher Erfolgsbilanz in Bezug auf Qualität und Sicherheit. Jede Produktliste auf unserer Website enthält detaillierte Informationen, einschließlich Marke, Inhaltsstoffe und Gebrauchsanweisungen, um Ihnen zu helfen, eine fundierte Entscheidung zu treffen. Wir legen Wert auf Kundenfeedback und berücksichtigen es bei der Auswahl der Produkte für unseren Bestand. Positive Rezensionen und hohe Bewertungen zufriedener Kunden zeugen von der Produktqualität. Für den unwahrscheinlichen Fall, dass Sie ein Produkt erhalten, das nicht Ihren Erwartungen entspricht, können Sie es dank unserer flexiblen Rückgabe- und Umtauschrichtlinie beruhigt zurückgeben oder umtauschen.", + "faq_type" => "shop", + "issued_by" => $this->shops[4] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 5, + "faq_title" => "Wie bestelle ich Backwaren auf Ihrer Website?", + "slug" => "wie-bestelle-ich-backwaren-auf-ihrer-website?", + "faq_description" => "Die Bestellung köstlicher Backwaren in unserem Online-Shop ist einfach und bequem. Hier finden Sie eine Schritt-für-Schritt-Anleitung zum Aufgeben einer Bestellung: Besuchen Sie unsere Website, um unser köstliches Sortiment an Backwaren zu entdecken. Sie können nach Kategorien suchen, einschließlich Brot, Gebäck, Kuchen und mehr. Klicken Sie auf die Artikel, die Sie kaufen möchten, um detaillierte Beschreibungen, Preise und verfügbare Optionen (z. B. Geschmacksrichtungen, Größen und Mengen) anzuzeigen. Legen Sie Ihre gewünschten Produkte in Ihren virtuellen Warenkorb. Bevor Sie zur Kasse gehen, überprüfen Sie die Artikel in Ihrem Warenkorb, um sicherzustellen, dass Sie alles ausgewählt haben, was Sie möchten. Sie können nach Bedarf Anpassungen vornehmen, Mengen aktualisieren oder Artikel entfernen. Wenn Sie bereit sind, Ihre Bestellung abzuschließen, gehen Sie zur Checkout-Seite. Hier geben Sie Ihre Lieferinformationen ein und wählen Ihr bevorzugtes Lieferdatum und -zeitfenster aus. Wählen Sie Ihre bevorzugte Zahlungsmethode, z. B. Kredit-/Debitkarte oder digitale Geldbörse, und geben Sie Ihre Zahlungsdaten sicher ein. Nach erfolgreicher Zahlung erhalten Sie eine Bestellbestätigung per E-Mail oder SMS. Diese Bestätigung enthält die Einzelheiten Ihrer Bestellung, das Lieferdatum und eine eindeutige Bestellnummer. Zum vereinbarten Liefertermin bereitet unser Team Ihre Backwaren sorgfältig vor und liefert sie an Ihre Haustür. Sie erhalten eine Benachrichtigung, wenn Ihre Bestellung unterwegs ist. Sobald Ihre köstlichen Backwaren angekommen sind, packen Sie sie einfach aus und genießen Sie Ihre frisch gebackenen Leckereien.", + "faq_type" => "shop", + "issued_by" => $this->shops[5] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 5, + "faq_title" => "Berücksichtigen Sie spezielle Ernährungsbedürfnisse oder Allergien?", + "slug" => "berücksichtigen-sie-spezielle-ernährungsbedürfnisse-oder-allergien?", + "faq_description" => "Ja, wir sind bestrebt, auf verschiedene Ernährungsbedürfnisse und Allergien einzugehen, um sicherzustellen, dass jeder unsere Backwaren genießen kann. So gehen wir auf spezifische Ernährungsbedürfnisse ein: Jedes Produkt auf unserer Website enthält detaillierte Informationen zu Allergenen wie Nüssen, Milchprodukten, Eiern und Gluten. Sie können diese Allergenetiketten überprüfen, um fundierte Entscheidungen zu treffen. Wir bieten eine Auswahl an Produkten an, die auf spezifische Ernährungspräferenzen und -beschränkungen zugeschnitten sind. Dazu können glutenfreie, vegane oder zuckerfreie Optionen gehören. Sie können Produkte auf unserer Website ganz einfach nach Ernährungskategorie filtern, um die passende Auswahl zu finden. In einigen Fällen können wir möglicherweise bestimmte Produkte an Ihre spezifischen Ernährungsbedürfnisse anpassen. Wenn Sie spezielle Wünsche oder spezielle Ernährungsbedürfnisse haben, wenden Sie sich bitte an unseren Kundendienst. Wir werden unser Bestes tun, um Ihnen zu helfen.", + "faq_type" => "shop", + "issued_by" => $this->shops[5] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 6, + "faq_title" => "Wie funktioniert der Online-Bestell- und Lieferprozess?", + "slug" => "wie-funktioniert-der-online-bestell--und-lieferprozess?", + "faq_description" => "Lebensmittel online bei uns zu bestellen ist einfach und bequem. Hier ist eine Schritt-für-Schritt-Anleitung für unseren Prozess: Besuchen Sie unsere Website oder mobile App, um unsere große Auswahl an Lebensmitteln zu durchsuchen. Sie können nach bestimmten Artikeln suchen oder Kategorien erkunden. Legen Sie die benötigten Produkte in Ihren virtuellen Warenkorb. Überprüfen Sie vor dem Bezahlen Ihren Warenkorb, um sicherzustellen, dass Sie alles haben, was Sie brauchen. Sie können Ihre Bestellung auch individuell anpassen, Mengen angeben und alle erforderlichen Anpassungen vornehmen. Gehen Sie zur Checkout-Seite, um Ihre Bestellung ein letztes Mal zu überprüfen. Sie können Ihre bevorzugte Zahlungsmethode auswählen, einschließlich Kredit-/Debitkarten oder digitale Geldbörsen, und die Transaktion sicher abschließen. Wählen Sie Ihr bevorzugtes Lieferzeitfenster. Wir bieten flexible Lieferoptionen, um Ihrem Zeitplan gerecht zu werden. Sobald Ihre Bestellung aufgegeben wurde, erhalten Sie eine Bestellbestätigung per E-Mail oder SMS. Sie können den Status Ihrer Bestellung über Ihr Konto verfolgen. Unser engagiertes Lieferteam verpackt Ihre Lebensmittel sorgfältig und liefert sie zum gewünschten Zeitpunkt an Ihre Haustür. Sie erhalten eine Benachrichtigung, wenn Ihre Bestellung zur Lieferung bereit ist. Empfangen Sie Ihre Lebensmittel, packen Sie sie aus und genießen Sie Ihre frischen und hochwertigen Produkte.", + "faq_type" => "shop", + "issued_by" => $this->shops[6] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 6, + "faq_title" => "Wie hoch sind die Liefergebühren und Mindestbestellanforderungen?", + "slug" => "wie-hoch-sind-die-liefergebühren-und-mindestbestellanforderungen?", + "faq_description" => "Unser Ziel ist es, erschwinglichen und bequemen Online-Lebensmitteleinkauf anzubieten. Unsere Liefergebühren und Mindestbestellanforderungen sind wie folgt: Die Liefergebühr kann je nach Ihrem Standort und dem von Ihnen gewählten Zeitfenster variieren. Wir sind bestrebt, unsere Versandkosten wettbewerbsfähig und transparent zu halten. Die anfallenden Gebühren können Sie während des Bestellvorgangs einsehen. Um eine Bestellung zur Lieferung aufzugeben, gilt eine Mindestbestellmenge. Diese Anforderung hilft uns, die Kosten zu decken, die mit der Verpackung und Lieferung Ihrer Lebensmittel verbunden sind. Der Mindestbestellwert kann je nach Standort variieren, Sie können den spezifischen Mindestbestellwert für Ihre Region jedoch ganz einfach auf unserer Website oder App überprüfen. Bitte beachten Sie, dass wir von Zeit zu Zeit Werbeaktionen und Rabatte anbieten können, einschließlich der Befreiung von den Liefergebühren für Bestellungen über einem bestimmten Bestellwert. Halten Sie Ausschau nach diesen Sonderangeboten, um beim Online-Lebensmitteleinkauf noch mehr zu sparen.", + "faq_type" => "shop", + "issued_by" => $this->shops[6] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 7, + "faq_title" => "Kann ich in Ihrem Shop sowohl physische Bücher als auch E-Books bestellen?", + "slug" => "kann-ich-in-ihrem-shop-sowohl-physische-bücher-als-auch-e-books-bestellen?", + "faq_description" => "Ja, Sie können in unserem Shop aus einer großen Auswahl an physischen Büchern und E-Books wählen. Stöbern Sie einfach in unserem Katalog und wählen Sie für jeden Titel Ihr bevorzugtes Format aus. Physische Bücher werden an Ihre Adresse geliefert, während E-Books sofort nach dem Kauf heruntergeladen werden können.", + "faq_type" => "shop", + "issued_by" => $this->shops[7] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 7, + "faq_title" => "Bieten Sie Buchempfehlungen an oder haben Sie einen Buchclub?", + "slug" => "bieten-sie-buchempfehlungen-an-oder-haben-sie-einen-buchclub?", + "faq_description" => "Wir lieben Bücher und sind hier, um Ihnen dabei zu helfen, neue Lektüre zu entdecken! In unserem Bereich „Empfohlene Lektüre“ finden Sie kuratierte Buchempfehlungen. Darüber hinaus veranstalten wir regelmäßig virtuelle Buchclub-Veranstaltungen, bei denen Leser gemeinsam über Bücher diskutieren und sie erkunden können. Bleiben Sie dran für Ankündigungen auf unserer Website oder in den sozialen Medien.", + "faq_type" => "shop", + "issued_by" => $this->shops[7] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 9, + "faq_title" => "Bieten Sie eine Garantie für elektronische Geräte an?", + "slug" => "bieten-sie-eine-garantie-für-elektronische-geräte-an?", + "faq_description" => "Ja, für die meisten elektronischen Geräte gilt eine Herstellergarantie, die Defekte und Fehlfunktionen abdeckt. Die Garantiedauer und -bedingungen variieren je nach Produkt und Marke. Garantieinformationen finden Sie in den Produktbeschreibungen oder wenden Sie sich für spezifische Details an unseren Kundensupport.", + "faq_type" => "shop", + "issued_by" => $this->shops[9] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 9, + "faq_title" => "Sind Ihre Geräte brandneu oder bieten Sie auch generalüberholte Optionen an?", + "slug" => "sind-ihre-geräte-brandneu-oder-bieten-sie-auch-generalüberholte-optionen-an?", + "faq_description" => "Wir bieten in erster Linie brandneue Geräte an, gelegentlich sind jedoch auch zertifizierte, generalüberholte Geräte verfügbar. In jeder Produktliste wird angegeben, ob es sich um ein neues Produkt oder ein generalüberholtes Produkt handelt. Überholte Geräte werden gründlichen Tests und Qualitätskontrollen unterzogen, um sicherzustellen, dass sie hohen Standards entsprechen.", + "faq_type" => "shop", + "issued_by" => $this->shops[9] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 10, + "faq_title" => "Kann ich in Ihrem Online-Medizinshop verschreibungspflichtige Medikamente bestellen?", + "slug" => "kann-ich-in-ihrem-online-medizinshop-verschreibungspflichtige-medikamente-bestellen?", + "faq_description" => "Wir bieten keine verschreibungspflichtigen Medikamente an. Unser Shop ist auf rezeptfreie (OTC) und Wellness-Produkte spezialisiert. Für verschreibungspflichtige Medikamente und Ratschläge wenden Sie sich bitte an einen Arzt.", + "faq_type" => "shop", + "issued_by" => $this->shops[10] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => 10, + "faq_title" => "Welche Maßnahmen ergreifen Sie, um die Echtheit und Sicherheit der von Ihnen verkauften Arzneimittel sicherzustellen?", + "slug" => "welche-maßnahmen-ergreifen-sie,-um-die-echtheit-und-sicherheit-der-von-ihnen-verkauften-arzneimittel-sicherzustellen?", + "faq_description" => "Wir arbeiten ausschließlich mit vertrauenswürdigen Lieferanten und Marken zusammen, um die Authentizität und Sicherheit der Medikamente und Wellnessprodukte in unserem Bestand zu gewährleisten. Alle Produkte stammen von lizenzierten Herstellern und unterliegen strengen Qualitäts- und Sicherheitsstandards.", + "faq_type" => "shop", + "issued_by" => $this->shops[10] ?? '', + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + ]; + } + } +} diff --git a/packages/marvel/src/Database/Seeders/MarvelSeeder.php b/packages/marvel/src/Database/Seeders/MarvelSeeder.php new file mode 100644 index 0000000..4529435 --- /dev/null +++ b/packages/marvel/src/Database/Seeders/MarvelSeeder.php @@ -0,0 +1,24 @@ +call([ + RefundReasonSeeder::class, + RefundPolicySeeder::class, + FaqSeeder::class, + TermsAndConditionSeeder::class, + ]); + } +} diff --git a/packages/marvel/src/Database/Seeders/RefundPolicySeeder.php b/packages/marvel/src/Database/Seeders/RefundPolicySeeder.php new file mode 100644 index 0000000..6411e75 --- /dev/null +++ b/packages/marvel/src/Database/Seeders/RefundPolicySeeder.php @@ -0,0 +1,160 @@ +insert([ + [ + "title" => "Vendor Return Policy", + "slug" => "vendor-return-policy", + "description" => "Our vendor return policy ensures that you can return products within 30 days of purchase if they are damaged or not as described.", + "target" => "vendor", + "language" => "en", + "status" => "approved", + "shop_id" => 1, + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "title" => "Customer Return Policy", + "slug" => "customer-return-policy", + "description" => "Our customer return policy allows you to return products within 14 days of purchase for a full refund, no questions asked.", + "target" => "customer", + "language" => "en", + "status" => "approved", + "shop_id" => 2, + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "title" => "Electronics Return Policy", + "slug" => "electronics-return-policy", + "description" => "For electronics, our return policy extends to 60 days. We stand by the quality of our electronic products.", + "target" => "customer", + "language" => "en", + "status" => "approved", + "shop_id" => 1, + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "title" => "Furniture Return Policy", + "slug" => "furniture-return-policy", + "description" => "Our furniture return policy allows you to return furniture within 7 days if it doesn't meet your expectations. Customer satisfaction is our priority.", + "target" => "customer", + "language" => "en", + "status" => "approved", + "shop_id" => 1, + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "title" => "Custom Orders Policy", + "slug" => "custom-orders-policy", + "description" => "Please note that custom orders are not eligible for returns or refunds. We craft custom items to your specifications.", + "target" => "customer", + "language" => "en", + "status" => "approved", + "shop_id" => 2, + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + ...$this->refundPolicySeederGerman() + ]); + } + + + /** + * refundPolicySeederGerman + * + * @return array + */ + private function refundPolicySeederGerman(): array + { + if (!TRANSLATION_ENABLED) { + return []; + } else { + return [ + [ + "title" => "Rückgabebedingungen des Anbieters", + "slug" => "rückgabebedingungen-des-anbieters", + "description" => "Unsere Rückgaberichtlinie des Anbieters stellt sicher, dass Sie Produkte innerhalb von 30 Tagen nach dem Kauf zurückgeben können, wenn sie beschädigt sind oder nicht der Beschreibung entsprechen.", + "target" => "vendor", + "language" => "de", + "status" => "approved", + "shop_id" => 1, + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "title" => "Rückgabebedingungen für Kunden", + "slug" => "rückgabebedingungen-für-kunden", + "description" => "Unsere Rückgaberichtlinie für Kunden ermöglicht es Ihnen, Produkte innerhalb von 14 Tagen nach dem Kauf gegen eine vollständige Rückerstattung zurückzugeben, ohne dass Fragen gestellt werden.", + "target" => "customer", + "language" => "de", + "status" => "approved", + "shop_id" => 2, + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "title" => "Rückgabebedingungen für Elektronik", + "slug" => "rückgabebedingungen-für-elektronik", + "description" => "Für Elektronik gilt eine Rückgabefrist von 60 Tagen. Wir stehen für die Qualität unserer elektronischen Produkte.", + "target" => "customer", + "language" => "de", + "status" => "approved", + "shop_id" => 3, + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "title" => "Rückgabebedingungen für Möbel", + "slug" => "rückgabebedingungen-für-möbel", + "description" => "Unsere Rückgaberichtlinie für Möbel ermöglicht es Ihnen, Möbel innerhalb von 7 Tagen zurückzugeben, wenn sie nicht Ihren Erwartungen entsprechen. Kundenzufriedenheit ist unsere Priorität.", + "target" => "customer", + "language" => "de", + "status" => "approved", + "shop_id" => 4, + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "title" => "Richtlinien für Sonderanfertigungen", + "slug" => "richtlinien-für-sonderanfertigungen", + "description" => "Bitte beachten Sie, dass Sonderanfertigungen von der Rückgabe oder Rückerstattung ausgeschlossen sind. Wir fertigen maßgeschneiderte Artikel nach Ihren Vorgaben.", + "target" => "customer", + "language" => "de", + "status" => "approved", + "shop_id" => 5, + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + ]; + } + } +} diff --git a/packages/marvel/src/Database/Seeders/RefundReasonSeeder.php b/packages/marvel/src/Database/Seeders/RefundReasonSeeder.php new file mode 100644 index 0000000..3f35f74 --- /dev/null +++ b/packages/marvel/src/Database/Seeders/RefundReasonSeeder.php @@ -0,0 +1,240 @@ +insert([ + [ + "name" => "Product Not as Described", + "slug" => "product-not-as-described", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Wrong Item Shipped", + "slug" => "wrong-item-shipped", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Damaged Item", + "slug" => "damaged-item", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Cancelled Order", + "slug" => "cancelled-order", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Late Delivery", + "slug" => "late-delivery", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Item Not Needed", + "slug" => "item-not-needed", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Changed Mind", + "slug" => "changed-mind", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Others", + "slug" => "others", + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + ...$this->getGermanDummyData() + ]); + } + + /** + * getGermanDummyData + * + * @return array + */ + private function getGermanDummyData(): array + { + + if (!TRANSLATION_ENABLED) { + return []; + } else { + return [ + [ + "name" => "Produkt nicht wie beschrieben", + "slug" => "produkt-nicht-wie-beschrieben", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Falscher Artikel geliefert", + "slug" => "falscher-artikel-geliefert", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Beschädigter Artikel", + "slug" => "beschädigter-artikel", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Bestellung storniert", + "slug" => "bestellung-storniert", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Lieferung verzögert", + "slug" => "lieferung-verzögert", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Artikel nicht benötigt", + "slug" => "artikel-nicht-benötigt", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Meinung geändert", + "slug" => "meinung-geändert", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + [ + "name" => "Sonstiges", + "slug" => "sonstiges", + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'deleted_at' => null, + ], + ]; + } + } + + // private function getEnglishDummyData(): array + // { + // return [ + // [ + // "name" => "Product Not as Described", + // "slug" => "product-not-as-described", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "name" => "Wrong Item Shipped", + // "slug" => "wrong-item-shipped", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "name" => "Damaged Item", + // "slug" => "damaged-item", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "name" => "Cancelled Order", + // "slug" => "cancelled-order", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "name" => "Late Delivery", + // "slug" => "late-delivery", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "name" => "Item Not Needed", + // "slug" => "item-not-needed", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "name" => "Changed Mind", + // "slug" => "changed-mind", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ], + // [ + // "name" => "Others", + // "slug" => "others", + // "language" => "en", + // 'created_at' => Carbon::now(), + // 'updated_at' => Carbon::now(), + // 'deleted_at' => null, + // ] + + // ]; + // } +} diff --git a/packages/marvel/src/Database/Seeders/SettingsSeeder.php b/packages/marvel/src/Database/Seeders/SettingsSeeder.php new file mode 100644 index 0000000..1f6960a --- /dev/null +++ b/packages/marvel/src/Database/Seeders/SettingsSeeder.php @@ -0,0 +1,264 @@ +insert([ + 'options' => json_encode([ + "seo" => [ + 'ogImage' => null, + 'ogTitle' => null, + 'metaTags' => null, + 'metaTitle' => null, + 'canonicalUrl' => null, + 'ogDescription' => null, + 'twitterHandle' => null, + 'metaDescription' => null, + 'twitterCardType' => null + ], + "logo" => [ + + "id" => "258", + "original" => "https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/258/logo-final2x.png", + "thumbnail" => "https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/258/conversions/logo-final2x-thumbnail.jpg", + 'file_name' => 'logo-final2x.png' + ], + "collapseLogo" => [ + 'thumbnail' => 'https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/345/conversions/favicon-black-thumbnail.jpg', + 'original' => 'https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/345/favicon-black.png', + 'id' => 345, + 'file_name' => 'favicon-black.png' + ], + "useOtp" => false, + "currency" => "USD", + "taxClass" => "1", + "siteTitle" => "ChawkBazar", + "deliveryTime" => [ + [ + "title" => "Express Delivery", + "description" => "90 min express delivery" + ], + [ + "title" => "Morning", + "description" => "8.00 AM - 11.00 AM" + ], + [ + "title" => "Noon", + "description" => "11.00 AM - 2.00 PM" + ], + [ + "title" => "Afternoon", + "description" => "2.00 PM - 5.00 PM" + ], + [ + "title" => "Evening", + "description" => "5.00 PM - 8.00 PM" + ] + ], + "freeShipping" => false, + "signupPoints" => 100, + "siteSubtitle" => "Your next ecommerce", + "useGoogleMap" => false, + "shippingClass" => "1", + "contactDetails" => [ + "contact" => "+129290122122", + "socials" => [ + [ + "url" => "https://www.facebook.com/redqinc", + "icon" => "FacebookIcon" + ], + [ + "url" => "https://twitter.com/RedqTeam", + "icon" => "TwitterIcon" + ], + [ + "url" => "https://www.instagram.com/redqteam", + "icon" => "InstagramIcon" + ] + ], + "website" => "https://redq.io", + "emailAddress" => "demo@demo.com", + "location" => [ + "lat" => 42.9585979, + "lng" => -76.9087202, + "zip" => null, + "city" => null, + "state" => "NY", + "country" => "United States", + "formattedAddress" => "NY State Thruway, New York, USA" + ] + ], + "paymentGateway" => [ + [ + "name" => "stripe", + "title" => "Stripe" + ] + ], + "currencyOptions" => [ + "formation" => "en-US", + "fractions" => 2 + ], + "enableCoupons" => true, + "enableTerms" => true, + "isMultiCommissionRate" => false, + "enableReviewPopup" => false, + "isProductReview" => false, + "useEnableGateway" => false, + "useCashOnDelivery" => true, + "freeShippingAmount" => 0, + "minimumOrderAmount" => 0, + "useMustVerifyEmail" => false, + "maximumQuestionLimit" => 5, + "currencyToWalletRatio" => 3, + "enableEmailForDigitalProduct" => false, + "StripeCardOnly" => false, + "guestCheckout" => true, + "server_info" => server_environment_info(), + "useAi" => false, + "defaultAi" => "openai", + "maxShopDistance" => 1000, + "mailchimpSubscribeText" => "Thank you for subscribing", + "siteLink" => "https://chawkbazar.redq.io/", + "copyrightText" => "Copyright © REDQ. All rights reserved worldwide.", + "externalText" => "REDQ", + "externalLink" => "https://redq.io", + "reviewSystem" => [ + "value" => "review_single_time", + "name" => "Give purchased product a review only for one time. (By default)" + ], + ...$this->getSmsEmailEvents(), + ...$this->maintenanceSettings(), + ...$this->promoPopupSettings(), + ]), + "language" => DEFAULT_LANGUAGE ?? "en", + "created_at" => Carbon::now(), + "updated_at" => Carbon::now(), + ]); + } + + /** + * The function returns an array of SMS and email events with their corresponding recipients and + * event types. + * + * @return array An array containing events for SMS and email notifications for different user + * roles (admin, vendor, and customer) related to order status changes, refunds, payments, creating + * questions, creating reviews, and answering questions. + */ + private function getSmsEmailEvents(): array + { + return [ + "smsEvent" => [ + "admin" => [ + "statusChangeOrder" => false, + "refundOrder" => false, + "paymentOrder" => false + ], + "vendor" => [ + "statusChangeOrder" => false, + "paymentOrder" => false, + "refundOrder" => false + ], + "customer" => [ + "statusChangeOrder" => false, + "refundOrder" => false, + "paymentOrder" => false + ] + ], + "emailEvent" => [ + "admin" => [ + "statusChangeOrder" => false, + "refundOrder" => false, + "paymentOrder" => false + ], + "vendor" => [ + "createQuestion" => false, + "statusChangeOrder" => false, + "refundOrder" => false, + "paymentOrder" => false, + "createReview" => false + ], + "customer" => [ + "statusChangeOrder" => false, + "refundOrder" => false, + "paymentOrder" => false, + "answerQuestion" => false + ] + ], + "pushNotification" => [ + "all" => [ + "order" => false, + "message" => false, + "storeNotice" => false + ], + ], + ]; + } + private function maintenanceSettings(): array + { + return [ + "isUnderMaintenance" => false, + "maintenance" => [ + "title" => "Site is under Maintenance", + "buttonTitleOne" => "Notify Me", + "newsLetterTitle" => "Subscribe Newsletter", + "buttonTitleTwo" => "Contact Us", + "contactUsTitle" => "Contact Us", + "aboutUsTitle" => "About Us", + "isOverlayColor" => false, + "overlayColor" => null, + "overlayColorRange" => null, + "description" => "We are currently undergoing essential maintenance to elevate your browsing experience. Our team is working diligently to implement improvements that will bring you an even more seamless and enjoyable interaction with our site. During this period, you may experience temporary inconveniences. We appreciate your patience and understanding. Thank you for being a part of our community, and we look forward to unveiling the enhanced features and content soon.", + "newsLetterDescription" => "Stay in the loop! Subscribe to our newsletter for exclusive deals and the latest trends delivered straight to your inbox. Elevate your shopping experience with insider access.", + "aboutUsDescription" => "Welcome to Chawkbazar, your go-to destination for curated excellence. Discover a fusion of style, quality, and affordability in every click. Join our community and elevate your shopping experience with us!", + "image" => [ + 'id' => 346, + 'file_name' => "background.png", + 'original' => "https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/346/background.png", + 'thumbnail' => "https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/346/conversions/background-thumbnail.jpg", + ], + "start" => Carbon::now(), + "until" => Carbon::now()->addDays(1), + ], + ]; + } + private function promoPopupSettings(): array + { + return [ + "isPromoPopUp" => true, + "promoPopup" => [ + "image" => [ + "id" => 327, + "original" => "https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/327/Chawkbazar-img.png", + "file_name" => "Chawkbazar-img.png", + "thumbnail" => "https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/327/conversions/Chawkbazar-img-thumbnail.jpg" + ], + "title" => "Get 25% Discount", + "popUpDelay" => 5000, + "description" => "Subscribe to the mailing list to receive updates on new arrivals, special offers and our promotions.", + "popUpNotShow" => [ + "title" => "Don't show this popup again", + "popUpExpiredIn" => 7 + ], + "isPopUpNotShow" => true, + "popUpExpiredIn" => 1 + ], + ]; + } +} diff --git a/packages/marvel/src/Database/Seeders/TermsAndConditionSeeder.php b/packages/marvel/src/Database/Seeders/TermsAndConditionSeeder.php new file mode 100644 index 0000000..6fe9766 --- /dev/null +++ b/packages/marvel/src/Database/Seeders/TermsAndConditionSeeder.php @@ -0,0 +1,182 @@ +insert([ + [ + "user_id" => 1, + "shop_id" => null, + "title" => "Disclaimers and Limitation of Liability", + "slug" => "disclaimers-and-limitation-of-liability", + "description" => 'The Website is provided "as is" and "as available" without any warranties, either expressed or implied. Pickbazar shall not be liable for any direct, indirect, incidental, special, consequential, or punitive damages resulting from the use or inability to use the Website.', + "type" => "global", + "issued_by" => "Super Admin", + "is_approved" => true, + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "title" => "Intellectual Property", + "slug" => "intellectual-property", + "description" => "The Website and its original content, features, and functionality are owned by [Your Company] and are protected by international copyright, trademark, and other intellectual property laws.", + "type" => "global", + "issued_by" => "Super Admin", + "is_approved" => true, + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "title" => "Privacy Policy", + "slug" => "privacy-policy", + "description" => "Your use of the Website is also governed by our Privacy Policy, which can be found [link to Privacy Policy]. By using the Website, you consent to the practices described in the Privacy Policy.", + "type" => "global", + "issued_by" => "Super Admin", + "is_approved" => true, + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "title" => "Use of the Website", + "slug" => "use-of-the-website", + "description" => "You must be at least [Age] years old to use this Website. By using the Website, you represent and warrant that you are at least [Age] years old. You agree to use the Website for lawful purposes only and in a manner that does not infringe upon the rights of others.", + "type" => "global", + "issued_by" => "Super Admin", + "is_approved" => true, + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "title" => "Acceptance of Terms", + "slug" => "acceptance-of-terms", + "description" => "By using this Website, you agree to comply with and be bound by these terms and conditions. If you do not agree to these terms, please do not use the Website.", + "type" => "global", + "issued_by" => "Super Admin", + "is_approved" => true, + "language" => "en", + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + ...$this->termsAndConditionsSeederGerman() + ]); + } + + /** + * termsAndConditionsSeederGerman + * + * @return array + */ + private function termsAndConditionsSeederGerman(): array + { + if (!TRANSLATION_ENABLED) { + return []; + } else { + return [ + [ + "user_id" => 1, + "shop_id" => null, + "title" => "Haftungsausschluss und Haftungsbeschränkung", + "slug" => "haftungsausschluss-und-haftungsbeschränkung", + "description" => 'Die Website wird „wie besehen“ und „wie verfügbar“ ohne jegliche ausdrückliche oder stillschweigende Gewährleistung bereitgestellt. Pickbazar haftet nicht für direkte, indirekte, zufällige, besondere, Folge- oder Strafschäden, die sich aus der Nutzung oder Unmöglichkeit der Nutzung der Website ergeben.', + "type" => "global", + "issued_by" => "Super Admin", + "is_approved" => true, + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + + "user_id" => 1, + "shop_id" => null, + "title" => "Geistiges Eigentum", + "slug" => "geistiges-eigentum", + "description" => "Die Website und ihre ursprünglichen Inhalte, Merkmale und Funktionen sind Eigentum von [Ihrem Unternehmen] und durch internationale Urheber-, Marken- und andere Gesetze zum Schutz des geistigen Eigentums geschützt.", + "type" => "global", + "issued_by" => "Super Admin", + "is_approved" => true, + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + + "user_id" => 1, + "shop_id" => null, + "title" => "Datenschutzrichtlinie", + "slug" => "datenschutzrichtlinie", + "description" => "Ihre Nutzung der Website unterliegt außerdem unserer Datenschutzrichtlinie, die Sie unter [Link zur Datenschutzrichtlinie] finden. Durch die Nutzung der Website stimmen Sie den in der Datenschutzrichtlinie beschriebenen Praktiken zu.", + "type" => "global", + "issued_by" => "Super Admin", + "is_approved" => true, + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + + "user_id" => 1, + "shop_id" => null, + "title" => "Nutzung der Website", + "slug" => "nutzung-der-website", + "description" => "Sie müssen mindestens [Alter] Jahre alt sein, um diese Website nutzen zu können. Durch die Nutzung der Website erklären und garantieren Sie, dass Sie mindestens [Alter] Jahre alt sind. Sie erklären sich damit einverstanden, die Website nur für rechtmäßige Zwecke und in einer Weise zu nutzen, die nicht die Rechte anderer verletzt.", + "type" => "global", + "issued_by" => "Super Admin", + "is_approved" => true, + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + [ + "user_id" => 1, + "shop_id" => null, + "title" => "Annahme der Bedingungen", + "slug" => "annahme-der-bedingungen", + "description" => "Durch die Nutzung dieser Website erklären Sie sich damit einverstanden, diese Allgemeinen Geschäftsbedingungen einzuhalten und an sie gebunden zu sein. Wenn Sie diesen Bedingungen nicht zustimmen, nutzen Sie die Website bitte nicht.", + "type" => "global", + "issued_by" => "Super Admin", + "is_approved" => true, + "language" => "de", + 'created_at' => Carbon::now(), + 'updated_at' => null, + 'deleted_at' => null, + ], + ]; + } + } +} diff --git a/packages/marvel/src/Enums/AiType.php b/packages/marvel/src/Enums/AiType.php new file mode 100644 index 0000000..0ba67d6 --- /dev/null +++ b/packages/marvel/src/Enums/AiType.php @@ -0,0 +1,15 @@ +shop = $shop; + $this->balance = $balance; + } +} diff --git a/packages/marvel/src/Events/DigitalProductUpdateEvent.php b/packages/marvel/src/Events/DigitalProductUpdateEvent.php new file mode 100644 index 0000000..1a3bac5 --- /dev/null +++ b/packages/marvel/src/Events/DigitalProductUpdateEvent.php @@ -0,0 +1,30 @@ +product = $product; + $this->user = $user; + $this->optional_data = $optional_data; + } +} diff --git a/packages/marvel/src/Events/FlashSaleProcessed.php b/packages/marvel/src/Events/FlashSaleProcessed.php new file mode 100644 index 0000000..8909d37 --- /dev/null +++ b/packages/marvel/src/Events/FlashSaleProcessed.php @@ -0,0 +1,30 @@ +action = $action; + $this->language = $language; + $this->optional_data = $optional_data; + } +} diff --git a/packages/marvel/src/Events/Maintenance.php b/packages/marvel/src/Events/Maintenance.php new file mode 100644 index 0000000..932a7d1 --- /dev/null +++ b/packages/marvel/src/Events/Maintenance.php @@ -0,0 +1,27 @@ +language = $language; + } +} diff --git a/packages/marvel/src/Events/MessageSent.php b/packages/marvel/src/Events/MessageSent.php new file mode 100644 index 0000000..e9680eb --- /dev/null +++ b/packages/marvel/src/Events/MessageSent.php @@ -0,0 +1,145 @@ +message = $message; + $this->conversation = $conversation; + $this->type = $type; + $this->user = $user; + } + + /** + * Get the channels the event should broadcast on. + * + * @return array + */ + public function broadcastOn(): array + { + switch ($this->type) { + case 'shop': + // this case happen when admin send message to shop/vendor + $shop_owner = Shop::findOrFail($this->conversation->shop_id); + return [ + new PrivateChannel('message.created.' . $shop_owner->owner_id) + ]; + break; + + case 'user': + // this case happen when user send message to admin + $event_channels = []; + foreach ($this->getAdminUsers() as $key => $user) { + $channel_name = new PrivateChannel('message.created.' . $user->id); + array_push($event_channels, $channel_name); + } + return $event_channels; + break; + } + } + + /** + * Get the data to broadcast. + * + * @return array + */ + public function broadcastWith(): array + { + return [ + 'message' => '1 new message', + ]; + } + + /** + * The event's broadcast name. + */ + public function broadcastAs(): string + { + // event's name will be written here. + return 'message.event'; + } + + /** + * Determine if this event should broadcast. + */ + public function broadcastWhen(): bool + { + try { + $settings = Settings::first(); + $enableBroadCast = false; + + if (!config('shop.pusher.enabled')) { + return false; + } + + if (isset($settings->options['pushNotification']['all']['message'])) { + if ($settings->options['pushNotification']['all']['message'] == true) { + $enableBroadCast = true; + } + } + return $enableBroadCast; + // return $settings->options['pushNotification']['all']['message'] == true; + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG, $th->getMessage()); + } + } +} diff --git a/packages/marvel/src/Events/OrderCancelled.php b/packages/marvel/src/Events/OrderCancelled.php new file mode 100644 index 0000000..8fe1942 --- /dev/null +++ b/packages/marvel/src/Events/OrderCancelled.php @@ -0,0 +1,26 @@ +order = $order; + } +} diff --git a/packages/marvel/src/Events/OrderCreated.php b/packages/marvel/src/Events/OrderCreated.php new file mode 100644 index 0000000..969d1f4 --- /dev/null +++ b/packages/marvel/src/Events/OrderCreated.php @@ -0,0 +1,142 @@ +order = $order; + $this->invoiceData = $invoiceData; + $this->user = $user; + } + + /** + * Get the channels the event should broadcast on. + * + * @return array + */ + public function broadcastOn(): array + { + $event_channels = $shop_ids = $vendor_ids = []; + + // Notify in admin-end + $admins = $this->getAdminUsers(); + if (isset($admins)) { + foreach ($admins as $key => $user) { + $channel_name = new PrivateChannel('order.created.' . $user->id); + array_push($event_channels, $channel_name); + } + } + + + // Notify in vendor-end + if (isset($this->order->products)) { + foreach ($this->order->products as $key => $product) { + if (!in_array($product->shop_id, $shop_ids)) { + $vendor_shop = Shop::findOrFail($product->shop_id); + if (!in_array($vendor_shop->owner_id, $vendor_ids)) { + array_push($vendor_ids, $vendor_shop->owner_id); + } + array_push($shop_ids, $product->shop_id); + } + } + } + + if (isset($vendor_ids)) { + foreach ($vendor_ids as $key => $vendor_id) { + $channel_name = new PrivateChannel('order.created.' . $vendor_id); + array_push($event_channels, $channel_name); + } + } + + return $event_channels; + } + + + /** + * Get the data to broadcast. + * + * @return array + */ + public function broadcastWith(): array + { + return [ + 'message' => 'One new order created.' + ]; + } + + /** + * The event's broadcast name. + */ + public function broadcastAs(): string + { + // event's name will be written here. + return 'order.create.event'; + } + + /** + * Determine if this event should broadcast. + */ + public function broadcastWhen(): bool + { + try { + $settings = Settings::first(); + $enableBroadCast = false; + + if (config('shop.pusher.enabled') === null) { + return false; + } + + if (isset($settings->options['pushNotification']['all']['order'])) { + if ($settings->options['pushNotification']['all']['order'] == true) { + $enableBroadCast = true; + } + } + return $enableBroadCast; + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG, $th->getMessage()); + } + } +} diff --git a/packages/marvel/src/Events/OrderDelivered.php b/packages/marvel/src/Events/OrderDelivered.php new file mode 100644 index 0000000..3abe6bb --- /dev/null +++ b/packages/marvel/src/Events/OrderDelivered.php @@ -0,0 +1,28 @@ +order = $order; + } +} diff --git a/packages/marvel/src/Events/OrderProcessed.php b/packages/marvel/src/Events/OrderProcessed.php new file mode 100644 index 0000000..b308804 --- /dev/null +++ b/packages/marvel/src/Events/OrderProcessed.php @@ -0,0 +1,26 @@ +order = $order; + } +} diff --git a/packages/marvel/src/Events/OrderReceived.php b/packages/marvel/src/Events/OrderReceived.php new file mode 100644 index 0000000..6d4dd2a --- /dev/null +++ b/packages/marvel/src/Events/OrderReceived.php @@ -0,0 +1,22 @@ +order = $order; + } +} diff --git a/packages/marvel/src/Events/OrderStatusChanged.php b/packages/marvel/src/Events/OrderStatusChanged.php new file mode 100644 index 0000000..a656feb --- /dev/null +++ b/packages/marvel/src/Events/OrderStatusChanged.php @@ -0,0 +1,28 @@ +order = $order; + } +} diff --git a/packages/marvel/src/Events/OwnershipTransferStatusControl.php b/packages/marvel/src/Events/OwnershipTransferStatusControl.php new file mode 100644 index 0000000..98a9a87 --- /dev/null +++ b/packages/marvel/src/Events/OwnershipTransferStatusControl.php @@ -0,0 +1,29 @@ +ownershipTransfer = $ownershipTransfer; + } +} diff --git a/packages/marvel/src/Events/PaymentFailed.php b/packages/marvel/src/Events/PaymentFailed.php new file mode 100644 index 0000000..bb2d7d4 --- /dev/null +++ b/packages/marvel/src/Events/PaymentFailed.php @@ -0,0 +1,26 @@ +order = $order; + } +} diff --git a/packages/marvel/src/Events/PaymentMethods.php b/packages/marvel/src/Events/PaymentMethods.php new file mode 100644 index 0000000..781f7cb --- /dev/null +++ b/packages/marvel/src/Events/PaymentMethods.php @@ -0,0 +1,26 @@ +payment_methods = $payment_methods; + } +} diff --git a/packages/marvel/src/Events/PaymentSuccess.php b/packages/marvel/src/Events/PaymentSuccess.php new file mode 100644 index 0000000..12b68cf --- /dev/null +++ b/packages/marvel/src/Events/PaymentSuccess.php @@ -0,0 +1,26 @@ +order = $order; + } +} diff --git a/packages/marvel/src/Events/ProcessOwnershipTransition.php b/packages/marvel/src/Events/ProcessOwnershipTransition.php new file mode 100644 index 0000000..ac778fb --- /dev/null +++ b/packages/marvel/src/Events/ProcessOwnershipTransition.php @@ -0,0 +1,46 @@ +shop = $shop; + $this->previousOwner = $previousOwner; + $this->newOwner = $newOwner; + $this->optional = $optional; + } +} diff --git a/packages/marvel/src/Events/ProcessUserData.php b/packages/marvel/src/Events/ProcessUserData.php new file mode 100644 index 0000000..b8fa54c --- /dev/null +++ b/packages/marvel/src/Events/ProcessUserData.php @@ -0,0 +1,19 @@ +appData = $appData; + } +} diff --git a/packages/marvel/src/Events/ProductReviewApproved.php b/packages/marvel/src/Events/ProductReviewApproved.php new file mode 100644 index 0000000..46b20ca --- /dev/null +++ b/packages/marvel/src/Events/ProductReviewApproved.php @@ -0,0 +1,26 @@ +product = $product; + } +} diff --git a/packages/marvel/src/Events/ProductReviewRejected.php b/packages/marvel/src/Events/ProductReviewRejected.php new file mode 100644 index 0000000..d2726a9 --- /dev/null +++ b/packages/marvel/src/Events/ProductReviewRejected.php @@ -0,0 +1,26 @@ +product = $product; + } +} diff --git a/packages/marvel/src/Events/QuestionAnswered.php b/packages/marvel/src/Events/QuestionAnswered.php new file mode 100644 index 0000000..d4a6a6f --- /dev/null +++ b/packages/marvel/src/Events/QuestionAnswered.php @@ -0,0 +1,20 @@ +question = $question; + } +} diff --git a/packages/marvel/src/Events/RefundApproved.php b/packages/marvel/src/Events/RefundApproved.php new file mode 100644 index 0000000..afa04d1 --- /dev/null +++ b/packages/marvel/src/Events/RefundApproved.php @@ -0,0 +1,24 @@ +refund = $refund; + } +} diff --git a/packages/marvel/src/Events/RefundRequested.php b/packages/marvel/src/Events/RefundRequested.php new file mode 100644 index 0000000..f78b2b3 --- /dev/null +++ b/packages/marvel/src/Events/RefundRequested.php @@ -0,0 +1,24 @@ +refund = $refund; + } +} diff --git a/packages/marvel/src/Events/RefundUpdate.php b/packages/marvel/src/Events/RefundUpdate.php new file mode 100644 index 0000000..427eaa0 --- /dev/null +++ b/packages/marvel/src/Events/RefundUpdate.php @@ -0,0 +1,24 @@ +refund = $refund; + } +} diff --git a/packages/marvel/src/Events/ReviewCreated.php b/packages/marvel/src/Events/ReviewCreated.php new file mode 100644 index 0000000..5d74882 --- /dev/null +++ b/packages/marvel/src/Events/ReviewCreated.php @@ -0,0 +1,20 @@ +review = $review; + } +} diff --git a/packages/marvel/src/Events/ShopMaintenance.php b/packages/marvel/src/Events/ShopMaintenance.php new file mode 100644 index 0000000..b3630ee --- /dev/null +++ b/packages/marvel/src/Events/ShopMaintenance.php @@ -0,0 +1,23 @@ +shop = $shop; + $this->action = $action; + } +} diff --git a/packages/marvel/src/Events/StoreNoticeEvent.php b/packages/marvel/src/Events/StoreNoticeEvent.php new file mode 100644 index 0000000..e1aa440 --- /dev/null +++ b/packages/marvel/src/Events/StoreNoticeEvent.php @@ -0,0 +1,123 @@ +storeNotice = $storeNotice; + $this->action = $action; + $this->user = $user; + } + + /** + * Get the channels the event should broadcast on. + * + * @return array + */ + public function broadcastOn(): array + { + $event_channels = []; + if (isset($this->storeNotice->users)) { + foreach ($this->storeNotice->users as $key => $user) { + $channel_name = new PrivateChannel('store_notice.created.' . $user->id); + array_push($event_channels, $channel_name); + } + } + return $event_channels; + } + + + /** + * Get the data to broadcast. + * + * @return array + */ + public function broadcastWith(): array + { + return [ + // 'store_notice' => $this->storeNotice, + 'message' => '1 new store notice.', + ]; + } + + /** + * The event's broadcast name. + */ + public function broadcastAs(): string + { + // event's name will be written here. + return 'store.notice.event'; + } + + /** + * Determine if this event should broadcast. + */ + public function broadcastWhen(): bool + { + try { + $settings = Settings::first(); + $enableBroadCast = false; + + if (config('shop.pusher.enabled') === null) { + return false; + } + + if (isset($settings->options['pushNotification']['all']['storeNotice'])) { + if ($settings->options['pushNotification']['all']['storeNotice'] == true && $this->action = 'create') { + $enableBroadCast = true; + } + } + return $enableBroadCast; + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG, $th->getMessage()); + } + } +} diff --git a/packages/marvel/src/Events/TestPusherEvent.php b/packages/marvel/src/Events/TestPusherEvent.php new file mode 100644 index 0000000..160e835 --- /dev/null +++ b/packages/marvel/src/Events/TestPusherEvent.php @@ -0,0 +1,75 @@ +store_notice = $store_notice; + $this->user = $user; + } + + /** + * Get the channels the event should broadcast on. + * + * @return array + */ + public function broadcastOn(): array + { + $temp_event_channels = []; + if (isset($this->store_notice->users)) { + foreach ($this->store_notice->users as $key => $user) { + $channel_name = new PrivateChannel('store_notice.created.' . $user->id); + array_push($temp_event_channels, $channel_name); + } + } + // return [ + // new Channel('store_notice.created'), + // new PrivateChannel('store_notice.created.' . $this->user->id) + // ]; + + return $temp_event_channels; + } + + + /** + * Get the data to broadcast. + * + * @return array + */ + public function broadcastWith(): array + { + return [ + 'store-notice' => $this->store_notice, + ]; + } + + /** + * The event's broadcast name. + */ + public function broadcastAs(): string + { + // event's name will be written here. + return 'test.pusher.event'; + } +} diff --git a/packages/marvel/src/Exceptions/MarvelBadRequestException.php b/packages/marvel/src/Exceptions/MarvelBadRequestException.php new file mode 100644 index 0000000..06c6597 --- /dev/null +++ b/packages/marvel/src/Exceptions/MarvelBadRequestException.php @@ -0,0 +1,25 @@ +reason = $reason; + } + + /** + * Returns true when exception message is safe to be displayed to a client. + * + * @api + * @return bool + */ + public function isClientSafe(): bool + { + return true; + } + + /** + * Returns string describing a category of the error. + * + * Value "graphql" is reserved for errors produced by query parsing or validation, do not use it. + * + * @api + * @return string + */ + public function getCategory(): string + { + return 'marvel'; + } + + /** + * Return the content that is put in the "extensions" part + * of the returned error. + * + * @return array + */ + public function extensionsContent(): array + { + return [ + 'reason' => $this->reason, + ]; + } +} diff --git a/packages/marvel/src/Exports/OrderExport.php b/packages/marvel/src/Exports/OrderExport.php new file mode 100644 index 0000000..5a96f4a --- /dev/null +++ b/packages/marvel/src/Exports/OrderExport.php @@ -0,0 +1,116 @@ +shop_id = $shop_id; + $this->repository = $repository; + } + + /** + * @return \Illuminate\Support\Collection + */ + public function collection() + { + $results = []; + + if (!empty($this->shop_id)) { + $orders = $this->repository->where('shop_id', $this->shop_id)->get(); + } else { + $orders = $this->repository->where('parent_id', NULL)->get(); + // $orders = $this->repository->where('parent_id', '<>', NULL)->get(); + } + + + if (empty($orders)) { + return collect($results); + } + + $settings = Settings::getData(request()['language'] ?? DEFAULT_LANGUAGE); + $currency = $settings->options['currency'] ?? DEFAULT_CURRENCY; + $currencyOptions = isset($settings['currencyOptions']) ? + $settings['currencyOptions'] : + ['formation' => DEFAULT_CURRENCY_FORMATION, 'fractions' => 2]; + $locale = $currencyOptions['formation'] ?? DEFAULT_CURRENCY_FORMATION; + + foreach ($orders as $order) { + + $results[] = [ + 'id' => '#' . $order->id . ' ' . ($order?->customer?->name ?? $order?->customer_name), + 'customer_email' => $order?->customer?->email ?? "Guest User", + 'created_at' => (new Carbon($order->created_at))->format('Y-m-d'), + 'delivery_time' => $order?->delivery_time, + 'status' => $order?->order_status, + 'tracking_number' => $order?->tracking_number, + 'shop' => $order?->shop?->name, + 'coupon_id' => $order?->coupon_id, + 'amount' => formatCurrency($order?->amount, $currency, $locale), + 'discount' => formatCurrency($order?->discount, $currency, $locale), + 'paid_amount' => formatCurrency($order?->paid_total, $currency, $locale), + 'total' => formatCurrency($order?->total, $currency, $locale), + 'sales_tax' => formatCurrency($order?->sales_tax, $currency, $locale), + 'delivery_fee' => formatCurrency($order?->delivery_fee, $currency, $locale), + 'payment_id' => $order?->payment_id, + 'payment_gateway' => $order?->payment_gateway, + 'billing_address' => $this->formatAddress($order?->billing_address), + 'shipping_address' => $this->formatAddress($order?->shipping_address), + 'customer_contact' => $order?->customer_contact, + 'customer_name' => $order?->customer_name, + 'logistics_provider' => $order?->logistics_provider + ]; + } + + return collect($results); + } + + /** + * File header + * + * @return array + */ + public function headings(): array + { + return [ + 'Order Id', + 'Email', + 'Order Date', + 'Delivery Time', + 'Order Status', + 'Tracking No.', + 'Shop', + 'Coupon ID', + 'Amount', + 'Discount', + 'Paid', + 'Total', + 'Sales Tax', + 'Delivery Fee', + 'Payment Id', + 'Payment Gateway', + 'Billing Address', + 'Shipping Address', + 'Customer Contact', + 'Logistics Provider' + ]; + } +} diff --git a/packages/marvel/src/Facades/Ai.php b/packages/marvel/src/Facades/Ai.php new file mode 100644 index 0000000..55a4293 --- /dev/null +++ b/packages/marvel/src/Facades/Ai.php @@ -0,0 +1,18 @@ +getResolver(); + + // If you have any work to do that does not require the resolver arguments, do it here. + // This code is executed only once per field, whereas the resolver can be called often. + + $fieldValue->setResolver(function ($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) use ($resolver) { + // Do something before the resolver, e.g. validate $args, check authentication + + /* This is checking if the user is logged in and if the user has verified his email. If + not, it throws an exception. */ + $setting = Settings::first(); + $useMustVerifyEmail = isset($setting->options['useMustVerifyEmail']) ? $setting->options['useMustVerifyEmail'] : false; + $useMustVerifyLicense = isset($setting->options['app_settings']['trust']) ? $setting->options['app_settings']['trust'] : false; + $localLicense = getConfig(); + $useLocalLicense = isset($localLicense['trust']) ? $localLicense['trust'] : false; + if($useMustVerifyEmail && $context->user() && $context->user() instanceof MustVerifyEmail && !$context->request()->user()->hasVerifiedEmail()){ + throw new MarvelException(EMAIL_NOT_VERIFIED, EMAIL_NOT_VERIFIED); + } + if (!$useMustVerifyLicense || !$useLocalLicense) { + throw new MarvelException(INVALID_LICENSE_KEY, INVALID_LICENSE_KEY); + } + // Call the actual resolver + $result = $resolver($root, $args, $context, $resolveInfo); + + // Do something with the result, e.g. transform some fields + + return $result; + }); + + // Keep the chain of adding field middleware going by calling the next handler. + // Calling this before or after ->setResolver() allows you to control the + // order in which middleware is wrapped around the field. + return $next($fieldValue); + } +} \ No newline at end of file diff --git a/packages/marvel/src/GraphQL/Mutations/AbusiveReportMutator.php b/packages/marvel/src/GraphQL/Mutations/AbusiveReportMutator.php new file mode 100644 index 0000000..f32dfc8 --- /dev/null +++ b/packages/marvel/src/GraphQL/Mutations/AbusiveReportMutator.php @@ -0,0 +1,26 @@ +slug; + return Shop::call('Marvel\Http\Controllers\ProductController@relatedProducts', $args); + } + public function fetchProducts($rootValue, array $args, GraphQLContext $context) + { + return Shop::call('Marvel\Http\Controllers\ProductController@fetchProducts', $args); + } + public function fetchProductStock($rootValue, array $args, GraphQLContext $context) + { + return Shop::call('Marvel\Http\Controllers\ProductController@fetchProductStock', $args); + } + public function fetchDraftedProducts($rootValue, array $args, GraphQLContext $context) + { + return Shop::call('Marvel\Http\Controllers\ProductController@fetchDraftedProducts', $args); + } + public function fetchDigitalFilesForProduct($rootValue, array $args, GraphQLContext $context) + { + $args['parent_id'] = $rootValue->id; + return Shop::call('Marvel\Http\Controllers\ProductController@fetchDigitalFilesForProduct', $args); + } + public function fetchDigitalFilesForVariation($rootValue, array $args, GraphQLContext $context) + { + $args['parent_id'] = $rootValue->id; + return Shop::call('Marvel\Http\Controllers\ProductController@fetchDigitalFilesForVariation', $args); + } +} diff --git a/packages/marvel/src/GraphQL/Queries/QuestionQuery.php b/packages/marvel/src/GraphQL/Queries/QuestionQuery.php new file mode 100644 index 0000000..00d75c6 --- /dev/null +++ b/packages/marvel/src/GraphQL/Queries/QuestionQuery.php @@ -0,0 +1,16 @@ + $data?->id, + 'name' => $data?->name, + 'slug' => $data?->slug, + 'logo' => $data?->logo + ]; + + if (!empty($extra)) { + foreach ($extra as $key) { + if (isset($key)) { + $item[$key] = $data?->$key; + } + } + } + return $item; +} + +function getResourceCollection($data, array $extra = []) +{ + return collect($data)->map(function ($item) use ($extra) { + $item = [ + 'id' => $item['id'], + 'name' => $item['name'], + 'slug' => $item['slug'], + ]; + + if (!empty($extra)) { + foreach ($extra as $key) { + if (isset($item[$key])) { + $item[$key] = $item[$key]; + } + } + } + return $item; + })->toArray(); +} + +function getVariations($data) +{ + $variations = []; + foreach ($data as $item) { + $variations[] = [ + 'id' => $item['id'], + 'slug' => $item['slug'], + 'attribute_id' => $item['attribute_id'], + 'value' => $item['value'], + 'language' => $item['language'], + 'meta' => $item['meta'], + 'translated_languages' => $item['translated_languages'], + 'attribute' => $item['attribute'], + ]; + } + return $variations; +} diff --git a/packages/marvel/src/Helpers/helpers.php b/packages/marvel/src/Helpers/helpers.php new file mode 100644 index 0000000..35da140 --- /dev/null +++ b/packages/marvel/src/Helpers/helpers.php @@ -0,0 +1,193 @@ +\<\,\[\]\:\;\|\\\]/", "", $slugText); + $cleanString = preg_replace("/[\/_|+ -]+/", '-', $slugText); + $slug = strtolower($cleanString); + if ($key) { + $slugCount = $query->where($key, $slug)->count(); + } else { + $slugCount = $query->where('slug', $slug)->count(); + } + $randomString = Str::random(3); + + if (empty($slugCount)) { + $slug = is_numeric($slug) ? "{$slug}{$divider}{$randomString}" : $slug; + return $slug; + } + return "{$slug}{$divider}{$randomString}"; + } catch (\Throwable $th) { + throw $th; + } + } + } + + if (!function_exists('server_environment_info')) { + function server_environment_info() + { + return [ + "upload_max_filesize" => parseAttachmentUploadSize(ini_get('upload_max_filesize')) / 1024, + "memory_limit" => ini_get('memory_limit'), + "max_execution_time" => ini_get('max_execution_time'), + "max_input_time" => ini_get('max_input_time'), + "post_max_size" => parseAttachmentUploadSize(ini_get('post_max_size')) / 1024, + ]; + } + } + + if (!function_exists('parseAttachmentUploadSize')) { + function parseAttachmentUploadSize($size) + { + $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size. + $size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size. + if ($unit) { + // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by. + return round($size * pow(1024, stripos('bkmgtpezy', $unit[0]))); + } else { + return round($size); + } + } + } + + if (!function_exists('formatAPIResourcePaginate')) { + function formatAPIResourcePaginate($data) + { + return response()->json([ + "data" => $data['data'] ?? [], + "current_page" => $data['meta']['current_page'] ?? 0, + "from" => $data['meta']['from'] ?? 0, + "to" => $data['meta']['to'] ?? 0, + "last_page" => $data['meta']['last_page'] ?? 0, + "path" => $data['meta']['path'] ?? "", + "per_page" => $data['meta']['per_page'] ?? 0, + "total" => $data['meta']['total'] ?? 0, + "next_page_url" => $data['links']['next'] ?? "", + "prev_page_url" => $data['links']['prev'] ?? "", + "last_page_url" => $data['links']['last'] ?? "", + "first_page_url" => $data['links']['first'] ?? "", + ]); + } + } + if (!function_exists('formatLicenseAPIResourcePaginate')) { + function formatLicenseAPIResourcePaginate($data) + { + return [ + "data" => $data['data'] ?? [], + "current_page" => $data['meta']['current_page'] ?? 0, + "from" => $data['meta']['from'] ?? 0, + "to" => $data['meta']['to'] ?? 0, + "last_page" => $data['meta']['last_page'] ?? 0, + "path" => $data['meta']['path'] ?? "", + "per_page" => $data['meta']['per_page'] ?? 0, + "total" => $data['meta']['total'] ?? 0, + "next_page_url" => $data['links']['next'] ?? "", + "prev_page_url" => $data['links']['prev'] ?? "", + "last_page_url" => $data['links']['last'] ?? "", + "first_page_url" => $data['links']['first'] ?? "", + ]; + } + } + if (!function_exists("Role")) { + + function Role(User $user): string + { + if ($user->hasPermissionTo(Permission::SUPER_ADMIN)) { + return Permission::SUPER_ADMIN; + } else if ($user->hasPermissionTo(Permission::STORE_OWNER) && !$user->hasPermissionTo(Permission::SUPER_ADMIN)) { + return Permission::STORE_OWNER; + } else if ($user->hasPermissionTo(Permission::STAFF)) { + return Permission::STAFF; + } else { + return Permission::CUSTOMER; + } + } + } + + + + + if (!function_exists("getConfig")) { + function getConfig(): array | bool + { + try { + $folderPath = storage_path('app/shop/'); + if (!File::exists($folderPath)) { + File::makeDirectory($folderPath, 0777, true, true); + } + $fileName = $folderPath . "shop.config.json"; + if (file_exists($fileName)) { + $json_data = file_get_contents($fileName); + $data = Crypt::decrypt($json_data); + $json_data_to_array = json_decode($data, true); + return $json_data_to_array; + } + return false; + } catch (Exception $e) { + return false; + } + } + } + + if (!function_exists("formatCurrency")) { + function formatCurrency(float $amount, string $currency = "USD", string $locale = "en_US") + { + $formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY); + return $formatter->formatCurrency($amount, $currency); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/AbusiveReportController.php b/packages/marvel/src/Http/Controllers/AbusiveReportController.php new file mode 100644 index 0000000..5052061 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/AbusiveReportController.php @@ -0,0 +1,123 @@ +repository = $repository; + } + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|AbusiveReport[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + return $this->repository->paginate($limit); + } + + /** + * Store a newly created resource in storage. + * + * @param AbusiveReportCreateRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(AbusiveReportCreateRequest $request) + { + + try { + $model_id = $request['model_id']; + $model_type = $request['model_type']; + $model_name = "Marvel\\Database\\Models\\{$model_type}"; + $model = $model_name::findOrFail($model_id); + $request['user_id'] = $request->user()->id; + return $this->repository->storeAbusiveReport($request, $model); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + public function show($id) + { + try { + return $this->repository->findOrFail($id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + public function accept(AbusiveReportAcceptOrRejectRequest $request) + { + try { + $model_id = $request['model_id']; + $model_type = $request['model_type']; + $model = $model_type::findOrFail($model_id); + return $model->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + public function reject(AbusiveReportAcceptOrRejectRequest $request) + { + $model_id = $request['model_id']; + $model_type = str_replace("\\", "\\", $request['model_type']); + try { + $this->repository->deleteWhere([ + 'model_id' => $model_id, + 'model_type' => $model_type + ]); + return $model_type::findOrFail($model_id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Display a listing of the resource for authenticated user. + * + * @param Request $request + * @return JsonResponse + */ + public function myReports(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + + return $this->repository->where('user_id', auth()->user()->id)->paginate($limit); + } +} diff --git a/packages/marvel/src/Http/Controllers/AddressController.php b/packages/marvel/src/Http/Controllers/AddressController.php new file mode 100644 index 0000000..4b0e6bd --- /dev/null +++ b/packages/marvel/src/Http/Controllers/AddressController.php @@ -0,0 +1,107 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Address[] + */ + public function index(Request $request) + { + return $this->repository->with('customer')->all(); + } + + /** + * Store a newly created resource in storage. + * + * @param AddressRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(AddressRequest $request) + { + try { + $validatedData = $request->all(); + return $this->repository->create($validatedData); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Display the specified resource. + * + * @param $id + * @return JsonResponse + */ + public function show($id) + { + try { + return $this->repository->with('customer')->findOrFail($id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param AddressRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(AddressRequest $request, $id) + { + try { + $validatedData = $request->all(); + return $this->repository->findOrFail($id)->update($validatedData); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id, Request $request) + { + try { + $user = $request->user(); + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + return $this->repository->findOrFail($id)->delete(); + } else { + $address = $this->repository->findOrFail($id); + if ($address->customer_id == $user->id) { + return $address->delete(); + } + } + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/AiController.php b/packages/marvel/src/Http/Controllers/AiController.php new file mode 100644 index 0000000..6207347 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/AiController.php @@ -0,0 +1,20 @@ +getMessage()); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/AnalyticsController.php b/packages/marvel/src/Http/Controllers/AnalyticsController.php new file mode 100644 index 0000000..3646ce7 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/AnalyticsController.php @@ -0,0 +1,666 @@ +addressRepository = $addressRepository; + } + + + public function analytics(Request $request) + { + try { + $user = $request->user(); + // if (!$user || !$user->hasPermissionTo(Permission::STORE_OWNER)) { + // throw new AuthenticationException(); + // } + $shops = $user?->shops->pluck('id') ?? []; + + // Total revenue + $totalRevenueQuery = DB::table('orders as childOrder') + ->whereDate('childOrder.created_at', '<=', Carbon::now()) + ->where('childOrder.order_status', OrderStatus::COMPLETED) + ->whereNotNull('childOrder.parent_id') + ->join('orders as parentOrder', 'childOrder.parent_id', '=', 'parentOrder.id') + ->whereDate('parentOrder.created_at', '<=', Carbon::now()) + ->where('parentOrder.order_status', OrderStatus::COMPLETED) + ->select( + 'childOrder.id', + 'childOrder.parent_id', + 'childOrder.paid_total', + 'childOrder.created_at', + 'childOrder.shop_id', + 'parentOrder.delivery_fee', + 'parentOrder.sales_tax', + ); + + // Revenue section : Total + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + $totalRevenueQuery = $totalRevenueQuery->get(); + $totalRevenue = $totalRevenueQuery->sum('paid_total') + + $totalRevenueQuery->unique('parent_id')->sum('delivery_fee') + + $totalRevenueQuery->unique('parent_id')->sum('sales_tax'); + } else { + $totalRevenue = $totalRevenueQuery + ->whereIn('childOrder.shop_id', $shops) + ->get() + ->sum('paid_total'); + } + + // Today's revenue + $todaysRevenueQuery = DB::table('orders as A') + ->whereDate('A.created_at', '>', Carbon::now()->subDays(1)) + ->where('A.order_status', OrderStatus::COMPLETED) + ->where('A.parent_id', '!=', null) + ->join('orders as B', 'A.parent_id', '=', 'B.id') + ->where('B.order_status', OrderStatus::COMPLETED) + ->select( + 'A.id', + 'A.parent_id', + 'A.paid_total', + 'B.delivery_fee', + 'B.sales_tax', + 'A.created_at', + 'A.shop_id' + ); + + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + $todaysRevenueQuery = $todaysRevenueQuery->get(); + $todaysRevenue = $todaysRevenueQuery->sum('paid_total') + + $todaysRevenueQuery->unique('parent_id')->sum('delivery_fee') + + $todaysRevenueQuery->unique('parent_id')->sum('sales_tax'); + } else { + $todaysRevenue = $todaysRevenueQuery->whereIn('A.shop_id', $shops)->get()->sum('paid_total'); + } + + // total refunds + $totalRefundQuery = DB::table('refunds')->whereDate('created_at', '<', Carbon::now()); + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + $totalRefunds = $totalRefundQuery->where('shop_id', null)->sum('amount'); + } else { + $totalRefunds = $totalRefundQuery->whereIn('shop_id', $shops)->sum('amount'); + } + + // total orders + $totalOrdersQuery = DB::table('orders')->whereDate('created_at', '<=', Carbon::now()); + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + $totalOrders = $totalOrdersQuery->where('parent_id', null)->count(); + } else { + $totalOrders = $totalOrdersQuery->whereIn('shop_id', $shops)->count(); + } + + // total shops + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + $totalVendors = User::whereHas('permissions', function ($query) { + $query->where('name', Permission::STORE_OWNER); + })->count(); + $totalShops = Shop::count(); + } else { + $totalShops = Shop::where('owner_id', '=', $user->id)->count(); + } + + $newCustomers = User::permission(Permission::CUSTOMER)->whereDate('created_at', '>', Carbon::now()->subDays(30))->count(); + + $totalYearSaleByMonth = $this->getTotalYearSaleByMonth($user); + $todayTotalOrderByStatus = $this->orderCountingByStatus($request, 1); + $weeklyDaysTotalOrderByStatus = $this->orderCountingByStatus($request, 7); + $monthlyTotalOrderByStatus = $this->orderCountingByStatus($request, 30); + $yearlyTotalOrderByStatus = $this->orderCountingByStatus($request, 365); + + + return [ + 'totalRevenue' => $totalRevenue ?? 0, + 'totalRefunds' => $totalRefunds ?? 0, + 'totalShops' => $totalShops, + 'totalVendors' => $totalVendors ?? 0, + 'todaysRevenue' => $todaysRevenue, + 'totalOrders' => $totalOrders, + 'newCustomers' => $newCustomers, + 'totalYearSaleByMonth' => $totalYearSaleByMonth, + 'todayTotalOrderByStatus' => $todayTotalOrderByStatus, + 'weeklyTotalOrderByStatus' => $weeklyDaysTotalOrderByStatus, + 'monthlyTotalOrderByStatus' => $monthlyTotalOrderByStatus, + 'yearlyTotalOrderByStatus' => $yearlyTotalOrderByStatus, + ]; + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + public function getTotalYearSaleByMonth(User $user) + { + $months = [ + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December" + ]; + + $query = DB::table('orders as A') + ->where('A.order_status', OrderStatus::COMPLETED) + ->whereYear('A.created_at', Carbon::now()->year); + + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + $query->whereNull('A.parent_id') + ->join('orders as B', 'A.id', '=', 'B.parent_id') + ->where('B.order_status', OrderStatus::COMPLETED) + ->select( + DB::raw("SUM(A.paid_total) as total"), + DB::raw("DATE_FORMAT(A.created_at, '%M') as month") + ); + } else { + $shops = $user ? $user->shops->pluck('id') : []; + $query->whereNotNull('A.parent_id') + ->join('orders as B', 'A.parent_id', '=', 'B.id') + ->whereIn('A.shop_id', $shops) + ->select( + DB::raw("SUM(B.amount) as total"), + DB::raw("DATE_FORMAT(A.created_at, '%M') as month") + ); + } + + $totalYearSaleByMonth = $query->groupBy('month')->pluck('total', 'month')->toArray(); + + return array_map( + fn ($month) => + [ + 'month' => $month, + 'total' => $totalYearSaleByMonth[$month] ?? 0 + ], + $months + ); + } + + public function orderCountingByStatus($request, int $days = 1) + { + $user = $request->user(); + + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + $query = DB::table('orders as A') + ->where('A.parent_id', '=', null) + ->whereDate('A.created_at', '>', Carbon::now()->subDays($days)) + ->select( + 'A.order_status', + DB::raw('count(*) as order_count') + ) + ->groupBy('A.order_status') + ->pluck('order_count', 'order_status'); + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + $shops = $user?->shops->pluck('id') ?? []; + $query = DB::table('orders as A') + ->where('A.parent_id', '!=', null) + ->whereDate('A.created_at', '>', Carbon::now()->subDays($days)) + ->whereIn('A.shop_id', $shops) + ->select( + 'A.order_status', + DB::raw('count(*) as order_count') + ) + ->groupBy('A.order_status') + ->pluck('order_count', 'order_status'); + break; + + case $user->hasPermissionTo(Permission::STAFF): + $shop = $user?->shop_id ?? []; + $query = DB::table('orders as A') + ->where('A.parent_id', '!=', null) + ->whereDate('A.created_at', '>', Carbon::now()->subDays($days)) + ->where('A.shop_id', '=', $shop) + ->select( + 'A.order_status', + DB::raw('count(*) as order_count') + ) + ->groupBy('A.order_status') + ->pluck('order_count', 'order_status'); + break; + } + + // if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + // // for super-admin + // $query = DB::table('orders as A') + // ->where('A.parent_id', '=', null) + // ->whereDate('A.created_at', '>', Carbon::now()->subDays($days)) + // ->select( + // 'A.order_status', + // DB::raw('count(*) as order_count') + // ) + // ->groupBy('A.order_status') + // ->pluck('order_count', 'order_status'); + // } else { + // // for vendor + // $shops = $user?->shops->pluck('id') ?? []; + // $query = DB::table('orders as A') + // ->where('A.parent_id', '!=', null) + // ->whereDate('A.created_at', '>', Carbon::now()->subDays($days)) + // ->whereIn('A.shop_id', $shops) + // ->select( + // 'A.order_status', + // DB::raw('count(*) as order_count') + // ) + // ->groupBy('A.order_status') + // ->pluck('order_count', 'order_status'); + // } + + + return [ + 'pending' => $query[OrderStatus::PENDING] ?? 0, + 'processing' => $query[OrderStatus::PROCESSING] ?? 0, + 'complete' => $query[OrderStatus::COMPLETED] ?? 0, + 'cancelled' => $query[OrderStatus::CANCELLED] ?? 0, + 'refunded' => $query[OrderStatus::REFUNDED] ?? 0, + 'failed' => $query[OrderStatus::FAILED] ?? 0, + 'localFacility' => $query[OrderStatus::AT_LOCAL_FACILITY] ?? 0, + 'outForDelivery' => $query[OrderStatus::OUT_FOR_DELIVERY] ?? 0, + ]; + } + + /** + * lowStockProducts + * + * @param Request $request + * @return object + */ + public function lowStockProducts(Request $request) + { + $limit = $request->limit ? $request->limit : 10; + return $this->lowStockProductsWithPagination($request)->take($limit)->get(); + } + + /** + * lowStockProducts + * + * @param Request $request + * @return object + */ + public function lowStockProductsWithPagination(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + + // product group type + $type_id = $request->type_id ? $request->type_id : ''; + if (isset($request->type_slug) && empty($type_id)) { + try { + $type = Type::where('slug', $request->type_slug)->where('language', $language)->firstOrFail(); + $type_id = $type->id; + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + $products_query = Product::with(['type', 'shop'])->where('language', $language)->where('quantity', '<', 10); + + // fetched by shop_id + if (isset($request->shop_id)) { + $products_query = $products_query->where('shop_id', "=", $request->shop_id); + } + + // fetched type + if ($type_id) { + $products_query = $products_query->where('type_id', '=', $type_id); + } + return $products_query; + } + + /** + * categoryWiseProduct + * + * @param Request $request + * @return void + */ + public function categoryWiseProduct(Request $request) + { + $user = $request->user(); + $limit = $request->limit ? $request->limit : 15; + $language = $request->language ? $request->language : DEFAULT_LANGUAGE; + $mostProductCategory = []; + + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + + $mostProductCategory = DB::table('category_product') + ->select( + 'categories.id as category_id', + 'categories.name as category_name', + 'shops.name as shop_name', + DB::raw('COUNT(category_product.product_id) as product_count') + ) + ->where('categories.language', '=', $language) + ->join('products', 'category_product.product_id', '=', 'products.id') + ->join('categories', 'category_product.category_id', '=', 'categories.id') + ->join('shops', 'products.shop_id', '=', 'shops.id') + ->groupBy('categories.id', 'categories.name', 'shops.name') + ->orderBy('product_count', 'DESC') + ->limit($limit) + ->get(); + + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + + $shops = $user->shops()->pluck('id') ?? []; + $mostProductCategory = DB::table('category_product') + ->select( + 'categories.id as category_id', + 'categories.name as category_name', + 'shops.name as shop_name', + DB::raw('COUNT(category_product.product_id) as product_count') + ) + ->where('categories.language', '=', $language) + ->whereIn('shops.id', $shops) + ->join('products', 'category_product.product_id', '=', 'products.id') + ->join('categories', 'category_product.category_id', '=', 'categories.id') + ->join('shops', 'products.shop_id', '=', 'shops.id') + ->groupBy('categories.id', 'categories.name', 'shops.name') + ->orderBy('product_count', 'DESC') + ->limit($limit) + ->get(); + + break; + + case $user->hasPermissionTo(Permission::STAFF): + + $shop = $user->shop_id ?? null; + if (isset($shop)) { + $mostProductCategory = DB::table('category_product') + ->select( + 'categories.id as category_id', + 'categories.name as category_name', + 'shops.name as shop_name', + DB::raw('COUNT(category_product.product_id) as product_count') + ) + ->where('categories.language', '=', $language) + ->where('shops.id', '=', $shop) + ->join('products', 'category_product.product_id', '=', 'products.id') + ->join('categories', 'category_product.category_id', '=', 'categories.id') + ->join('shops', 'products.shop_id', '=', 'shops.id') + ->groupBy('categories.id', 'categories.name', 'shops.name') + ->orderBy('product_count', 'DESC') + ->limit($limit) + ->get(); + } else { + $mostProductCategory = []; + } + + break; + } + + return $mostProductCategory; + } + /** + * categoryWiseProductSale + * + * @param Request $request + * @return void + */ + public function categoryWiseProductSale(Request $request) + { + $user = $request->user(); + $limit = $request->limit ? $request->limit : 15; + $language = $request->language ? $request->language : DEFAULT_LANGUAGE; + $mostSoldProductCategory = []; + + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + + $mostSoldProductCategory = DB::table('categories') + ->select( + 'categories.id as category_id', + 'categories.name as category_name', + 'shops.name as shop_name', + DB::raw('sum(order_product.order_quantity) as total_sales') + ) + ->leftJoin('category_product', 'category_product.category_id', '=', 'categories.id') + ->leftJoin('products', 'category_product.product_id', '=', 'products.id') + ->leftJoin('shops', 'products.shop_id', '=', 'shops.id') + ->leftJoin('order_product', 'order_product.product_id', '=', 'products.id') + ->leftJoin('orders', 'order_product.order_id', '=', 'orders.id') + ->where('orders.parent_id', null) + ->where('orders.order_status', 'order-completed') + ->where('categories.language', '=', $language) + ->groupBy('categories.id', 'categories.name', 'shops.name') + ->orderBy('total_sales', 'desc') + ->limit($limit) + ->get(); + + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + + $shops = $user->shops()->pluck('id') ?? []; + $mostSoldProductCategory = DB::table('categories') + ->select( + 'categories.id as category_id', + 'categories.name as category_name', + 'shops.name as shop_name', + DB::raw('sum(order_product.order_quantity) as total_sales') + ) + ->leftJoin('category_product', 'category_product.category_id', '=', 'categories.id') + ->leftJoin('products', 'category_product.product_id', '=', 'products.id') + ->leftJoin('shops', 'products.shop_id', '=', 'shops.id') + ->leftJoin('order_product', 'order_product.product_id', '=', 'products.id') + ->leftJoin('orders', 'order_product.order_id', '=', 'orders.id') + ->whereIn('shops.id', $shops) + ->where('orders.parent_id', null) + ->where('orders.order_status', 'order-completed') + ->where('categories.language', '=', $language) + ->groupBy('categories.id', 'categories.name', 'shops.name') + ->orderBy('total_sales', 'desc') + ->limit($limit) + ->get(); + + break; + + case $user->hasPermissionTo(Permission::STAFF): + + $shop = $user->shop_id ?? null; + if (isset($shop)) { + $mostSoldProductCategory = DB::table('categories') + ->select( + 'categories.id as category_id', + 'categories.name as category_name', + 'shops.name as shop_name', + DB::raw('sum(order_product.order_quantity) as total_sales') + ) + ->leftJoin('category_product', 'category_product.category_id', '=', 'categories.id') + ->leftJoin('products', 'category_product.product_id', '=', 'products.id') + ->leftJoin('shops', 'products.shop_id', '=', 'shops.id') + ->leftJoin('order_product', 'order_product.product_id', '=', 'products.id') + ->leftJoin('orders', 'order_product.order_id', '=', 'orders.id') + ->where('shops.id', '=', $shop) + ->where('orders.parent_id', null) + ->where('orders.order_status', 'order-completed') + ->where('categories.language', '=', $language) + ->groupBy('categories.id', 'categories.name', 'shops.name') + ->orderBy('total_sales', 'desc') + ->limit($limit) + ->get(); + } else { + $mostSoldProductCategory = []; + } + + break; + } + + return $mostSoldProductCategory; + } + + + /** + * topRatedProducts + * + * @param Request $request + * @return void + */ + public function topRatedProducts(Request $request) + { + $user = $request->user(); + $limit = $request->limit ? $request->limit : 10; + $language = $request->language ? $request->language : DEFAULT_LANGUAGE; + $topRatedProducts = []; + + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + $topRatedProducts = DB::table('reviews') + ->join('products', 'products.id', '=', 'reviews.product_id') + ->join('types', 'types.id', '=', 'products.type_id') + ->select( + 'products.id as id', + 'products.name as name', + 'products.slug as slug', + 'products.price as regular_price', + 'products.sale_price as sale_price', + 'products.min_price as min_price', + 'products.max_price as max_price', + 'products.product_type as product_type', + 'products.description as description', + 'types.id as type_id', + 'types.slug as type_slug', + DB::raw('JSON_UNQUOTE(products.image) AS image_json'), + DB::raw('SUM(reviews.rating) as total_rating'), + DB::raw('COUNT(reviews.id) as rating_count'), + DB::raw('SUM(reviews.rating) / COUNT(reviews.id) as actual_rating'), + ) + ->where('products.language', '=', $language) + ->groupBy( + 'products.id', + 'products.name', + 'products.slug', + 'products.price', + 'products.sale_price', + 'products.min_price', + 'products.max_price', + 'products.product_type', + 'products.description', + 'products.image', + 'types.id', + 'types.slug' + ) + ->orderBy('actual_rating', 'desc') + ->limit($limit) + ->get(); + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + + $shops = $user->shops()->pluck('id') ?? []; + $topRatedProducts = DB::table('reviews') + ->join('products', 'products.id', '=', 'reviews.product_id') + ->join('types', 'types.id', '=', 'products.type_id') + ->select( + 'products.id as id', + 'products.name as name', + 'products.slug as slug', + 'products.price as regular_price', + 'products.sale_price as sale_price', + 'products.min_price as min_price', + 'products.max_price as max_price', + 'products.product_type as product_type', + 'products.description as description', + 'types.id as type_id', + 'types.slug as type_slug', + DB::raw('JSON_UNQUOTE(products.image) AS image_json'), + DB::raw('SUM(reviews.rating) as total_rating'), + DB::raw('COUNT(reviews.id) as rating_count'), + DB::raw('SUM(reviews.rating) / COUNT(reviews.id) as actual_rating'), + ) + ->where('products.language', '=', $language) + ->whereIn('products.shop_id', $shops) + ->groupBy( + 'products.id', + 'products.name', + 'products.slug', + 'products.price', + 'products.sale_price', + 'products.min_price', + 'products.max_price', + 'products.product_type', + 'products.description', + 'products.image', + 'types.id', + 'types.slug' + ) + ->orderBy('actual_rating', 'desc') + ->limit($limit) + ->get(); + + break; + + case $user->hasPermissionTo(Permission::STAFF): + + $shop = $user->shop_id ?? []; + if (isset($shop)) { + $topRatedProducts = DB::table('reviews') + ->join('products', 'products.id', '=', 'reviews.product_id') + ->join('types', 'types.id', '=', 'products.type_id') + ->select( + 'products.id as id', + 'products.name as name', + 'products.slug as slug', + 'products.price as regular_price', + 'products.sale_price as sale_price', + 'products.min_price as min_price', + 'products.max_price as max_price', + 'products.product_type as product_type', + 'products.description as description', + 'types.id as type_id', + 'types.slug as type_slug', + DB::raw('JSON_UNQUOTE(products.image) AS image_json'), + DB::raw('SUM(reviews.rating) as total_rating'), + DB::raw('COUNT(reviews.id) as rating_count'), + DB::raw('SUM(reviews.rating) / COUNT(reviews.id) as actual_rating'), + ) + ->where('products.language', '=', $language) + ->where('products.shop_id', '=', $shop) + ->groupBy( + 'products.id', + 'products.name', + 'products.slug', + 'products.price', + 'products.sale_price', + 'products.min_price', + 'products.max_price', + 'products.product_type', + 'products.description', + 'products.image', + 'types.id', + 'types.slug' + ) + ->orderBy('actual_rating', 'desc') + ->limit($limit) + ->get(); + } else { + $topRatedProducts = []; + } + + + break; + } + + foreach ($topRatedProducts as $row) { + $row->image = json_decode($row->image_json, true); + unset($row->image_json); + } + + return $topRatedProducts; + } +} diff --git a/packages/marvel/src/Http/Controllers/AttachmentController.php b/packages/marvel/src/Http/Controllers/AttachmentController.php new file mode 100644 index 0000000..50e3591 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/AttachmentController.php @@ -0,0 +1,111 @@ +repository = $repository; + } + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Attachment[] + */ + public function index(Request $request) + { + return $this->repository->paginate(); + } + + /** + * Store a newly created resource in storage. + * + * @param AttachmentRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(AttachmentRequest $request) + { + $urls = []; + foreach ($request->attachment as $media) { + $attachment = new Attachment; + $attachment->save(); + $attachment->addMedia($media)->toMediaCollection(); + foreach ($attachment->getMedia() as $media) { + if (strpos($media->mime_type, 'image/') !== false) { + $converted_url = [ + 'thumbnail' => $media->getUrl('thumbnail'), + 'original' => $media->getUrl(), + 'id' => $attachment->id + ]; + } else { + $converted_url = [ + 'thumbnail' => '', + 'original' => $media->getUrl(), + 'id' => $attachment->id + ]; + } + } + $urls[] = $converted_url; + } + return $urls; + } + + /** + * Display the specified resource. + * + * @param int $id + * @return JsonResponse + */ + public function show($id) + { + try { + return $this->repository->findOrFail($id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param AttachmentRequest $request + * @param int $id + * @return bool + */ + public function update(AttachmentRequest $request, $id) + { + return false; + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/AttributeController.php b/packages/marvel/src/Http/Controllers/AttributeController.php new file mode 100644 index 0000000..9493330 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/AttributeController.php @@ -0,0 +1,230 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Type[] + */ + public function index(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + $attributes = $this->repository->where('language', $language)->with(['values', 'shop'])->get(); + return AttributeResource::collection($attributes); + } + + /** + * Store a newly created resource in storage. + * + * @param AttributeRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(AttributeRequest $request) + { + try { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + return $this->repository->storeAttribute($request); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Display the specified resource. + * + * @param $id + * @return JsonResponse + */ + public function show(Request $request, $params) + { + + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + if (is_numeric($params)) { + $params = (int) $params; + $attribute = $this->repository->with('values')->where('id', $params)->firstOrFail(); + return new AttributeResource($attribute); + } + $attribute = $this->repository->with('values')->where('slug', $params)->where('language', $language)->firstOrFail(); + return new AttributeResource($attribute); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param AttributeRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(AttributeRequest $request, $id) + { + try { + $request->id = $id; + return $this->updateAttribute($request); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + public function updateAttribute(AttributeRequest $request) + { + + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + try { + $attribute = $this->repository->with('values')->findOrFail($request->id); + } catch (\Exception $e) { + throw new HttpException(404, NOT_FOUND); + } + return $this->repository->updateAttribute($request, $attribute); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy(Request $request, $id) + { + try { + $request->id = $id; + return $this->deleteAttribute($request); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + public function deleteAttribute(Request $request) + { + try { + $attribute = $this->repository->findOrFail($request->id); + } catch (\Exception $e) { + throw new HttpException(404, NOT_FOUND); + } + if ($this->repository->hasPermission($request->user(), $attribute->shop->id)) { + $attribute->delete(); + return $attribute; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } + + public function exportAttributes(Request $request, $shop_id) + { + $filename = 'attributes-for-shop-id-' . $shop_id . '.csv'; + $headers = [ + 'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0', + 'Content-type' => 'text/csv', + 'Content-Disposition' => 'attachment; filename=' . $filename, + 'Expires' => '0', + 'Pragma' => 'public' + ]; + + $list = $this->repository->where('shop_id', $shop_id)->with(['values'])->get()->toArray(); + + if (!count($list)) { + return response()->stream(function () { + }, 200, $headers); + } + # add headers for each column in the CSV download + array_unshift($list, array_keys($list[0])); + + $callback = function () use ($list) { + $FH = fopen('php://output', 'w'); + foreach ($list as $key => $row) { + if ($key === 0) { + $exclude = ['id', 'created_at', 'updated_at', 'slug', 'translated_languages']; + $row = array_diff($row, $exclude); + } + unset($row['id']); + unset($row['updated_at']); + unset($row['slug']); + unset($row['created_at']); + unset($row['translated_languages']); + if (isset($row['values'])) { + $row['values'] = implode(',', Arr::pluck($row['values'], 'value')); + } + + fputcsv($FH, $row); + } + fclose($FH); + }; + + return response()->stream($callback, 200, $headers); + } + + public function importAttributes(Request $request) + { + $requestFile = $request->file(); + $user = $request->user(); + $shop_id = $request->shop_id; + + if (count($requestFile)) { + if (isset($requestFile['csv'])) { + $uploadedCsv = $requestFile['csv']; + } else { + $uploadedCsv = current($requestFile); + } + } + + if (!$this->repository->hasPermission($user, $shop_id)) { + throw new MarvelException(NOT_AUTHORIZED); + } + if (isset($shop_id)) { + $file = $uploadedCsv->storePubliclyAs('csv-files', 'attributes-' . $shop_id . '.' . $uploadedCsv->getClientOriginalExtension(), 'public'); + + $attributes = $this->repository->csvToArray(storage_path() . '/app/public/' . $file); + + foreach ($attributes as $key => $attribute) { + if (!isset($attribute['name'])) { + throw new MarvelException("MARVEL_ERROR.WRONG_CSV"); + } + unset($attribute['id']); + $attribute['shop_id'] = $shop_id; + $values = []; + if (isset($attribute['values'])) { + $values = explode(',', $attribute['values']); + } + unset($attribute['values']); + $newAttribute = $this->repository->firstOrCreate($attribute); + foreach ($values as $key => $value) { + $newAttribute->values()->create(['value' => $value]); + } + } + return true; + } + } +} diff --git a/packages/marvel/src/Http/Controllers/AttributeValueController.php b/packages/marvel/src/Http/Controllers/AttributeValueController.php new file mode 100644 index 0000000..fa728a4 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/AttributeValueController.php @@ -0,0 +1,133 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + */ + public function index(Request $request) + { + $attributesValue = $this->repository->with('attribute')->all(); + return AttributeValueResource::collection($attributesValue); + } + + /** + * Store a newly created resource in storage. + * + * @param AttributeValueRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(AttributeValueRequest $request) + { + try { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + $validatedData = $request->validated(); + return $this->repository->create($validatedData); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * Display the specified resource. + * + * @param $id + * @return JsonResponse + */ + public function show($id) + { + try { + return $this->repository->with('attribute')->findOrFail($id); + } catch (MarvelException $th) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param AttributeValueRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(AttributeValueRequest $request, $id) + { + try { + $request->id = $id; + return $this->updateAttributeValues($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + public function updateAttributeValues(AttributeValueRequest $request) + { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + try { + $validatedData = $request->except('id'); + return $this->repository->findOrFail($request->id)->update($validatedData); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + } + throw new AuthorizationException(NOT_AUTHORIZED); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id, Request $request) + { + try { + $request->id = $id; + return $this->destroyAttributeValues($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + /** + * It deletes an attribute from the database + * + * @param Request request The request object. + * @return JsonResponse + */ + public function destroyAttributeValues(Request $request) + { + $shop_id = $this->repository->findOrFail($request->id)->attribute->shop_id; + if ($this->repository->hasPermission($request->user(), $shop_id)) { + $attributesValue = $this->repository->findOrFail($request->id); + $attributesValue->delete(); + return $attributesValue; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } +} diff --git a/packages/marvel/src/Http/Controllers/AuthorController.php b/packages/marvel/src/Http/Controllers/AuthorController.php new file mode 100644 index 0000000..2e3de44 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/AuthorController.php @@ -0,0 +1,163 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + $authors = $this->fetchAuthors($request)->paginate($limit); + $data = AuthorResource::collection($authors)->response()->getData(true); + return formatAPIResourcePaginate($data); + } + + public function fetchAuthors(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + return $this->repository->where('language', $language); + } + + /** + * Store a newly created resource in storage. + * + * @param AuthorRequest $request + * @return mixed + */ + public function store(AuthorRequest $request) + { + try { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + return $this->repository->storeAuthor($request); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function show(Request $request, $slug) + { + try { + $request->slug = $slug; + $author = $this->fetchAuthor($request); + return new AuthorResource($author); + } catch (MarvelException $th) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function fetchAuthor(Request $request) + { + $slug = $request->slug; + $language = $request->language ?? DEFAULT_LANGUAGE; + try { + $author = $this->repository->where('slug', $slug)->where('language', $language)->firstOrFail(); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + return $author; + } + + /** + * Update the specified resource in storage. + * + * @param AuthorRequest $request + * @param int $id + * @return array + */ + public function update(AuthorRequest $request, $id) + { + try { + $request->id = $id; + return $this->updateAuthor($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + public function updateAuthor(Request $request) + { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + try { + $author = $this->repository->findOrFail($request->id); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + return $this->repository->updateAuthor($request, $author); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } + + /** + * Remove the specified resource from storage. + * + * @param $id + * @return JsonResponse + */ + public function destroy($id, Request $request) + { + try { + $request['id'] = $id; + return $this->deleteAuthor($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + public function deleteAuthor(Request $request) + { + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $author = $this->repository->findOrFail($request->id); + $author->delete(); + return $author; + } + throw new MarvelException(NOT_AUTHORIZED); + } + + public function topAuthor(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + $limit = $request->limit ? $request->limit : 10; + return $this->repository->where('language', $language)->withCount('products')->orderBy('products_count', 'desc')->take($limit)->get(); + } +} diff --git a/packages/marvel/src/Http/Controllers/BecameSellerController.php b/packages/marvel/src/Http/Controllers/BecameSellerController.php new file mode 100644 index 0000000..5ad03ef --- /dev/null +++ b/packages/marvel/src/Http/Controllers/BecameSellerController.php @@ -0,0 +1,127 @@ +repository = $repository; + $this->commission = $commission; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Address[] + */ + public function index(Request $request) + { + $language = $request->language ? $request->language : DEFAULT_LANGUAGE; + return Cache::rememberForever( + 'cached_became_seller_' . $language, + function () use ($request) { + return [ + 'page_options' => $this->repository->getData($request->language), + 'commissions' => $this->commission->get() + ]; + } + ); + } + + /** + * Store a newly created resource in storage. + * + * @param BecameSellersRequest $request + * @return mixed + * @throws ValidatorException + */ + + public function store(BecameSellersRequest $request) + { + $language = $request->language ? $request->language : DEFAULT_LANGUAGE; + if (Cache::has('cached_became_seller_' . $language)) { + Cache::forget('cached_became_seller_' . $language); + } + + $request->merge([ + 'page_options' => [ + ...$request->page_options, + ] + ]); + + $this->commission->storeCommission($request['commissions'], $language); + + $data = $this->repository->where('language', $request->language)->first(); + if ($data) { + + $becomeSeller = tap($data)->update($request->only(['page_options'])); + } else { + $becomeSeller = $this->repository->create(['page_options' => $request['page_options'], 'language' => $language]); + } + return $becomeSeller; + } + + /** + * Display the specified resource. + * + * @param $id + * @return JsonResponse + */ + public function show($id) + { + try { + return $this->repository->first(); + } catch (\Exception $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param BecameSellersRequest $request + * @param int $id + * @return JsonResponse + * @throws ValidatorException + */ + public function update(BecameSellersRequest $request, $id) + { + $settings = $this->repository->first(); + if (isset($settings->id)) { + return $this->repository->update($request->only(['page_options']), $settings->id); + } else { + return $this->repository->create(['page_options' => $request['page_options']]); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return array + */ + public function destroy($id) + { + throw new MarvelException(ACTION_NOT_VALID); + } +} diff --git a/packages/marvel/src/Http/Controllers/CategoryController.php b/packages/marvel/src/Http/Controllers/CategoryController.php new file mode 100644 index 0000000..805b3ac --- /dev/null +++ b/packages/marvel/src/Http/Controllers/CategoryController.php @@ -0,0 +1,180 @@ +repository = $repository; + } + + // /** + // * Display a listing of the resource. + // * + // * @param Request $request + // * @return Collection|Category[] + // */ + // public function fetchOnlyParent(Request $request) + // { + // $limit = $request->limit ? $request->limit : 15; + // return $this->repository->withCount(['products'])->with(['type', 'parent', 'children'])->where('parent', null)->paginate($limit); + // // $limit = $request->limit ? $request->limit : 15; + // // return $this->repository->withCount(['children', 'products'])->with(['type', 'parent', 'children.type', 'children.children.type', 'children.children' => function ($query) { + // // $query->withCount('products'); + // // }, 'children' => function ($query) { + // // $query->withCount('products'); + // // }])->where('parent', null)->paginate($limit); + // } + + // /** + // * Display a listing of the resource. + // * + // * @param Request $request + // * @return Collection|Category[] + // */ + // public function fetchCategoryRecursively(Request $request) + // { + // $limit = $request->limit ? $request->limit : 15; + // return $this->repository->withCount(['products'])->with(['parent', 'subCategories'])->where('parent', null)->paginate($limit); + // } + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Category[] + */ + public function index(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + $parent = $request->parent; + $selfId = $request->self ?? null; + $limit = $request->limit ?? 15; + + $categoriesQuery = $this->repository->with(['type', 'parent', 'children']) + ->where('language', $language)->withCount(['products']); + + if ($parent === 'null') { + $categoriesQuery->whereNull('parent'); + } + if ($selfId) { + $categoriesQuery->where('id', '!=', $selfId); + } + + $categories = $categoriesQuery->paginate($limit); + $data = CategoryResource::collection($categories)->response()->getData(true); + return formatAPIResourcePaginate($data); + } + + /** + * Store a newly created resource in storage. + * + * @param CategoryCreateRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(CategoryCreateRequest $request) + { + try { + return $this->repository->saveCategory($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + // $language = $request->language ?? DEFAULT_LANGUAGE; + // $translation_item_id = $request->translation_item_id ?? null; + // $category->storeTranslation($translation_item_id, $language); + // return $category; + } + + /** + * Display the specified resource. + * + * @param string|int $params + * @return JsonResponse + */ + public function show(Request $request, $params) + { + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + if (is_numeric($params)) { + $params = (int) $params; + $category = $this->repository->with(['type', 'parentCategory', 'children'])->where('id', $params)->firstOrFail(); + return new CategoryResource($category); + } + $category = $this->repository->with(['type', 'parentCategory', 'children'])->where('slug', $params)->firstOrFail(); + return new CategoryResource($category); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param CategoryUpdateRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(CategoryUpdateRequest $request, $id) + { + try { + $request->merge(['id' => $id]); + return $this->categoryUpdate($request); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + + public function categoryUpdate(CategoryUpdateRequest $request) + { + $category = $this->repository->findOrFail($request->id); + return $this->repository->updateCategory($request, $category); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * fetchFeaturedCategories -- Chawkbazar specific here + * + * @param mixed $request + * @return void + */ + public function fetchFeaturedCategories(Request $request) + { + // $limit = isset($request->limit) ? $request->limit : 3; + // return $this->repository->with(['products'])->take($limit)->get()->map(function ($category) { + // $category->setRelation('products', $category->products->withCount('orders')->sortBy('orders_count', "desc")->take(3)); + // return $category; + // }); + return $this->repository->with(['products'])->limit(3); + } +} diff --git a/packages/marvel/src/Http/Controllers/CheckoutController.php b/packages/marvel/src/Http/Controllers/CheckoutController.php new file mode 100644 index 0000000..996460e --- /dev/null +++ b/packages/marvel/src/Http/Controllers/CheckoutController.php @@ -0,0 +1,32 @@ +repository = $repository; + } + + /** + * Verify the checkout data and calculate tax and shipping. + * + * @param CheckoutVerifyRequest $request + * @return array + */ + public function verify(CheckoutVerifyRequest $request) + { + try { + return $this->repository->verify($request); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/ConversationController.php b/packages/marvel/src/Http/Controllers/ConversationController.php new file mode 100644 index 0000000..79e00ea --- /dev/null +++ b/packages/marvel/src/Http/Controllers/ConversationController.php @@ -0,0 +1,94 @@ +repository = $repository; + } + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Conversation[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + $conversation = $this->fetchConversations($request); + + return $conversation->paginate($limit); + } + + public function show($conversation_id) + { + $user = Auth::user(); + $conversation = $this->repository->with(['shop', 'user.profile'])->findOrFail($conversation_id); + abort_unless($user->shop_id === $conversation->shop_id || in_array($conversation->shop_id, $user->shops->pluck('id')->toArray()) || $user->id === $conversation->user_id, 404, 'Unauthorized'); + + return $conversation; + } + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Query|Conversation[] + */ + public function fetchConversations(Request $request) + { + return $this->repository->where(function ($query) { + $user = Auth::user(); + $query->where('user_id', $user->id); + $query->orWhereIn('shop_id', $user->shops->pluck('id')); + $query->orWhere('shop_id', $user->shop_id); + $query->orderBy('updated_at', 'desc'); + })->with(['user.profile', 'shop']); + } + + /** + * Store a newly created resource in storage. + * + * @param ConversationCreateRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(ConversationCreateRequest $request) + { + $user = $request->user(); + if (empty($user)) { + throw new MarvelException(NOT_AUTHORIZED); + } + + $shop = Shop::findOrFail($request->shop_id); + if ($shop->owner_id === $request->user()->id) { + throw new MarvelException(YOU_CAN_NOT_SEND_MESSAGE_TO_YOUR_OWN_SHOP); + } + if ($request->shop_id === $request->user()->shop_id) { + throw new MarvelException(YOU_CAN_NOT_SEND_MESSAGE_TO_YOUR_OWN_SHOP); + } + return $this->repository->firstOrCreate([ + 'user_id' => $user->id, + 'shop_id' => $request->shop_id + ]); + } +} diff --git a/packages/marvel/src/Http/Controllers/CoreController.php b/packages/marvel/src/Http/Controllers/CoreController.php new file mode 100644 index 0000000..aa5d2c7 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/CoreController.php @@ -0,0 +1,15 @@ +repository = $repository; + } + + /** + * Display a listing of the resource. + */ + public function index(Request $request) + { + $limit = $request->limit ?? 15; + $language = $request->language ?? DEFAULT_LANGUAGE; + $coupons = $this->fetchCoupons($request, $language)->paginate($limit)->withQueryString(); + return formatAPIResourcePaginate(CouponResource::collection($coupons)->response()->getData(true)); + } + public function fetchCoupons(Request $request) + { + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + $user = $request->user(); + $query = $this->repository->whereNotNull('id')->with('shop'); + if ($user) { + switch (true) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + $query->where('language', $language); + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + $this->repository->hasPermission($user, $request->shop_id) + ? $query->where('shop_id', $request->shop_id) + : $query->where('user_id', $user->id)->whereIn('shop_id', $user->shops->pluck('id')); + $query->where('language', $language); + break; + + case $user->hasPermissionTo(Permission::STAFF): + $query->where('shop_id', $request->shop_id)->where('language', $language); + break; + + default: + $query->where('language', $language); + break; + } + } else { + if ($request->shop_id) { + $query->where('shop_id', $request->shop_id); + } + $query->where('language', $language); + } + return $query; + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + /** + * Store a newly created resource in storage. + * + * @param CouponRequest $request + * @return LengthAwarePaginator|Collection|mixed + * @throws ValidatorException + */ + public function store(CouponRequest $request) + { + try { + return $this->repository->storeCoupon($request); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE, $e->getMessage()); + } + } + + /** + * Display the specified resource. + * + * @param int $id + * @return JsonResponse + */ + public function show(Request $request, $params) + { + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + try { + if (is_numeric($params)) { + $params = (int) $params; + return $this->repository->where('id', $params)->firstOrFail(); + } + return $this->repository->where('code', $params)->where('language', $language)->firstOrFail(); + } catch (Throwable $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + /** + * Verify Coupon by code. + * + * @param int $id + * @return mixed + */ + public function verify(Request $request) + { + $request->validate([ + 'code' => 'required|string', + 'sub_total' => 'required|numeric', + ]); + try { + return $this->repository->verifyCoupon($request); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param CouponRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(UpdateCouponRequest $request, $id) + { + try { + $request->id = $id; + return $this->updateCoupon($request); + } catch (MarvelException $th) { + throw new MarvelException(); + } + } + + /** + * Undocumented function + * + * @param $request + * @return void + */ + public function updateCoupon(Request $request) + { + $id = $request->id; + $dataArray = $this->repository->getDataArray(); + + try { + $code = $this->repository->findOrFail($id); + + if ($request->has('language') && $request['language'] === DEFAULT_LANGUAGE) { + $updatedCoupon = $request->only($dataArray); + if (!$request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $updatedCoupon['is_approve'] = false; + } + $nonTranslatableKeys = ['language', 'image', 'description', 'id']; + foreach ($nonTranslatableKeys as $key) { + if (isset($updatedCoupon[$key])) { + unset($updatedCoupon[$key]); + } + } + $this->repository->where('code', $code->code)->update($updatedCoupon); + } + + return $this->repository->update($request->only($dataArray), $id); + } catch (Exception $e) { + throw new HttpException(404, NOT_FOUND); + } + } + + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + public function approveCoupon(Request $request) + { + + try { + if (!$request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + throw new MarvelException(NOT_AUTHORIZED); + } + $coupon = $this->repository->findOrFail($request->id); + $coupon->update(['is_approve' => true]); + return $coupon; + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function disApproveCoupon(Request $request) + { + try { + if (!$request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + throw new MarvelException(NOT_AUTHORIZED); + } + $coupon = $this->repository->findOrFail($request->id); + $coupon->is_approve = false; + $coupon->save(); + return $coupon; + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/DeliveryTimeController.php b/packages/marvel/src/Http/Controllers/DeliveryTimeController.php new file mode 100644 index 0000000..9527ed6 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/DeliveryTimeController.php @@ -0,0 +1,103 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|DeliveryTime[] + */ + public function index(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + return $this->repository->where('language', $language)->get(); + } + + /** + * Store a newly created resource in storage. + * + * @param DeliveryTimeRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(DeliveryTimeRequest $request) + { + try { + return $this->repository->create($request->validated()); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function show(Request $request, $params) + { + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + return $this->repository->where('id', $params)->where('language', $language)->firstOrFail(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param DeliveryTimeRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(DeliveryTimeRequest $request, $id) + { + try { + try { + return $this->repository->findOrFail($id)->update($request->validated()); + } catch (\Throwable $th) { + abort(400, COULD_NOT_UPDATE_THE_RESOURCE); + } + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/DownloadController.php b/packages/marvel/src/Http/Controllers/DownloadController.php new file mode 100644 index 0000000..e8cdc47 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/DownloadController.php @@ -0,0 +1,120 @@ +repository = $repository; + } + + /** + * fetchDownloadableFiles + * + * @param mixed $request + * @return void + * @throws MarvelException + */ + public function fetchDownloadableFiles(Request $request) + { + $limit = isset($request->limit) ? $request->limit : 15; + return $this->fetchFiles($request)->paginate($limit)->loadMorph('file.fileable', [ + Product::class => ['shop'], + Variation::class => ['product.shop'], + ])->withQueryString(); + } + + /** + * fetchFiles + * + * @param mixed $request + * @return mixed + * @throws MarvelException + */ + public function fetchFiles(Request $request) + { + try { + $user = $request->user(); + if ($user) { + return OrderedFile::where('customer_id', $user->id)->with(['order']); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $th) { + throw new MarvelException(NOT_AUTHORIZED); + } + } + + /** + * generateDownloadableUrl + * + * @param mixed $request + * @return void + * @throws MarvelException + */ + public function generateDownloadableUrl(Request $request) + { + try { + $user = $request->user(); + $orderedFiles = OrderedFile::where('digital_file_id', $request->digital_file_id)->where('customer_id', $user->id)->get(); + if (count($orderedFiles)) { + $dataArray = [ + 'user_id' => $user->id, + 'token' => Str::random(16), + 'digital_file_id' => $request->digital_file_id + ]; + $newToken = DownloadToken::create($dataArray); + return route('download_url.token', ['token' => $newToken->token]); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(NOT_AUTHORIZED); + } + } + + /** + * downloadFile + * + * @param mixed $token + * @return void + * @throws MarvelException + */ + public function downloadFile($token) + { + try { + try { + $downloadToken = DownloadToken::with('file')->where('token', $token)->first(); + if ($downloadToken) { + $downloadToken->delete(); + } else { + return ['message' => TOKEN_NOT_FOUND]; + } + } catch (Exception $e) { + throw new HttpException(404, TOKEN_NOT_FOUND); + } + try { + $mediaItem = Media::findOrFail($downloadToken->file->attachment_id); + } catch (Exception $e) { + return ['message' => NOT_FOUND]; + } + return $mediaItem; + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/FaqsController.php b/packages/marvel/src/Http/Controllers/FaqsController.php new file mode 100644 index 0000000..cd87510 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/FaqsController.php @@ -0,0 +1,206 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Faqs[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 10; + $language = $request->language ?? DEFAULT_LANGUAGE; + $faqs = $this->fetchFAQs($request)->where('language', $language)->paginate($limit)->withQueryString(); + $data = FaqResource::collection($faqs)->response()->getData(true); + return formatAPIResourcePaginate($data); + } + + + /** + * fetchFAQs + * + * @param Request $request + * @return object + */ + public function fetchFAQs(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + try { + $user = $request->user(); + + if ($user) { + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + return $this->repository + ->with('shop') + ->whereNotNull('id') + ->where('language', $language); + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + if ($this->repository->hasPermission($user, $request->shop_id)) { + return $this->repository + ->with('shop') + ->where('shop_id', '=', $request->shop_id) + ->where('language', $language); + } else { + return $this->repository + ->with('shop') + ->where('user_id', '=', $user->id) + ->where('language', $language) + ->whereIn('shop_id', $user->shops->pluck('id')); + } + break; + + case $user->hasPermissionTo(Permission::STAFF): + // if ($this->repository->hasPermission($user, $request->shop_id)) { + return $this->repository + ->with('shop') + ->where('shop_id', '=', $request->shop_id) + ->where( + 'language', + $language + ); + // } + break; + + default: + return $this->repository + ->with('shop') + ->where('language', $language) + ->whereNotNull('id'); + break; + } + } else { + if ($request->shop_id) { + return $this->repository + ->with('shop') + ->where('shop_id', '=', $request->shop_id) + ->where('language', $language) + ->whereNotNull('id'); + } else { + return $this->repository + ->with('shop') + ->where('language', $language) + ->whereNotNull('id'); + } + } + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + /** + * Store a newly created faq in storage. + * + * @param CreateFaqsRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(CreateFaqsRequest $request) + { + try { + return $this->repository->storeFaqs($request); + // return $this->repository->create($validatedData); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE, $e->getMessage()); + } + } + + /** + * Display the specified faq. + * + * @param $id + * @return JsonResponse + */ + public function show($id) + { + try { + $faq = $this->repository->with('shop')->findOrFail($id); + return new FaqResource($faq); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND, $e->getMessage()); + } + } + + /** + * Update the specified faqs + * + * @param UpdateFaqsRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(UpdateFaqsRequest $request, $id) + { + try { + $request["id"] = $id; + return $this->updateFaqs($request); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE, $e->getMessage()); + } + } + + /** + * updateFaqs + * + * @param UpdateFaqsRequest $request + * @return void + */ + public function updateFaqs(UpdateFaqsRequest $request) + { + $faqs = $this->repository->findOrFail($request['id']); + return $this->repository->updateFaqs($request, $faqs); + } + + /** + * Remove the specified faqs + * + * @param int $id + * @param Request $request + * @return JsonResponse + */ + public function destroy($id, Request $request) + { + $request->merge(['id' => $id]); + return $this->deleteFaq($request); + } + + public function deleteFaq(Request $request) + { + try { + $id = $request->id; + $user = $request->user(); + if ($user && ($user->hasPermissionTo(Permission::SUPER_ADMIN) || $user->hasPermissionTo(Permission::STORE_OWNER) || $user->hasPermissionTo(Permission::STAFF))) { + return $this->repository->findOrFail($id)->delete(); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND, $e->getMessage()); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/FeedbackController.php b/packages/marvel/src/Http/Controllers/FeedbackController.php new file mode 100644 index 0000000..ce16310 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/FeedbackController.php @@ -0,0 +1,120 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Feedback[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + return $this->repository->with(['user'])->paginate($limit); + } + + /** + * Store a newly created resource in storage. + * + * @param FeedbackCreateRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(FeedbackCreateRequest $request) + { + try { + $model_id = $request['model_id']; + $model_type = $request['model_type']; + $model_name = "\\Marvel\\Database\\Models\\{$model_type}"; + $model = $model_name::findOrFail($model_id); + $user_id = $request->user()->id; + $feedback = $model->feedbacks()->where('user_id', $user_id)->first(); + + if (empty($feedback)) { + $request['user_id'] = $user_id; + $model->feedbacks()->create($request->only($this->dataArray)); + } else { + $positive = $feedback->positive; + $negative = $feedback->negative; + if ($request->input('positive') && $positive == NULL && $negative == true) { + $feedback->update([ + 'positive' => true, + 'negative' => NULL + ]); + } + if ($request->input('negative') && $positive == true && $negative == NULL) { + $feedback->update([ + 'positive' => NULL, + 'negative' => true + ]); + } + } + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function show($id) + { + try { + return $this->repository->findOrFail($id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + public function update(FeedbackUpdateRequest $request) + { + return 'update'; + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/FlashSaleController.php b/packages/marvel/src/Http/Controllers/FlashSaleController.php new file mode 100644 index 0000000..24c374e --- /dev/null +++ b/packages/marvel/src/Http/Controllers/FlashSaleController.php @@ -0,0 +1,211 @@ +repository = $repository; + $this->productRepository = $productRepository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|FlashSale[] + */ + public function index(Request $request) + { + try { + $limit = $request->limit ? $request->limit : 10; + return $this->fetchFlashSales($request)->paginate($limit)->withQueryString(); + // $data = FlashSaleResource::collection($flash_sales)->response()->getData(true); + // return formatAPIResourcePaginate($data); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + public function fetchFlashSales(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + event(new FlashSaleProcessed('index', $language)); + + $flash_sales_query = $this->repository->where('language', $language) + ->when($request->request_from === 'vendor', function ($flash_sales_query) { + return $flash_sales_query->whereDate('start_date', '>', now()->toDateString()); + }); + + return $flash_sales_query; + } + + /** + * Store a newly created faq in storage. + * + * @param CreateFlashSaleRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(CreateFlashSaleRequest $request) + { + try { + return $this->repository->storeFlashSale($request); + // return $this->repository->create($validatedData); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE, $e->getMessage()); + } + } + + /** + * Display the specified flash sale. + * + * @param string $slug + * @return JsonResponse + */ + public function show(Request $request, $slug) + { + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + return $this->repository->where('language', $language)->where('slug', '=', $slug)->first(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND, $e->getMessage()); + } + } + + + /** + * Update the specified flash sale + * + * @param UpdateFlashSaleRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(UpdateFlashSaleRequest $request, $id) + { + try { + $request->merge(['id' => $id]); + return $this->updateFlashSale($request); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE, $e->getMessage()); + } + } + + /** + * updateFlashSale + * + * @param Request $request + * @return void + */ + public function updateFlashSale(Request $request) + { + // $flash_sale_id = $this->repository->findOrFail($request['id']); + // return $this->repository->updateFlashSale($request, $flash_sale_id); + + $id = $request->id; + return $this->repository->updateFlashSale($request, $id); + } + + /** + * Remove the specified flash sale + * + * @param int $id + * @param Request $request + * @return JsonResponse + */ + public function destroy($id, Request $request) + { + $request->merge(['id' => $id]); + return $this->deleteFlashSale($request); + } + + public function deleteFlashSale(Request $request) + { + try { + $user = $request->user(); + if ($user && ($user->hasPermissionTo(Permission::SUPER_ADMIN) || $user->hasPermissionTo(Permission::STORE_OWNER) || $user->hasPermissionTo(Permission::STAFF))) { + $flashSale = $this->repository->findOrFail($request->id); + $flashSale->delete(); + return $flashSale; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND, $e->getMessage()); + } + } + + /** + * getFlashSaleInfoByProductID + * + * @param Request $request + * @return void + */ + public function getFlashSaleInfoByProductID(Request $request) + { + try { + $flash_sale_info = []; + $product = Product::find($request->id); + + if ($product) { + $flash_sale_info = $product->flash_sales; + } + + return $flash_sale_info; + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + /** + * getProductsByFlashSale + * + * @param Request $request + * @return void + */ + public function getProductsByFlashSale(Request $request) + { + $limit = $request->limit ? $request->limit : 10; + return $this->fetchProductsByFlashSale($request)->paginate($limit)->withQueryString(); + } + + /** + * fetchProductsByFlashSale + * + * @param Request $request + * @return object + */ + public function fetchProductsByFlashSale(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + + $product_ids = $this->repository->join('flash_sale_products', 'flash_sales.id', '=', 'flash_sale_products.flash_sale_id') + ->join('products', 'flash_sale_products.product_id', '=', 'products.id') + ->where('flash_sales.slug', '=', $request->slug) + ->where('flash_sales.language', '=', $language) + ->select('products.id') + ->pluck('id'); // You can set your desired limit here (e.g., 10 products per page) + + return $this->productRepository->whereIn('id', $product_ids); + } +} diff --git a/packages/marvel/src/Http/Controllers/FlashSaleVendorRequestController.php b/packages/marvel/src/Http/Controllers/FlashSaleVendorRequestController.php new file mode 100644 index 0000000..7095b19 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/FlashSaleVendorRequestController.php @@ -0,0 +1,259 @@ +repository = $repository; + $this->productRepository = $productRepository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|FlashSaleRequests[] + */ + public function index(Request $request) + { + try { + $limit = $request->limit ? $request->limit : 10; + return $this->fetchFlashSalesRequests($request)->paginate($limit)->withQueryString(); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + /** + * fetchFlashSalesRequests + * + * @param Request $request + * @return object + */ + public function fetchFlashSalesRequests(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + // event(new FlashSaleProcessed('index', $language)); + return $this->repository->where('language', $language); + } + + /** + * Store a newly created faq in storage. + * + * @param CreateVendorFlashSaleRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(CreateVendorFlashSaleRequest $request) + { + try { + return $this->repository->storeFlashSaleRequest($request); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE, $e->getMessage()); + } + } + + /** + * Display the specified flash sale. + * + * @param string $id + * @return JsonResponse + */ + public function show(Request $request, $id) + { + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + return $this->repository->where('language', $language)->where('id', '=', $id)->first(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND, $e->getMessage()); + } + } + + + /** + * Update the specified flash sale + * + * @param UpdateVendorFlashSaleRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(UpdateVendorFlashSaleRequest $request, $id) + { + try { + $request->merge(['id' => $id]); + return $this->updateFlashSaleRequest($request); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE, $e->getMessage()); + } + } + + /** + * updateFlashSaleRequest + * + * @param Request $request + * @return void + */ + public function updateFlashSaleRequest(Request $request) + { + $id = $request->id; + return $this->repository->updateFlashSaleRequest($request, $id); + } + + /** + * Remove the specified flash sale + * + * @param int $id + * @param Request $request + * @return JsonResponse + */ + public function destroy($id, Request $request) + { + $request->merge(['id' => $id]); + return $this->deleteFlashSaleRequest($request); + } + + public function deleteFlashSaleRequest(Request $request) + { + try { + $user = $request->user(); + if ($user && ($user->hasPermissionTo(Permission::SUPER_ADMIN) || $user->hasPermissionTo(Permission::STORE_OWNER) || $user->hasPermissionTo(Permission::STAFF))) { + + $flash_sale_request = $this->repository->findOrFail($request->id); + $requested_products = $flash_sale_request->products; + + $detached_products_array = []; + + if (isset($requested_products)) { + // $flash_sale = FlashSale::with('products')->findOrFail($flash_sale_request->flash_sale_id); + $flash_sale = FlashSale::with('products')->where("id", "=", $flash_sale_request->flash_sale_id)->first(); + + foreach ($requested_products as $product) { + // detach requested products from flash_sale_products pivot table. + if (in_array($product->id, $flash_sale->products->pluck('id')->toArray())) { + $flash_sale->products()->detach($product->id); + } + array_push($detached_products_array, $product->id); + } + $flash_sale->save(); + } + + $prepare_event_data = [ + 'requested_flash_sale' => $flash_sale, + 'detached_products' => $detached_products_array + ]; + event(new FlashSaleProcessed('delete_vendor_request', DEFAULT_LANGUAGE, $prepare_event_data)); + + $flash_sale_request->forceDelete(); + return $flash_sale_request; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND, $e->getMessage()); + } + } + + /** + * approveFlashSaleProductsRequest + * + * @param Request $request + * @return void + */ + public function approveFlashSaleProductsRequest(Request $request) + { + try { + if (!$request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + throw new MarvelException(NOT_AUTHORIZED); + } + $id = $request->id; + $this->repository->approveFlashSaleVendorRequestFunc($id); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + /** + * disapproveFlashSaleProductsRequest + * + * @param Request $request + * @return void + */ + public function disapproveFlashSaleProductsRequest(Request $request) + { + try { + if (!$request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + throw new MarvelException(NOT_AUTHORIZED); + } + $id = $request->id; + $this->repository->disapproveFlashSaleVendorRequestFunc($id); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + + /** + * getRequestedProductsForFlashSale + * + * @param Request $request + * @return object + */ + public function getRequestedProductsForFlashSale(Request $request) + { + try { + $limit = $request->limit ? $request->limit : 10; + return $this->fetchRequestedProducts($request)->paginate($limit)->withQueryString(); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + /** + * fetchRequestedProducts + * + * @param Request $request + * @return object + */ + public function fetchRequestedProducts(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + $product_ids = $this->repository + ->join('flash_sale_requests_products', 'flash_sale_requests.id', '=', 'flash_sale_requests_products.flash_sale_requests_id') + ->join('products', 'flash_sale_requests_products.product_id', '=', 'products.id') + ->where('flash_sale_requests.id', '=', $request->vendor_request_id) + ->where('flash_sale_requests.language', '=', $language) + ->select('products.id') + ->pluck('id'); // You can set your desired limit here (e.g., 10 products per page) + + return $this->productRepository->whereIn('id', $product_ids); + } +} diff --git a/packages/marvel/src/Http/Controllers/LanguageController.php b/packages/marvel/src/Http/Controllers/LanguageController.php new file mode 100644 index 0000000..e374027 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/LanguageController.php @@ -0,0 +1,96 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Language[] + */ + public function index(Request $request) + { + return $this->repository->get(); + } + + /** + * Store a newly created resource in storage. + * + * @param LanguageRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(LanguageRequest $request) + { + try { + return $this->repository->create($request->validated()); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function show(Request $request, $params) + { + try { + return $this->repository->where('id', $params)->firstOrFail(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param LanguageRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(LanguageRequest $request, $id) + { + try { + return $this->repository->findOrFail($id)->update($request->validated()); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/ManufacturerController.php b/packages/marvel/src/Http/Controllers/ManufacturerController.php new file mode 100644 index 0000000..28edc02 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/ManufacturerController.php @@ -0,0 +1,161 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Manufacturer[] + */ + public function index(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + $limit = $request->limit ? $request->limit : 15; + $manufacturers = $this->repository->where('language', $language)->with('type')->paginate($limit); + $data = ManufacturerResource::collection($manufacturers)->response()->getData(true); + return formatAPIResourcePaginate($data); + } + + /** + * Store a newly created resource in storage. + * + * @param ManufacturerRequest $request + * @return mixed + */ + public function store(ManufacturerRequest $request) + { + try { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + return $this->repository->storeManufacturer($request); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $th) { + throw new MarvelException(NOT_AUTHORIZED); + } + } + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function show(Request $request, $slug) + { + try { + $request['slug'] = $slug; + $manufacturer = $this->fetchManufacturer($request); + return new ManufacturerResource($manufacturer); + } catch (MarvelException $th) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function fetchManufacturer(Request $request) + { + + try { + $slug = $request->slug; + $language = $request->language ?? DEFAULT_LANGUAGE; + if (is_numeric($slug)) { + $slug = (int) $slug; + return $this->repository->with('type')->where('id', $slug)->firstOrFail(); + } + return $this->repository->with('type')->where('slug', $slug)->where('language', $language)->firstOrFail(); + } catch (Exception $th) { + throw new HttpException(404, NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param ManufacturerRequest $request + * @param int $id + * @return array + */ + public function update(ManufacturerRequest $request, $id) + { + try { + $request['id'] = $id; + return $this->updateManufacturer($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + public function updateManufacturer(Request $request) + { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + try { + $Manufacturer = $this->repository->findOrFail($request->id); + } catch (\Exception $e) { + throw new HttpException(404, NOT_FOUND); + } + return $this->repository->updateManufacturer($request, $Manufacturer); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } + + /** + * Remove the specified resource from storage. + * + * @param $id + * @return JsonResponse + */ + public function destroy($id, Request $request) + { + try { + $request['id'] = $id; + return $this->deleteManufacturer($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + public function deleteManufacturer(Request $request) + { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + $manufacturer = $this->repository->findOrFail($request->id); + $manufacturer->delete(); + return $manufacturer; + } + throw new MarvelException(NOT_AUTHORIZED); + } + + public function topManufacturer(Request $request) + { + $limit = $request->limit ? $request->limit : 10; + $language = $request->language ?? DEFAULT_LANGUAGE; + return $this->repository->where('language', $language)->withCount('products')->orderBy('products_count', 'desc')->take($limit)->get(); + } +} diff --git a/packages/marvel/src/Http/Controllers/MessageController.php b/packages/marvel/src/Http/Controllers/MessageController.php new file mode 100644 index 0000000..e82bbdc --- /dev/null +++ b/packages/marvel/src/Http/Controllers/MessageController.php @@ -0,0 +1,135 @@ +repository = $repository; + $this->conversationRepository = $conversationRepository; + } + + /** + * Display a listing of the resource. + * + * @param Request $request + * @param $conversation_id + * @return Collection|Message[] + */ + public function index(Request $request, $conversation_id) + { + $request->conversation_id = $conversation_id; + + $user = Auth::user(); + $conversation = $this->conversationRepository->findOrFail($conversation_id); + abort_unless($user->shop_id === $conversation->shop_id || in_array( $conversation->shop_id, $user->shops->pluck('id')->toArray()) || $user->id === $conversation->user_id, 404, 'Unauthorized'); + + $messages = $this->fetchMessages($request); + + $limit = $request->limit ? $request->limit : 15; + return $messages->paginate($limit); + + } + + public function seenMessage(Request $request) + { + return $this->seen($request->conversation_id); + } + + public function seen($conversation_id) + { + $participant = Participant::where('conversation_id', $conversation_id) + ->whereNull('last_read') + ->where(function($query){ + $query->where('user_id', auth()->user()->id); + $query->where('type', 'user'); + }) + ->update(['last_read' => new Carbon()]); + + if(0 === $participant) { + $participant = Participant::where('conversation_id', $conversation_id) + ->whereNull('last_read') + ->where(function($query){ + $query->whereIn('shop_id', auth()->user()->shops->pluck('id')); + $query->orWhere('shop_id', auth()->user()->shop_id); + $query->where('type', 'shop'); + }) + ->update(['last_read' => new Carbon()]); + } + + return $participant; + } + + public function fetchMessages(Request $request) + { + + $user = $request->user(); + $conversation_id = $request->conversation_id; + + try { + $conversation = Conversation::where('id', $conversation_id) + ->where('user_id', $user->id) + ->orWhereIn('shop_id', $user->shops()->pluck('id')) + ->orWhere('shop_id', $user->shop_id) + ->with(['user', 'shop'])->first(); + + if(empty($conversation)) { + throw new MarvelException(NOT_AUTHORIZED); + } + + return $this->repository->where('conversation_id', $conversation_id) + ->with(['conversation.shop', 'conversation.user.profile']) + ->orderBy('id', 'DESC'); + } catch (\Exception $e) { + throw new MarvelException(NOT_AUTHORIZED); + } + } + + /** + * Store a newly created resource in storage. + * + * @param MessageCreateRequest $request + * @param $conversation_id + * @return mixed + * @throws ValidatorException + */ + public function store(MessageCreateRequest $request, $conversation_id) + { + $request->conversation_id = $conversation_id; + + return $this->storeMessage($request); + } + + /** + * Store a newly created resource in storage. + * + * @param Request $request + * @return mixed + * @throws ValidatorException + */ + public function storeMessage(Request $request) + { + return $this->repository->storeMessage($request); + } +} diff --git a/packages/marvel/src/Http/Controllers/NotifyLogsController.php b/packages/marvel/src/Http/Controllers/NotifyLogsController.php new file mode 100644 index 0000000..696e0b0 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/NotifyLogsController.php @@ -0,0 +1,165 @@ +repository = $repository; + $this->userRepository = $userRepository; + } + + /** + * index + * + * @param Request $request + * @return Collection|NotifyLogs[] + */ + public function index(Request $request) + { + try { + $limit = $request->limit ? $request->limit : 10; + return $this->fetchNotifyLogs($request)->paginate($limit)->withQueryString(); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG, $th->getMessage()); + } + } + + /** + * fetchNotifyLogs + * + * @param Request $request + * @return object + */ + public function fetchNotifyLogs(Request $request) + { + $user = $request->user(); + $notify_log_query = $this->repository->with(['sender_user'])->where('receiver', '=', $user->id); + + if (isset($request->notify_type) && !empty($request->notify_type)) { + $notify_log_query = $notify_log_query->where('notify_type', "=", $request->notify_type); + } + + return $notify_log_query; + } + + /** + * Display the specified resource. + * + * @param $slug + * @return object + */ + public function show(Request $request, $id) + { + try { + $request['id'] = $id; + return $this->fetchNotifyLog($request); + } catch (MarvelException $th) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Display the specified resource. + * + * @param $slug + * @return object + */ + public function fetchNotifyLog(Request $request) + { + try { + $id = $request['id']; + return $this->repository->where('id', '=', $id)->firstOrFail(); + } catch (Exception $th) { + throw new HttpException(404, NOT_FOUND); + } + } + + + + /** + * Remove the specified resource from storage. + * + * @param $id + * @return JsonResponse + */ + public function destroy($id, Request $request) + { + try { + $request['id'] = $id; + return $this->deleteNotifyLogs($request); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG, $th->getMessage()); + } + } + + public function deleteNotifyLogs(Request $request) + { + try { + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + return $this->repository->findOrFail($request->id)->delete(); + } + } catch (MarvelException $th) { + throw new MarvelException(NOT_AUTHORIZED, $th->getMessage()); + } + } + + /** + * readNotifyLogs + * + * @param Request $request + * @return void + */ + public function readNotifyLogs(Request $request) + { + try { + $notify_log = $this->repository->findOrFail($request->id); + $notify_log->is_read = true; + $notify_log->save(); + return $notify_log; + } catch (MarvelException $th) { + throw new MarvelException(NOT_AUTHORIZED, $th->getMessage()); + } + } + + + /** + * readAllNotifyLogs + * + * @param Request $request + * @return void + */ + public function readAllNotifyLogs(Request $request) + { + try { + if (isset($request->set_all_read)) { + $notify_logs = $this->repository->where("notify_type", "=", $request->notify_type)->where('receiver', '=', $request->receiver)->get(); + + foreach ($notify_logs as $key => $notify_log) { + $notify_log->is_read = true; + $notify_log->save(); + } + + return $notify_logs; + } + } catch (MarvelException $th) { + throw new MarvelException(NOT_AUTHORIZED, $th->getMessage()); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/OrderController.php b/packages/marvel/src/Http/Controllers/OrderController.php new file mode 100644 index 0000000..58d0c9f --- /dev/null +++ b/packages/marvel/src/Http/Controllers/OrderController.php @@ -0,0 +1,478 @@ +repository = $repository; + $this->settings = Settings::first(); + } + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Order[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 10; + return $this->fetchOrders($request)->paginate($limit)->withQueryString(); + } + + /** + * fetchOrders + * + * @param mixed $request + * @return object + */ + public function fetchOrders(Request $request) + { + $user = $request->user(); + + if (!$user) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + return $this->repository->with('children')->where('id', '!=', null)->where('parent_id', '=', null); + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + if ($this->repository->hasPermission($user, $request->shop_id)) { + return $this->repository->with('children')->where('shop_id', '=', $request->shop_id)->where('parent_id', '!=', null); + } else { + $orders = $this->repository->with('children')->where('parent_id', '!=', null)->whereIn('shop_id', $user->shops->pluck('id')); + return $orders; + } + break; + + case $user->hasPermissionTo(Permission::STAFF): + if ($this->repository->hasPermission($user, $request->shop_id)) { + return $this->repository->with('children')->where('shop_id', '=', $request->shop_id)->where('parent_id', '!=', null); + } else { + $orders = $this->repository->with('children')->where('parent_id', '!=', null)->where('shop_id', '=', $user->shop_id); + return $orders; + } + break; + + default: + return $this->repository->with('children')->where('customer_id', '=', $user->id)->where('parent_id', '=', null); + break; + } + + // ********************* Old code ********************* + + // if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN) && (!isset($request->shop_id) || $request->shop_id === 'undefined')) { + // return $this->repository->with('children')->where('id', '!=', null)->where('parent_id', '=', null); //->paginate($limit); + // } else if ($this->repository->hasPermission($user, $request->shop_id)) { + // // if ($user && $user->hasPermissionTo(Permission::STORE_OWNER)) { + // return $this->repository->with('children')->where('shop_id', '=', $request->shop_id)->where('parent_id', '!=', null); //->paginate($limit); + // // } elseif ($user && $user->hasPermissionTo(Permission::STAFF)) { + // // return $this->repository->with('children')->where('shop_id', '=', $request->shop_id)->where('parent_id', '!=', null); //->paginate($limit); + // // } + // } else { + // return $this->repository->with('children')->where('customer_id', '=', $user->id)->where('parent_id', '=', null); //->paginate($limit); + // } + } + + + /** + * Store a newly created resource in storage. + * + * @param OrderCreateRequest $request + * @return LengthAwarePaginator|\Illuminate\Support\Collection|mixed + * @throws MarvelException + */ + public function store(OrderCreateRequest $request) + { + try { + // decision need + // if(!($this->settings->options['useCashOnDelivery'] && $this->settings->options['useEnableGateway'])){ + // throw new HttpException(400, PLEASE_ENABLE_PAYMENT_OPTION_FROM_THE_SETTINGS); + // } + + return DB::transaction(fn () => $this->repository->storeOrder($request, $this->settings)); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG, $th->getMessage()); + } + } + + /** + * Display the specified resource. + * + * @param Request $request + * @param $params + * @return JsonResponse + * @throws MarvelException + */ + public function show(Request $request, $params) + { + $request["tracking_number"] = $params; + try { + return $this->fetchSingleOrder($request); + } catch (MarvelException $e) { + throw new MarvelException($e->getMessage()); + } + } + + /** + * fetchSingleOrder + * + * @param mixed $request + * @return void + * @throws MarvelException + */ + public function fetchSingleOrder(Request $request) + { + $user = $request->user() ?? null; + $language = $request->language ?? DEFAULT_LANGUAGE; + $orderParam = $request->tracking_number ?? $request->id; + try { + $order = $this->repository->where('language', $language)->with([ + 'products', + 'shop', + 'children.shop', + 'wallet_point', + ])->where('id', $orderParam)->orWhere('tracking_number', $orderParam)->firstOrFail(); + } catch (ModelNotFoundException $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + + // Create Intent + if ( + !in_array($order->payment_gateway, [ + PaymentGatewayType::CASH, PaymentGatewayType::CASH_ON_DELIVERY, PaymentGatewayType::FULL_WALLET_PAYMENT + ]) + ) { + // $order['payment_intent'] = $this->processPaymentIntent($request, $this->settings); + $order['payment_intent'] = $this->attachPaymentIntent($orderParam); + } + + if (!$order->customer_id) { + return $order; + } + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + return $order; + } elseif (isset($order->shop_id)) { + if ($user && ($this->repository->hasPermission($user, $order->shop_id) || $user->id == $order->customer_id)) { + return $order; + } + } elseif ($user && $user->id == $order->customer_id) { + return $order; + } else { + throw new AuthorizationException(NOT_AUTHORIZED); + } + } + + /** + * findByTrackingNumber + * + * @param mixed $request + * @param mixed $tracking_number + * @return void + */ + public function findByTrackingNumber(Request $request, $tracking_number) + { + $user = $request->user() ?? null; + try { + $order = $this->repository->with(['products', 'children.shop', 'wallet_point', 'payment_intent']) + ->findOneByFieldOrFail('tracking_number', $tracking_number); + + if ($order->customer_id === null) { + return $order; + } + if ($user && ($user->id === $order->customer_id || $user->can('super_admin'))) { + return $order; + } else { + throw new AuthorizationException(NOT_AUTHORIZED); + } + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param OrderUpdateRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(OrderUpdateRequest $request, $id) + { + try { + $request["id"] = $id; + return $this->updateOrder($request); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE, $e->getMessage()); + } + } + + public function updateOrder(OrderUpdateRequest $request) + { + return $this->repository->updateOrder($request); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Export order dynamic url + * + * @param Request $request + * @param int $shop_id + * @return string + */ + public function exportOrderUrl(Request $request, $shop_id = null) + { + try { + $user = $request->user(); + + if ($user && !$this->repository->hasPermission($user, $request->shop_id)) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + + $dataArray = [ + 'user_id' => $user->id, + 'token' => Str::random(16), + 'payload' => $request->shop_id + ]; + $newToken = DownloadToken::create($dataArray); + + return route('export_order.token', ['token' => $newToken->token]); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + /** + * Export order to excel sheet + * + * @param string $token + * @return void + */ + public function exportOrder($token) + { + $shop_id = 0; + try { + $downloadToken = DownloadToken::where('token', $token)->first(); + + $shop_id = $downloadToken->payload; + $downloadToken->delete(); + } catch (MarvelException $e) { + throw new MarvelException(TOKEN_NOT_FOUND); + } + + try { + return Excel::download(new OrderExport($this->repository, $shop_id), 'orders.xlsx'); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Export order dynamic url + * + * @param Request $request + * @param int $shop_id + * @return string + */ + public function downloadInvoiceUrl(Request $request) + { + + try { + $user = $request->user(); + if ($user && !$this->repository->hasPermission($user, $request->shop_id)) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + if (empty($request->order_id)) { + throw new NotFoundHttpException(NOT_FOUND); + } + $language = $request->language ?? DEFAULT_LANGUAGE; + $isRTL = $request->is_rtl ?? false; + + $translatedText = $this->formatInvoiceTranslateText($request->translated_text); + + $payload = [ + 'user_id' => $user->id, + 'order_id' => intval($request->order_id), + 'language' => $language, + 'translated_text' => $translatedText, + 'is_rtl' => $isRTL + ]; + + $data = [ + 'user_id' => $user->id, + 'token' => Str::random(16), + 'payload' => serialize($payload) + ]; + + $newToken = DownloadToken::create($data); + + return route('download_invoice.token', ['token' => $newToken->token]); + } catch (MarvelException $e) { + throw new MarvelException($e->getMessage()); + } + } + + /** + * Export order to excel sheet + * + * @param string $token + * @return void + */ + public function downloadInvoice($token) + { + $payloads = []; + try { + $downloadToken = DownloadToken::where('token', $token)->firstOrFail(); + $payloads = unserialize($downloadToken->payload); + $downloadToken->delete(); + } catch (MarvelException $e) { + throw new MarvelException(TOKEN_NOT_FOUND); + } + + try { + $settings = Settings::getData($payloads['language']) ?? DEFAULT_LANGUAGE; + $order = $this->repository->with(['products', 'children.shop', 'parent_order', 'wallet_point'])->where('id', $payloads['order_id'])->orWhere('tracking_number', $payloads['order_id'])->firstOrFail(); + $invoiceData = [ + 'order' => $order, + 'settings' => $settings, + 'translated_text' => $payloads['translated_text'], + 'is_rtl' => $payloads['is_rtl'], + 'language' => $payloads['language'], + ]; + $pdf = PDF::loadView('pdf.order-invoice', $invoiceData); + $options = new Options(); + $options->setIsPhpEnabled(true); + $options->setIsJavascriptEnabled(true); + $pdf->getDomPDF()->setOptions($options); + + $filename = 'invoice-order-' . $payloads['order_id'] . '.pdf'; + + return $pdf->download($filename); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * submitPayment + * + * @param mixed $request + * @return void + * @throws Exception + */ + public function submitPayment(Request $request): void + { + $tracking_number = $request->tracking_number ?? null; + try { + $order = $this->repository->with(['products', 'children.shop', 'wallet_point', 'payment_intent']) + ->findOneByFieldOrFail('tracking_number', $tracking_number); + + $isFinal = $this->checkOrderStatusIsFinal($order); + if ($isFinal) return; + + switch ($order->payment_gateway) { + + case PaymentGatewayType::STRIPE: + $this->stripe($order, $request, $this->settings); + break; + + case PaymentGatewayType::PAYPAL: + $this->paypal($order, $request, $this->settings); + break; + + case PaymentGatewayType::MOLLIE: + $this->mollie($order, $request, $this->settings); + break; + + case PaymentGatewayType::RAZORPAY: + $this->razorpay($order, $request, $this->settings); + break; + + case PaymentGatewayType::PAYSTACK: + $this->paystack($order, $request, $this->settings); + break; + + case PaymentGatewayType::XENDIT: + $this->xendit($order, $request, $this->settings); + break; + + case PaymentGatewayType::IYZICO: + $this->iyzico($order, $request, $this->settings); + break; + + case PaymentGatewayType::BKASH: + $this->bkash($order, $request, $this->settings); + break; + + case PaymentGatewayType::PAYMONGO: + $this->paymongo($order, $request, $this->settings); + break; + + case PaymentGatewayType::FLUTTERWAVE: + $this->flutterwave($order, $request, $this->settings); + break; + } + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/OwnershipTransferController.php b/packages/marvel/src/Http/Controllers/OwnershipTransferController.php new file mode 100644 index 0000000..7f2a24d --- /dev/null +++ b/packages/marvel/src/Http/Controllers/OwnershipTransferController.php @@ -0,0 +1,161 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * + * @return \Illuminate\Http\JsonResponse + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + $ownershipHistory = $this->fetchOwnershipTransferHistories($request)->paginate($limit)->withQueryString(); + $data = OwnershipTransferResource::collection($ownershipHistory)->response()->getData(true); + return formatAPIResourcePaginate($data); + } + + public function fetchOwnershipTransferHistories(Request $request) + { + $user = $request->user(); + + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + $query = $this->repository->whereNotNull('id'); + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + + if ($request->type === 'from') { + $query = $this->repository->where('from', '=', $user->id); + } else { + $query = $this->repository->where('to', '=', $user->id); + } + break; + } + + return $query; + } + + /** + * Display the specified resource. + * + * @param $transaction_identifier + * @return OwnershipTransferResource + */ + public function show(Request $request, $transaction_identifier) + { + try { + $request->merge(["transaction_identifier" => $transaction_identifier]); + return $this->fetchOwnerTransferHistory($request); + } catch (MarvelException $th) { + throw new MarvelException(NOT_FOUND); + } + } + /** + * Display the specified resource. + * + * @param $slug + * @return OwnershipTransferResource + */ + public function fetchOwnerTransferHistory(Request $request) + { + try { + // $ownershipTransfer = $this->repository->where('transaction_identifier', '=', $request->transaction_identifier)->with(['shop'])->firstOrFail(); + // $ownershipTransfer->setRelation('order_info', $this->orderInfoRelatedToShop($ownershipTransfer->shop->id)); + + $ownershipTransfer = $this->repository->getOwnershipTransferHistory($request); + return new OwnershipTransferResource($ownershipTransfer); + } catch (Exception $e) { + throw new MarvelNotFoundException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param Request $request + * @param int $id + * @return OwnershipTransferResource + * @throws \Marvel\Exceptions\MarvelException + */ + public function update(Request $request, $id) + { + try { + $request->merge(['id' => $id]); + return $this->updateOwnershipTransfer($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + public function updateOwnershipTransfer(Request $request) + { + try { + $user = $request->user(); + if (!$user->hasPermissionTo(Permission::SUPER_ADMIN)) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + $data = $this->repository->updateOwnershipTransfer($request); + + event(new OwnershipTransferStatusControl($data)); + + return new OwnershipTransferResource($data); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + /** + * Remove the specified resource from storage. + * + * @param $id + * @return JsonResponse + */ + public function destroy($id, Request $request) + { + try { + $request->merge(['id' => $id]); + return $this->deleteOwnershipTransfer($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + public function deleteOwnershipTransfer(Request $request) + { + $user = $request->user(); + if (!$this->repository->hasPermission($user, $request?->shop_id)) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + $ownershipTransfer = $this->repository->findOrFail($request->id); + $ownershipTransfer->delete(); + return $ownershipTransfer; + } +} diff --git a/packages/marvel/src/Http/Controllers/PaymentIntentController.php b/packages/marvel/src/Http/Controllers/PaymentIntentController.php new file mode 100644 index 0000000..b92b7a2 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/PaymentIntentController.php @@ -0,0 +1,44 @@ +repository = $repository; + $this->settings = Settings::first(); + } + + + /** + * getPaymentIntent + * + * This function create the payment intent for the payment & store that into database with related to that order. + * So that, if the intent was kept track in any case for current or future payment. + * + * @param mixed $request + * @return void + */ + public function getPaymentIntent(Request $request) + { + try { + if (!auth()->check() && !$this->settings->options['guestCheckout']) { + throw new AuthenticationException(); + } + return $this->repository->getPaymentIntent($request, $this->settings); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/PaymentMethodController.php b/packages/marvel/src/Http/Controllers/PaymentMethodController.php new file mode 100644 index 0000000..97f1bbf --- /dev/null +++ b/packages/marvel/src/Http/Controllers/PaymentMethodController.php @@ -0,0 +1,163 @@ +repository = $repository; + $this->settings = Settings::first(); + } + + /** + * index + * + * Get all the available payment method (e.g. Card) of current customer. + * + * @param mixed $request + * @return void + */ + public function index(Request $request) + { + // currently stripe has only card saving feature available. So, it's hardcoded here. In case of future it can be processed based on the selected payment gateway for saving cards + $user = $request->user(); + return $this->repository->with('payment_gateways')->whereRelation('payment_gateways', 'user_id', $user->id)->whereRelation('payment_gateways', 'gateway_name', 'stripe')->get(); + } + + /** + * store + * + * Create & store the payment method (e.g. Card) and store the only available & safe information in database. + * + * @param mixed $request + * @return void + */ + public function store(PaymentMethodCreateRequest $request) + { + try { + return $this->repository->storeCards($request, $this->settings); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * destroy + * + * Delete Payment method (e.g. Card) from a user. + * + * @param Request $request + * @param mixed $id + * @return void + * @throws \Exception + */ + public function destroy(Request $request, mixed $id) + { + $request->id = $id; + return $this->deletePaymentMethod($request); + } + + + public function deletePaymentMethod(Request $request) + { + try { + try { + $retrieved_payment_method = PaymentMethod::where('id', '=', $request->id)->first(); + Payment::detachPaymentMethodToCustomer($retrieved_payment_method->method_key); + return $this->repository->findOrFail($request->id)->forceDelete(); + } catch (\Exception $e) { + throw new HttpException(409, COULD_NOT_DELETE_THE_RESOURCE); + } + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE, $e->getMessage()); + } + } + + /** + * getMethodKeyByCard + * + * When creating a payment method (e.g Card) during checkout, it needs to generate that payment method identifier. + * It can be used, in case of payment methods where cards can be saved. + * + * @param mixed $request + * @return void + */ + public function savePaymentMethod(Request $request) + { + switch ($request->payment_gateway) { + case 'stripe': + return $this->repository->saveStripeCard($request); + break; + } + } + + /** + * saveCardIntent + * + * Save payment method (e.g. Card) for future usages. + * + * @param mixed $request + * @return void + */ + public function saveCardIntent(Request $request) + { + switch ($this->settings->options['paymentGateway']) { + case 'stripe': + $setupIntent = $this->repository->setStripeIntent($request); + break; + } + + return $setupIntent; + } + + /** + * setDefaultPaymentMethod + * + * This method initiate the functionalities to set a payment method (e.g. Card) as a default for any user. + * + * @param mixed $request + * @return void + */ + public function setDefaultCard(Request $request) + { + try { + return $this->repository->setDefaultPaymentMethod($request); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + // if system varies from payment-gateway to payment-gateway, then use this. + // switch ($this->settings->options['paymentGateway']) { + // case 'stripe': + // $setDefaultPayment = $this->repository->setDefaultPaymentMethod($request); + // break; + // } + } +} diff --git a/packages/marvel/src/Http/Controllers/ProductController.php b/packages/marvel/src/Http/Controllers/ProductController.php new file mode 100644 index 0000000..3d10ac1 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/ProductController.php @@ -0,0 +1,808 @@ +repository = $repository; + $this->settings = $settings; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Product[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + $products = $this->fetchProducts($request)->paginate($limit)->withQueryString(); + $data = ProductResource::collection($products)->response()->getData(true); + return formatAPIResourcePaginate($data); + } + + + + /** + * fetchProducts + * + * @param mixed $request + * @return object + */ + public function fetchProducts(Request $request) + { + $unavailableProducts = []; + $language = $request->language ? $request->language : DEFAULT_LANGUAGE; + + $products_query = $this->repository->where('language', $language); + + if (isset($request->date_range)) { + $dateRange = explode('//', $request->date_range); + $unavailableProducts = $this->repository->getUnavailableProducts($dateRange[0], $dateRange[1]); + } + if (in_array('variation_options.digital_files', explode(';', $request->with)) || in_array('digital_files', explode(';', $request->with))) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + $products_query = $products_query->whereNotIn('id', $unavailableProducts); + + if ($request->flash_sale_builder) { + $products_query = $this->repository->processFlashSaleProducts($request, $products_query); + } + + return $products_query; + } + + + + /** + * Store a newly created resource in storage by rest. + * + * @param ProductCreateRequest $request + * @return mixed + */ + public function store(ProductCreateRequest $request) + { + return $this->ProductStore($request); + } + + + + /** + * Store a newly created resource in storage by GQL. + * + * @param Request $request + * @return mixed + */ + public function ProductStore(Request $request) + { + try { + // inform_purchased_customer + $setting = $this->settings->first(); + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + return $this->repository->storeProduct($request, $setting); + } else { + throw new AuthorizationException(NOT_AUTHORIZED); + } + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function show(Request $request, $slug) + { + $request->merge(['slug' => $slug]); + try { + $product = $this->fetchSingleProduct($request); + return new GetSingleProductResource($product); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function fetchSingleProduct(Request $request) + { + try { + $slug = $request->slug; + $language = $request->language ?? DEFAULT_LANGUAGE; + $user = $request->user(); + $limit = isset($request->limit) ? $request->limit : 10; + $product = $this->repository->where('language', $language)->where('slug', $slug)->orWhere('id', $slug)->firstOrFail(); + if ( + in_array('variation_options.digital_file', explode(';', $request->with)) || in_array('digital_file', explode(';', $request->with)) + ) { + if (!$this->repository->hasPermission($user, $product->shop_id)) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + } + $related_products = $this->repository->fetchRelated($slug, $limit, $language); + $product->setRelation('related_products', $related_products); + + return $product; + } catch (Exception $e) { + throw new MarvelNotFoundException(); + } + } + + + /** + * Update the specified resource in storage. + * + * @param ProductUpdateRequest $request + * @param int $id + * @return array + */ + public function update(ProductUpdateRequest $request, $id) + { + try { + $request->id = $id; + return $this->updateProduct($request); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + + /** + * updateProduct + * + * @param Request $request + * @return array + */ + public function updateProduct(Request $request) + { + $setting = $this->settings->first(); + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + $id = $request->id; + return $this->repository->updateProduct($request, $id, $setting); + } else { + throw new AuthorizationException(NOT_AUTHORIZED); + } + } + + + /** + * Remove the specified resource from storage. + * + * @param $id + * @return JsonResponse + */ + public function destroy(Request $request, $id) + { + $request->id = $id; + return $this->destroyProduct($request); + } + + + /** + * destroyProduct + * + * @param Request $request + * @return void + */ + public function destroyProduct(Request $request) + { + try { + $product = $this->repository->findOrFail($request->id); + if ($this->repository->hasPermission($request->user(), $product->shop_id)) { + $product->delete(); + return $product; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException($e->getMessage()); + } + } + + + + /** + * relatedProducts + * + * @param Request $request + * @return void + */ + public function relatedProducts(Request $request) + { + $limit = isset($request->limit) ? $request->limit : 10; + $slug = $request->slug; + $language = $request->language ?? DEFAULT_LANGUAGE; + return $this->repository->fetchRelated($slug, $limit, $language); + } + + + + /** + * exportProducts + * + * @param Request $request + * @param mixed $shop_id + * @return void + */ + public function exportProducts(Request $request, $shop_id) + { + + $filename = 'products-for-shop-id-' . $shop_id . '.csv'; + $headers = [ + 'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0', + 'Content-type' => 'text/csv', + 'Content-Disposition' => 'attachment; filename=' . $filename, + 'Expires' => '0', + 'Pragma' => 'public' + ]; + + $list = $this->repository->with([ + 'categories', + 'tags', + ])->where('shop_id', $shop_id)->get()->toArray(); + + if (!count($list)) { + return response()->stream(function () { + // + }, 200, $headers); + } + # add headers for each column in the CSV download + array_unshift($list, array_keys($list[0])); + + $callback = function () use ($list) { + $FH = fopen('php://output', 'w'); + foreach ($list as $key => $row) { + if ($key === 0) { + $exclude = ['id', 'slug', 'deleted_at', 'created_at', 'updated_at', 'shipping_class_id', 'ratings', 'total_reviews', 'my_review', 'in_wishlist', 'rating_count', 'translated_languages', 'sold', 'blocked_dates']; + $row = array_diff($row, $exclude); + } + unset($row['id']); + unset($row['deleted_at']); + unset($row['shipping_class_id']); + unset($row['updated_at']); + unset($row['created_at']); + unset($row['slug']); + unset($row['ratings']); + unset($row['total_reviews']); + unset($row['my_review']); + unset($row['in_wishlist']); + unset($row['rating_count']); + unset($row['translated_languages']); + unset($row['sold']); + unset($row['blocked_dates']); + + if (isset($row['image'])) { + $row['image'] = json_encode($row['image']); + } + if (isset($row['gallery'])) { + $row['gallery'] = json_encode($row['gallery']); + } + if (isset($row['blocked_dates'])) { + $row['blocked_dates'] = json_encode($row['blocked_dates']); + } + if (isset($row['video'])) { + $row['video'] = json_encode($row['video']); + } + if (isset($row['categories'])) { + $categories = collect($row['categories'])->pluck('id')->toArray(); + $row['categories'] = json_encode($categories); + } + if (isset($row['tags'])) { + $tagIds = collect($row['tags'])->pluck('pivot.tag_id')->toArray(); + $row['tags'] = json_encode($tagIds); + } + fputcsv($FH, $row); + } + fclose($FH); + }; + + return response()->stream($callback, 200, $headers); + } + + + + /** + * exportVariableOptions + * + * @param Request $request + * @param mixed $shop_id + * @return void + */ + public function exportVariableOptions(Request $request, $shop_id) + { + $filename = 'variable-options-' . Str::random(5) . '.csv'; + $headers = [ + 'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0', + 'Content-type' => 'text/csv', + 'Content-Disposition' => 'attachment; filename=' . $filename, + 'Expires' => '0', + 'Pragma' => 'public' + ]; + + $products = $this->repository->where('shop_id', $shop_id)->get(); + + $list = Variation::WhereIn('product_id', $products->pluck('id'))->get()->toArray(); + + if (!count($list)) { + return response()->stream(function () { + // + }, 200, $headers); + } + # add headers for each column in the CSV download + array_unshift($list, array_keys($list[0])); + + $callback = function () use ($list) { + $FH = fopen('php://output', 'w'); + foreach ($list as $key => $row) { + if ($key === 0) { + $exclude = ['id', 'created_at', 'updated_at', 'translated_languages']; + $row = array_diff($row, $exclude); + } + unset($row['id']); + unset($row['updated_at']); + unset($row['created_at']); + unset($row['translated_languages']); + if (isset($row['options'])) { + $row['options'] = json_encode($row['options']); + } + if (isset($row['blocked_dates'])) { + $row['blocked_dates'] = json_encode($row['blocked_dates']); + } + fputcsv($FH, $row); + } + fclose($FH); + }; + + return response()->stream($callback, 200, $headers); + } + + + + + /** + * importProducts + * + * @param Request $request + * @return bool + */ + public function importProducts(Request $request) + { + $requestFile = $request->file(); + $user = $request->user(); + $shop_id = $request->shop_id; + + if (count($requestFile)) { + if (isset($requestFile['csv'])) { + $uploadedCsv = $requestFile['csv']; + } else { + $uploadedCsv = current($requestFile); + } + } + + if (!$this->repository->hasPermission($user, $shop_id)) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + if (isset($shop_id)) { + $file = $uploadedCsv->storePubliclyAs('csv-files', 'products-' . $shop_id . '.' . $uploadedCsv->getClientOriginalExtension(), 'public'); + + $products = $this->repository->csvToArray(storage_path() . '/app/public/' . $file); + + foreach ($products as $key => $product) { + if (!isset($product['type_id'])) { + throw new MarvelException("MARVEL_ERROR.WRONG_CSV"); + } + unset($product['id']); + $product['shop_id'] = $shop_id; + $product['image'] = json_decode($product['image'], true); + $product['gallery'] = json_decode($product['gallery'], true); + $product['video'] = json_decode($product['video'], true); + $categoriesId = json_decode($product['categories'], true); + $tagsId = json_decode($product['tags'], true); + try { + $type = Type::findOrFail($product['type_id']); + $authorCacheKey = $product['author_id'] . '_author_id'; + $manufacturerCacheKey = $product['manufacturer_id'] . '_manufacturer_id'; + $product['author_id'] = Cache::remember($authorCacheKey, 30, fn () => Author::find($product['author_id'])?->id); + $product['manufacturer_id'] = Cache::remember($manufacturerCacheKey, 30, fn () => Manufacturer::find($product['manufacturer_id'])?->id); + $dataArray = $this->repository->getProductDataArray(); + $productArray = array_intersect_key($product, array_flip($dataArray)); + if (isset($type->id)) { + $newProduct = Product::FirstOrCreate($productArray); + $categoryCacheKey = $product['categories'] . '_categories'; + $tagCacheKey = $product['tags'] . '_tags'; + $categories = Cache::remember($categoryCacheKey, 30, fn () => Category::whereIn('id', $categoriesId)->get()); + $tags = Cache::remember($tagCacheKey, 30, fn () => Tag::whereIn('id', $tagsId)->get()); + if (!empty($categories)) { + $newProduct->categories()->attach($categories); + } + if (!empty($tags)) { + $newProduct->tags()->attach($tags); + } + } + } catch (Exception $e) { + // + } + } + return true; + } + } + + + + /** + * importVariationOptions + * + * @param Request $request + * @return bool + */ + public function importVariationOptions(Request $request) + { + $requestFile = $request->file(); + $user = $request->user(); + $shop_id = $request->shop_id; + + if (count($requestFile)) { + if (isset($requestFile['csv'])) { + $uploadedCsv = $requestFile['csv']; + } else { + $uploadedCsv = current($requestFile); + } + } else { + throw new MarvelException(CSV_NOT_FOUND); + } + + if (!$this->repository->hasPermission($user, $shop_id)) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + if (isset($user->id)) { + $file = $uploadedCsv->storePubliclyAs('csv-files', 'variation-options-' . Str::random(5) . '.' . $uploadedCsv->getClientOriginalExtension(), 'public'); + + $attributes = $this->repository->csvToArray(storage_path() . '/app/public/' . $file); + + foreach ($attributes as $key => $attribute) { + if (!isset($attribute['title']) || !isset($attribute['price'])) { + throw new MarvelException("MARVEL_ERROR.WRONG_CSV"); + } + unset($attribute['id']); + $attribute['options'] = json_decode($attribute['options'], true); + try { + $product = Type::findOrFail($attribute['product_id']); + if (isset($product->id)) { + Variation::firstOrCreate($attribute); + } + } catch (Exception $e) { + // + } + } + return true; + } + } + + + + /** + * fetchDigitalFilesForProduct + * + * @param Request $request + * @return void + */ + public function fetchDigitalFilesForProduct(Request $request) + { + $user = $request->user(); + if ($user) { + $product = $this->repository->with(['digital_file'])->findOrFail($request->parent_id); + if ($this->repository->hasPermission($user, $product->shop_id)) { + return $product->digital_file; + } + } + } + + + + /** + * fetchDigitalFilesForVariation + * + * @param Request $request + * @return void + */ + public function fetchDigitalFilesForVariation(Request $request) + { + $user = $request->user(); + if ($user) { + $variation_option = Variation::with(['digital_file', 'product'])->findOrFail($request->parent_id); + if ($this->repository->hasPermission($user, $variation_option->product->shop_id)) { + return $variation_option->digital_file; + } + } + } + + + + /** + * bestSellingProducts + * + * @param Request $request + * @return void + */ + + public function bestSellingProducts(Request $request) + { + return $this->repository->getBestSellingProducts($request); + } + + + + /** + * popularProducts + * + * @param Request $request + * @return object + */ + public function popularProducts(Request $request) + { + $limit = $request->limit ? $request->limit : 10; + $language = $request->language ?? DEFAULT_LANGUAGE; + $range = !empty($request->range) && $request->range !== 'undefined' ? $request->range : ''; + $type_id = $request->type_id ? $request->type_id : ''; + if (isset($request->type_slug) && empty($type_id)) { + try { + $type = Type::where('slug', $request->type_slug)->where('language', $language)->firstOrFail(); + $type_id = $type->id; + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + $products_query = $this->repository->withCount('orders')->with(['type', 'shop'])->orderBy('orders_count', 'desc')->where('language', $language); + if (isset($request->shop_id)) { + $products_query = $products_query->where('shop_id', "=", $request->shop_id); + } + if ($range) { + $products_query = $products_query->whereDate('created_at', '>', Carbon::now()->subDays($range)); + } + if ($type_id) { + $products_query = $products_query->where('type_id', '=', $type_id); + } + return $products_query->take($limit)->get(); + } + + + + /** + * calculateRentalPrice + * + * @param Request $request + * @return void + */ + public function calculateRentalPrice(Request $request) + { + $isAvailable = true; + $product_id = $request->product_id; + try { + $product = Product::findOrFail($product_id); + } catch (MarvelException $th) { + throw new MarvelException(NOT_FOUND); + } + if (!$product->is_rental) { + throw new MarvelException(NOT_A_RENTAL_PRODUCT); + } + $variation_id = $request->variation_id; + $quantity = $request->quantity; + $persons = $request->persons; + $dropoff_location_id = $request->dropoff_location_id; + $pickup_location_id = $request->pickup_location_id; + $deposits = $request->deposits; + $features = $request->features; + $from = $request->from; + $to = $request->to; + if ($variation_id) { + $blockedDates = $this->repository->fetchBlockedDatesForAVariationInRange($from, $to, $variation_id); + $isAvailable = $this->repository->isVariationAvailableAt($from, $to, $variation_id, $blockedDates, $quantity); + if (!$isAvailable) { + throw new marvelException(NOT_AVAILABLE_FOR_BOOKING); + } + } else { + $blockedDates = $this->repository->fetchBlockedDatesForAProductInRange($from, $to, $product_id); + $isAvailable = $this->repository->isProductAvailableAt($from, $to, $product_id, $blockedDates, $quantity); + if (!$isAvailable) { + throw new marvelException(NOT_AVAILABLE_FOR_BOOKING); + } + } + + $from = Carbon::parse($from); + $to = Carbon::parse($to); + + $bookedDay = $from->diffInDays($to); + + return $this->repository->calculatePrice($bookedDay, $product_id, $variation_id, $quantity, $persons, $dropoff_location_id, $pickup_location_id, $deposits, $features); + } + + + + /** + * myWishlists + * + * @param Request $request + * @return void + */ + public function myWishlists(Request $request) + { + $limit = $request->limit ? $request->limit : 10; + return $this->fetchWishlists($request)->paginate($limit); + } + + + + /** + * fetchWishlists + * + * @param Request $request + * @return object + */ + public function fetchWishlists(Request $request) + { + $user = $request->user(); + $wishlist = Wishlist::where('user_id', $user->id)->pluck('product_id'); + return $this->repository->whereIn('id', $wishlist); + } + + + /** + * draftedProducts + * + * @param Request $request + * @return void + */ + public function draftedProducts(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + + return $this->fetchDraftedProducts($request)->paginate($limit); + } + + /** + * fetchDraftedProducts + * + * @param Request $request + * @return mixed + */ + public function fetchDraftedProducts(Request $request) + { + $user = $request->user() ?? null;; + $language = $request->language ? $request->language : DEFAULT_LANGUAGE; + + $products_query = $this->repository->with(['type', 'shop'])->where('language', $language); + + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + return $products_query->whereIn('shop_id', $user->shops->pluck('id')); + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + if (isset($request->shop_id)) { + return $products_query->where('shop_id', '=', $request->shop_id); + } else { + return $products_query->whereIn('shop_id', $user->shops->pluck('id')); + } + break; + + case $user->hasPermissionTo(Permission::STAFF): + if (isset($request->shop_id)) { + return $products_query->where('shop_id', '=', $request->shop_id); + } else { + return $products_query->where('shop_id', $user->managed_shop->id); + } + break; + } + + return $products_query; + } + + /** + * productStock + * + * @param Request $request + * @return void + */ + public function productStock(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + + return $this->fetchProductStock($request)->paginate($limit); + } + + /** + * productStock + * + * @param Request $request + * @return mixed + */ + public function fetchProductStock(Request $request) + { + $user = $request->user(); + $language = $request->language ? $request->language : DEFAULT_LANGUAGE; + + $products_query = $this->repository->with(['type', 'shop'])->where('language', $language)->where('quantity', '<', 10); + + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + if (isset($request->shop_id)) { + return $products_query->where('shop_id', '=', $request->shop_id); + } else { + return $products_query; + } + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + if (isset($request->shop_id)) { + // shop specific + return $products_query->where('shop_id', '=', $request->shop_id); + } else { + // overall shops + return $products_query->whereIn('shop_id', $user->shops->pluck('id')); + } + break; + + case $user->hasPermissionTo(Permission::STAFF): + if (isset($request->shop_id)) { + return $products_query->where('shop_id', '=', $request->shop_id); + } else { + return $products_query->where('shop_id', '=', null); + } + break; + + default: + return $products_query->where('shop_id', '=', null); + + break; + } + + return $products_query; + } +} diff --git a/packages/marvel/src/Http/Controllers/ProfileController.php b/packages/marvel/src/Http/Controllers/ProfileController.php new file mode 100644 index 0000000..5237e97 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/ProfileController.php @@ -0,0 +1,94 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Profile + */ + public function index(Request $request) + { + return $this->repository->with('customer')->all(); + } + + /** + * Store a newly created resource in storage. + * + * @param ProfileRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(ProfileRequest $request) + { + $validatedData = $request->all(); + return $this->repository->create($validatedData); + } + + /** + * Display the specified resource. + * + * @param $id + * @return JsonResponse + */ + public function show($id) + { + try { + return $this->repository->with('customer')->findOrFail($id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param ProfileRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(ProfileRequest $request, $id) + { + try { + $validatedData = $request->all(); + return $this->repository->findOrFail($id)->update($validatedData); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/QuestionController.php b/packages/marvel/src/Http/Controllers/QuestionController.php new file mode 100644 index 0000000..748724e --- /dev/null +++ b/packages/marvel/src/Http/Controllers/QuestionController.php @@ -0,0 +1,145 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Question[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + $productId = $request['product_id']; + + if (isset($productId) && !empty($productId)) { + if (null !== $request->user()) { + $request->user()->id; + } + return $this->repository->where([ + ['product_id', '=', $productId], + ['answer', '!=', null] + ])->paginate($limit); + } + if (isset($request['answer']) && $request['answer'] === 'null') { + return $this->repository->paginate($limit); + } + return $this->repository->where('answer', '!=', null)->paginate($limit); + } + + /** + * Store a newly created resource in storage. + * + * @param QuestionCreateRequest $request + * @return mixed + * @throws Exception + */ + public function store(QuestionCreateRequest $request): Question + { + try { + $productQuestionCount = $this->repository->where([ + 'product_id' => $request['product_id'], + 'user_id' => $request->user()->id, + 'shop_id' => $request['shop_id'] + ])->count(); + + $settings = Settings::getData(); + $maximumQuestionLimit = isset($settings['options']['maximumQuestionLimit']) ? $settings['options']['maximumQuestionLimit'] : 5; + + if ($maximumQuestionLimit <= $productQuestionCount) { + throw new HttpException(400, MAXIMUM_QUESTION_LIMIT_EXCEEDED); + } + + return $this->repository->storeQuestion($request); + } catch (MarvelException $e) { + throw new MarvelException(MAXIMUM_QUESTION_LIMIT_EXCEEDED); + } + } + + /** + * Display the specified resource. + * + * @param $id + * @return JsonResponse + */ + public function show($id) + { + try { + return $this->repository->findOrFail($id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + public function update(QuestionUpdateRequest $request, $id) + { + $request->id = $id; + return $this->updateQuestion($request, $id); + } + + public function updateQuestion(Request $request) + { + try { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + $id = $request->id; + return $this->repository->updateQuestion($request, $id); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Display a listing of the resource for authenticated user. + * + * @param Request $request + * @return JsonResponse + */ + public function myQuestions(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + + return $this->repository->where('user_id', auth()->user()->id)->with('product')->paginate($limit); + } +} diff --git a/packages/marvel/src/Http/Controllers/RefundController.php b/packages/marvel/src/Http/Controllers/RefundController.php new file mode 100644 index 0000000..fefde2d --- /dev/null +++ b/packages/marvel/src/Http/Controllers/RefundController.php @@ -0,0 +1,212 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Type[] + */ + public function index(Request $request) + { + $limit = $request->limit; + $refunds = $this->fetchRefunds($request)->paginate($limit); + $data = RefundResource::collection($refunds)->response()->getData(true); + return formatAPIResourcePaginate($data); + } + + public function fetchRefunds(Request $request) + { + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + $user = $request->user(); + if (!$user) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + + $orderQuery = $this->repository->whereHas('order', function ($q) use ($language) { + $q->where('language', $language); + }); + + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + if ((!isset($request->shop_id) || $request->shop_id === 'undefined')) { + return $orderQuery->where('id', '!=', null)->where('shop_id', '=', null); + } + return $orderQuery->where('shop_id', '=', $request->shop_id); + break; + + case $this->repository->hasPermission($user, $request->shop_id): + return $orderQuery->where('shop_id', '=', $request->shop_id); + break; + + case $user->hasPermissionTo(Permission::CUSTOMER): + return $orderQuery->where('customer_id', $user->id)->where('shop_id', null); + break; + + default: + return $orderQuery->where('customer_id', $user->id)->where('shop_id', null); + break; + } + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * Store a newly created resource in storage. + * + * @param RefundRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(RefundRequest $request) + { + try { + if (!$request->user()) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + return $this->repository->storeRefund($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Display the specified resource. + * + * @param $id + * @return JsonResponse + */ + public function show($id) + { + try { + $refund = $this->repository->with(['shop', 'order', 'customer', 'refund_policy','refund_reason'])->findOrFail($id); + return new GetSingleRefundResource($refund); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param Request $request + * @param int $id + * @return JsonResponse + */ + public function update(Request $request, $id) + { + try { + $request->merge(['id' => $id]); + return $this->updateRefund($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + public function updateRefund(Request $request) + { + $user = $request->user(); + + if ($this->repository->hasPermission($user)) { + try { + $refund = $this->repository->with(['shop', 'order', 'customer'])->findOrFail($request->id); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + if ($refund->status == RefundStatus::APPROVED) { + throw new HttpException(400, ALREADY_REFUNDED); + } + $this->repository->updateRefund($request, $refund); + if ($request->status == RefundStatus::APPROVED) { + try { + $order = Order::findOrFail($refund->order_id); + foreach ($order->children as $childOrder) { + $balance = Balance::where('shop_id', $childOrder->shop_id)->first(); + $balance->total_earnings = $balance->total_earnings - $childOrder->amount; + $balance->current_balance = $balance->current_balance - $childOrder->amount; + $balance->save(); + } + } catch (Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + $wallet = Wallet::firstOrCreate(['customer_id' => $refund->customer_id]); + $walletPoints = $this->currencyToWalletPoints($refund->amount); + $wallet->total_points = $wallet->total_points + $walletPoints; + $wallet->available_points = $wallet->available_points + $walletPoints; + $wallet->save(); + + // refund approved event + } + return $refund; + } else { + throw new AuthorizationException(NOT_AUTHORIZED); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy(Request $request, $id) + { + try { + $request->merge(['id' => $id]); + return $this->deleteRefund($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + public function deleteRefund(Request $request) + { + try { + $refund = $this->repository->findOrFail($request->id); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + if ($this->repository->hasPermission($request->user())) { + $refund->delete(); + return $refund; + } else { + throw new AuthorizationException(NOT_AUTHORIZED); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/RefundPolicyController.php b/packages/marvel/src/Http/Controllers/RefundPolicyController.php new file mode 100644 index 0000000..c7b4de8 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/RefundPolicyController.php @@ -0,0 +1,157 @@ +limit ? $request->limit : 15; + $refundPolicies = $this->fetchRefundPolicies($request)->paginate($limit); + $data = RefundPolicyResource::collection($refundPolicies)->response()->getData(true); + return formatAPIResourcePaginate($data); + } + + public function fetchRefundPolicies(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + return $this->repository->where('language', $language); + } + + /** + * Store a newly created resource in storage. + * + * @param StoreRefundPolicyRequest $request + * @return mixed + */ + public function store(StoreRefundPolicyRequest $request) + { + try { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + return $this->repository->storeRefundPolicy($request); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function show(Request $request, $slug) + { + try { + $request->merge(['slug' => $slug]); + return $this->fetchRefundPolicy($request); + } catch (MarvelException $th) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function fetchRefundPolicy(Request $request) + { + $slug = $request->slug; + $language = $request->language ?? DEFAULT_LANGUAGE; + try { + return $this->repository->findRefundPolicy($slug, $language); + } catch (Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param UpdateRefundPolicyRequest $request + * @param int $id + * @return array + * @throws Marvel\Exceptions\MarvelException + */ + public function update(UpdateRefundPolicyRequest $request, $id) + { + try { + $request->merge(['id' => $id]); + return $this->updateRefundPolicy($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + public function updateRefundPolicy(Request $request) + { + $slug = $request->id ?? $request->slug; + $language = $request->language ?? DEFAULT_LANGUAGE; + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + try { + $refundPolicy = $this->repository->findRefundPolicy($slug, $language); + return $this->repository->updateRefundPolicy($request, $refundPolicy); + } catch (Exception $e) { + throw new MarvelNotFoundException(NOT_FOUND); + } + } + throw new AuthorizationException(NOT_AUTHORIZED); + } + + /** + * Remove the specified resource from storage. + * + * @param $id + * @return JsonResponse + */ + public function destroy($id, Request $request) + { + try { + $request->merge(['id' => $id]); + return $this->deleteRefundPolicy($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + public function deleteRefundPolicy(Request $request) + { + $slug = $request->id ?? $request->slug; + $language = $request->language ?? DEFAULT_LANGUAGE; + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $refundPolicy = $this->repository->findRefundPolicy($slug, $language); + $refundPolicy->delete(); + return $refundPolicy; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } +} diff --git a/packages/marvel/src/Http/Controllers/RefundReasonController.php b/packages/marvel/src/Http/Controllers/RefundReasonController.php new file mode 100644 index 0000000..208decd --- /dev/null +++ b/packages/marvel/src/Http/Controllers/RefundReasonController.php @@ -0,0 +1,132 @@ +repository = $repository; + } + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Tag[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + return $this->fetchRefundReasons($request)->paginate($limit); + } + + public function fetchRefundReasons(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + return $this->repository->where('language', $language); + } + + /** + * Store a newly created resource in storage. + * + * @param RefundReasonCreateRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(RefundReasonCreateRequest $request) + { + try { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + return $this->repository->storeRefundReason($request); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Display the specified resource. + * + * @param int $id + * @return JsonResponse + */ + public function show(Request $request, $params) + { + + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + if (is_numeric($params)) { + $params = (int) $params; + return $this->repository->where('id', $params)->firstOrFail(); + } + return $this->repository->where('slug', $params)->firstOrFail(); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Update the specified resource in storage. + * + * @param RefundReasonUpdateRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(RefundReasonUpdateRequest $request, $id) + { + try { + $request['id'] = $id; + return $this->refundReasonUpdate($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + public function refundReasonUpdate(Request $request) + { + try { + $item = $this->repository->findOrFail($request->id); + return $this->repository->updateRefundReason($request, $item); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy(Request $request, $id) + { + $request->merge(['id' => $id]); + return $this->deleteRefundReason($request); + } + + public function deleteRefundReason(Request $request) + { + try { + $refundReason = $this->repository->findOrFail($request->id); + $refundReason->delete(); + return $refundReason; + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/ResourceController.php b/packages/marvel/src/Http/Controllers/ResourceController.php new file mode 100644 index 0000000..94155a0 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/ResourceController.php @@ -0,0 +1,103 @@ +repository = $repository; + } + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Resource[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + $language = $request->language ?? DEFAULT_LANGUAGE; + return $this->repository->where('language', $language)->paginate($limit); + } + + /** + * Store a newly created resource in storage. + * + * @param ResourceCreateRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(ResourceCreateRequest $request) + { + $validatedData = $request->validated(); + return $this->repository->create($validatedData); + } + + /** + * Display the specified resource. + * + * @param int $id + * @return JsonResponse + */ + public function show(Request $request, $params) + { + + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + if (is_numeric($params)) { + $params = (int) $params; + return $this->repository->where('id', $params)->firstOrFail(); + } + return $this->repository->where('slug', $params)->where('language', $language)->firstOrFail(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param ResourceUpdateRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(ResourceUpdateRequest $request, $id) + { + try { + $validatedData = $request->validated(); + return $this->repository->findOrFail($id)->update($validatedData); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/ReviewController.php b/packages/marvel/src/Http/Controllers/ReviewController.php new file mode 100644 index 0000000..39d9d42 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/ReviewController.php @@ -0,0 +1,136 @@ +repository = $repository; + $this->settingsRepository = $settingsRepository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Review[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + if (isset($request['product_id']) && !empty($request['product_id'])) { + if (null !== $request->user()) { + $request->user()->id; // need another way to force login + } + return $this->repository->where('product_id', $request['product_id'])->paginate($limit); + } + return $this->repository->paginate($limit); + } + + /** + * Store a newly created resource in storage. + * + * @param ReviewCreateRequest $request + * @return mixed + * @throws Exception + */ + public function store(ReviewCreateRequest $request) + { + $setting = $this->settingsRepository->first(); + $product_id = $request['product_id']; + $order_id = $request['order_id']; + try { + $hasProductInOrder = Order::where('id', $order_id)->whereHas('products', function ($q) use ($product_id) { + $q->where('product_id', $product_id); + })->exists(); + + if (false === $hasProductInOrder) { + throw new ModelNotFoundException(NOT_FOUND); + } + + $user_id = $request->user()->id; + $request['user_id'] = $user_id; + + // check if the review is following conventional system. + if (!empty($setting->options['reviewSystem']['value']) && $setting->options['reviewSystem']['value'] === 'review_single_time') { + + // find out if any review exists or not + if (isset($request['variation_option_id']) && !empty($request['variation_option_id'])) { + $review = $this->repository->where('user_id', $user_id)->where('order_id', $order_id)->where('product_id', $product_id)->where('shop_id', $request['shop_id'])->where('variation_option_id', $request['variation_option_id'])->get(); + } else { + $review = $this->repository->where('user_id', $user_id)->where('order_id', $order_id)->where('product_id', $product_id)->where('shop_id', $request['shop_id'])->get(); + } + + if (count($review)) { + throw new HttpException(400, ALREADY_GIVEN_REVIEW_FOR_THIS_PRODUCT); + } + } + + return $this->repository->storeReview($request); + } catch (MarvelException $e) { + throw new MarvelException(ALREADY_GIVEN_REVIEW_FOR_THIS_PRODUCT); + } + } + + public function show($id) + { + try { + return $this->repository->findOrFail($id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + public function update(ReviewUpdateRequest $request, $id) + { + $request->merge(["id" => $id]); + try { + return $this->updateReview($request); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function updateReview(ReviewUpdateRequest $request) + { + $id = $request->id; + return $this->repository->updateReview($request, $id); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/SettingsController.php b/packages/marvel/src/Http/Controllers/SettingsController.php new file mode 100644 index 0000000..81e1ec8 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/SettingsController.php @@ -0,0 +1,141 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Address[] + */ + public function index(Request $request) + { + $language = $request->language ? $request->language : DEFAULT_LANGUAGE; + + $data = Cache::rememberForever( + 'cached_settings_' . $language, + function () use ($request) { + return $this->repository->getData($request->language); + } + ); + + // Format maintenance start and until data + $maintenanceStart = Carbon::parse($data['options']['maintenance']['start'])->format('F j, Y h:i A'); + $maintenanceUntil = Carbon::parse($data['options']['maintenance']['until'])->format('F j, Y h:i A'); + + $formattedMaintenance = [ + "start" => $maintenanceStart, + "until" => $maintenanceUntil, + ]; + + // Add formatted maintenance data to the existing data + $data['maintenance'] = $formattedMaintenance; + + return $data; + } + + // public function fetchSettings(Request $request) + // { + // $language = $request->language ? $request->language : DEFAULT_LANGUAGE; + // return $this->repository->getData($language); + // } + + /** + * Store a newly created resource in storage. + * + * @param SettingsRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(SettingsRequest $request) + { + $language = $request->language ? $request->language : DEFAULT_LANGUAGE; + $request->merge([ + 'options' => [ + ...$request->options, + ...$this->repository->getApplicationSettings(), + 'server_info' => server_environment_info(), + ] + ]); + + $data = $this->repository->where('language', $request->language)->first(); + + if ($data) { + if (Cache::has('cached_settings_' . $language)) { + Cache::forget('cached_settings_' . $language); + } + $settings = tap($data)->update($request->only(['options'])); + } else { + // Cache::flush(); + $settings = $this->repository->create(['options' => $request['options'], 'language' => $language]); + } + event(new Maintenance($language)); + return $settings; + } + + /** + * Display the specified resource. + * + * @param $id + * @return JsonResponse + */ + public function show($id) + { + try { + return $this->repository->first(); + } catch (\Exception $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param SettingsRequest $request + * @param int $id + * @return JsonResponse + * @throws ValidatorException + */ + public function update(SettingsRequest $request, $id) + { + $settings = $this->repository->first(); + if (isset($settings->id)) { + return $this->repository->update($request->only(['options']), $settings->id); + } else { + return $this->repository->create(['options' => $request['options']]); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return array + */ + public function destroy($id) + { + throw new MarvelException(ACTION_NOT_VALID); + } +} diff --git a/packages/marvel/src/Http/Controllers/ShippingController.php b/packages/marvel/src/Http/Controllers/ShippingController.php new file mode 100644 index 0000000..3ec9326 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/ShippingController.php @@ -0,0 +1,98 @@ +repository = $repository; + } + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return \Illuminate\Database\Eloquent\Collection|Type[] + */ + public function index(Request $request) + { + return $this->repository->all(); + } + + /** + * Store a newly created resource in storage. + * + * @param CreateShippingRequest $request + * @return LengthAwarePaginator|Collection|mixed + * @throws ValidatorException + */ + public function store(CreateShippingRequest $request) + { + try { + $validateData = $request->validated(); + return $this->repository->create($validateData); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * Display the specified resource. + * + * @param int $id + * @return JsonResponse + */ + public function show($id) + { + try { + return $this->repository->findOrFail($id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param CreateShippingRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(UpdateShippingRequest $request, $id) + { + try { + $validateData = $request->validated(); + return $this->repository->findOrFail($id)->update($validateData); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/ShopController.php b/packages/marvel/src/Http/Controllers/ShopController.php new file mode 100644 index 0000000..eb45a78 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/ShopController.php @@ -0,0 +1,455 @@ +repository = $repository; + } + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Shop[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + return $this->fetchShops($request)->paginate($limit)->withQueryString(); + } + + public function fetchShops(Request $request) + { + return $this->repository->withCount(['orders', 'products'])->with(['owner.profile', 'ownership_history'])->where('id', '!=', null); + } + + /** + * Store a newly created resource in storage. + * + * @param ShopCreateRequest $request + * @return mixed + */ + public function store(ShopCreateRequest $request) + { + try { + if ($request->user()->hasPermissionTo(Permission::STORE_OWNER)) { + return $this->repository->storeShop($request); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function show($slug, Request $request) + { + $shop = $this->repository + ->with(['categories', 'owner', 'ownership_history']) + ->withCount(['orders', 'products']); + if ($request->user() && ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN) || $request->user()->shops->contains('slug', $slug))) { + $shop = $shop->with('balance'); + } + try { + return match (true) { + is_numeric($slug) => $shop->where('id', $slug)->firstOrFail(), + is_string($slug) => $shop->where('slug', $slug)->firstOrFail(), + }; + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param ShopUpdateRequest $request + * @param int $id + * @return array + */ + public function update(ShopUpdateRequest $request, $id) + { + try { + $request->id = $id; + return $this->updateShop($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + public function updateShop(Request $request) + { + $id = $request->id; + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN) || ($request->user()->hasPermissionTo(Permission::STORE_OWNER) && ($request->user()->shops->contains($id)))) { + return $this->repository->updateShop($request, $id); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } + + public function shopMaintenanceEvent(Request $request) { + try { + $id = $request->shop_id; + return $this->repository->maintenanceShopEvent($request, $id); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE); + } + } + + /** + * Remove the specified resource from storage. + * + * @param $id + * @return JsonResponse + */ + public function destroy(Request $request, $id) + { + try { + $request->id = $id; + return $this->deleteShop($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + public function deleteShop(Request $request) + { + $id = $request->id; + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN) || ($request->user()->hasPermissionTo(Permission::STORE_OWNER) && ($request->user()->shops->contains($id)))) { + try { + $shop = $this->repository->findOrFail($id); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + $shop->delete(); + return $shop; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } + + public function approveShop(Request $request) + { + + try { + if (!$request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + throw new MarvelException(NOT_AUTHORIZED); + } + $id = $request->id; + $admin_commission_rate = $request->admin_commission_rate; + try { + $shop = $this->repository->findOrFail($id); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + $shop->is_active = true; + $shop->save(); + + if (Product::count() > 0) { + Product::where('shop_id', '=', $id)->update(['status' => 'publish']); + } + + $balance = Balance::firstOrNew(['shop_id' => $id]); + + if (!$request->isCustomCommission) { + $adminCommissionDefaultRate = $this->getCommissionRate($balance->total_earnings); + $balance->admin_commission_rate = $adminCommissionDefaultRate; + }else{ + $balance->admin_commission_rate = $admin_commission_rate; + } + $balance->is_custom_commission = $request->isCustomCommission; + $balance->save(); + return $shop; + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function disApproveShop(Request $request) + { + try { + if (!$request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + throw new MarvelException(NOT_AUTHORIZED); + } + $id = $request->id; + try { + $shop = $this->repository->findOrFail($id); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + + $shop->is_active = false; + $shop->save(); + + Product::where('shop_id', '=', $id)->update(['status' => 'draft']); + + return $shop; + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function addStaff(UserCreateRequest $request) + { + try { + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + $permissions = [Permission::CUSTOMER, Permission::STAFF]; + $user = User::create([ + 'name' => $request->name, + 'email' => $request->email, + 'shop_id' => $request->shop_id, + 'password' => Hash::make($request->password), + ]); + + $user->givePermissionTo($permissions); + $user->assignRole(Role::STAFF); + + return true; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function deleteStaff(Request $request, $id) + { + try { + $request->id = $id; + return $this->removeStaff($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + public function removeStaff(Request $request) + { + $id = $request->id; + try { + $staff = User::findOrFail($id); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + if ($request->user()->hasPermissionTo(Permission::STORE_OWNER) || ($request->user()->hasPermissionTo(Permission::STORE_OWNER) && ($request->user()->shops->contains('id', $staff->shop_id)))) { + $staff->delete(); + return $staff; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } + + public function myShops(Request $request) + { + $user = $request->user(); + return $this->repository->where('owner_id', '=', $user->id)->get(); + } + + + /** + * Popular products by followed shops + * + * @param Request $request + * @return array + * @throws MarvelException + */ + public function followedShopsPopularProducts(Request $request) + { + $request->validate([ + 'limit' => 'numeric', + ]); + + try { + $user = $request->user(); + $userShops = User::where('id', $user->id)->with('follow_shops')->get(); + $followedShopIds = $userShops->first()->follow_shops->pluck('id')->all(); + $limit = $request->limit ? $request->limit : 10; + + $products_query = Product::withCount('orders')->with(['shop'])->whereIn('shop_id', $followedShopIds)->orderBy('orders_count', 'desc'); + + return $products_query->take($limit)->get(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Get all the followed shops of logged-in user + * + * @param Request $request + * @return mixed + */ + public function userFollowedShops(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + $user = $request->user(); + $currentUser = User::where('id', $user->id)->first(); + + return $currentUser->follow_shops()->paginate($limit); + } + + /** + * Get boolean response of a shop follow/unfollow status + * + * @param Request $request + * @return bool + * @throws MarvelException + */ + public function userFollowedShop(Request $request) + { + $request->validate([ + 'shop_id' => 'required|numeric', + ]); + + try { + $user = $request->user(); + $userShops = User::where('id', $user->id)->with('follow_shops')->get(); + $followedShopIds = $userShops->first()->follow_shops->pluck('id')->all(); + + $shop_id = (int)$request->input('shop_id'); + + return in_array($shop_id, $followedShopIds); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Follow/Unfollow shop + * + * @param Request $request + * @return bool + * @throws MarvelException + */ + public function handleFollowShop(Request $request) + { + $request->validate([ + 'shop_id' => 'required|numeric', + ]); + + try { + $user = $request->user(); + $userShops = User::where('id', $user->id)->with('follow_shops')->get(); + $followedShopIds = $userShops->first()->follow_shops->pluck('id')->all(); + + $shop_id = (int)$request->input('shop_id'); + + if (in_array($shop_id, $followedShopIds)) { + $followedShopIds = array_diff($followedShopIds, [$shop_id]); + } else { + $followedShopIds[] = $shop_id; + } + + $response = $user->follow_shops()->sync($followedShopIds); + + if (count($response['attached'])) { + return true; + } + + if (count($response['detached'])) { + return false; + } + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + public function nearByShop($lat, $lng, Request $request) + { + $request['lat'] = $lat; + $request['lng'] = $lng; + + return $this->findShopDistance($request); + } + + public function findShopDistance(Request $request) + { + try { + $settings = Settings::getData(); + $maxShopDistance = isset($settings['options']['maxShopDistance']) ? $settings['options']['maxShopDistance'] : 1000; + $lat = $request->lat; + $lng = $request->lng; + if (!is_numeric($lat) || !is_numeric($lng)) { + throw new HttpException(400, 'invalid argument'); + } + + $near_shop = Shop::where('settings->location->lat', '!=', null) + ->where('settings->location->lng', '!=', null) + ->select( + "shops.*", + DB::raw("6371 * acos(cos(radians(" . $lat . ")) + * cos(radians(json_unquote(json_extract(`shops`.`settings`, '$.\"location\".\"lat\"')))) + * cos(radians(json_unquote(json_extract(`shops`.`settings`, '$.\"location\".\"lng\"'))) - radians(" . $lng . ")) + + sin(radians(" . $lat . ")) + * sin(radians(json_unquote(json_extract(`shops`.`settings`, '$.\"location\".\"lat\"'))))) AS distance") + ) + ->orderBy('distance', 'ASC') + ->where('is_active', 1) + ->get() + ->where('distance', '<', $maxShopDistance); + + return $near_shop; + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * newOrInActiveShops + * + * @param Request $request + * @return Collection|Shop[] + */ + public function newOrInActiveShops(Request $request) + { + try { + $limit = $request->limit ? $request->limit : 15; + return $this->repository->withCount(['orders', 'products'])->with(['owner.profile'])->where('is_active', '=', $request->is_active)->paginate($limit)->withQueryString(); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + /** + * transferShopOwnership + * + */ + public function transferShopOwnership(TransferShopOwnerShipRequest $request) + { + try { + return DB::transaction(fn () => $this->repository->transferShopOwnership($request)); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/StoreNoticeController.php b/packages/marvel/src/Http/Controllers/StoreNoticeController.php new file mode 100644 index 0000000..6a90872 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/StoreNoticeController.php @@ -0,0 +1,234 @@ +repository = $repository; + $this->repositoryPivot = $repositoryPivot; + } + + + /** + * @param Request $request + * @return LengthAwarePaginator|Collection|mixed + */ + public function index(Request $request) + { + try { + $limit = $request->limit ? $request->limit : 15; + $storeNotices = $this->fetchStoreNotices($request)->paginate($limit); + $data = StoreNoticeResource::collection($storeNotices)->response()->getData(true); + return formatAPIResourcePaginate($data); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG, $th->getMessage()); + } + } + + /** + * @param Request $request + * @return StoreNoticeRepository + * @throws MarvelException + */ + public function fetchStoreNotices(Request $request) + { + return $this->repository->whereNotNull('id'); + } + + /** + * Store a newly created resource in storage. + * + * @param StoreNoticeRequest $request + * @return LengthAwarePaginator|Collection|mixed + * @throws ValidatorException + */ + public function store(StoreNoticeRequest $request) + { + try { + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN) || $this->repository->hasPermission($request->user(), $request->received_by[0] ?? 0)) { + return $this->repository->saveStoreNotice($request); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * @param Request $request + * @return array|array[] + */ + public function getStoreNoticeType(Request $request) + { + return $this->repository->fetchStoreNoticeType($request); + } + + /** + * This method will generate User list or Shop list based on requested user permission + * @param Request $request + * @return \Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection + * @throws MarvelException + */ + public function getUsersToNotify(Request $request) + { + $typeArr = array(StoreNoticeType::ALL_SHOP, StoreNoticeType::ALL_VENDOR); + if (in_array($request->type, $typeArr)) { + throw new HttpException(400, ACTION_NOT_VALID); + } + return $this->repository->fetchUserToSendNotification($request); + } + + /** + * Display the specified resource. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @throws MarvelException + */ + public function show(Request $request, $id) + { + try { + $storeNotice = $this->repository->findOrFail($id); + // return $storeNotice; + return new GetSingleStoreNoticeResource($storeNotice); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * Update the specified resource in storage. + * + * @param StoreNoticeUpdateRequest $request + * @param $id + * @return StoreNotice + * @throws MarvelException + */ + public function update(StoreNoticeUpdateRequest $request, $id) + { + try { + $request['id'] = $id; + return $this->updateStoreNotice($request); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * Update the specified resource in storage. + * + * @param Request $request + * @return StoreNotice + * @throws MarvelException + */ + public function updateStoreNotice(Request $request) + { + $id = $request->id; + try { + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN) || $this->repository->hasPermission($request->user(), $request->received_by[0] ?? 0)) { + $storeNotice = $this->repository->findOrFail($id); + return $this->repository->updateStoreNotice($request, $storeNotice); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (Exception $e) { + throw new HttpException(400, COULD_NOT_DELETE_THE_RESOURCE); + } + } + + /** + * Remove the specified resource from storage. + * @param Request $request + * @param $id + * @return bool + * @throws MarvelException + */ + public function destroy(Request $request, $id) + { + + try { + $request['id'] = $id ?? 0; + return $this->deleteStoreNotice($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + /** + * Remove the specified resource from storage. + * @param Request $request + * @return mixed + * @throws MarvelException + */ + public function deleteStoreNotice(Request $request) + { + try { + $id = $request->id; + return $this->repository->findOrFail($id)->forceDelete(); + } catch (Exception $e) { + throw new HttpException(400, COULD_NOT_DELETE_THE_RESOURCE); + } + } + + /** + * Update the specified resource in storage. + * This method will update read_status of a single StoreNotice for requested user { id in requestBody }. + * @param Request $request + * @return JsonResponse|null + * @throws MarvelException + */ + public function readNotice(Request $request) + { + try { + $request->validate([ + 'id' => 'required|exists:Marvel\Database\Models\StoreNotice,id' + ]); + return $this->repositoryPivot->readSingleNotice($request); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * Update or Store resources in storage. + * This method will update read_status of a multiple StoreNotice for requested user { array of id in requestBody }. + * @param Request $request + * @return JsonResponse|null + * @throws MarvelException + */ + public function readAllNotice(Request $request) + { + try { + $request->validate([ + 'notices' => 'required|array|min:1', + 'notices.*' => 'exists:Marvel\Database\Models\StoreNotice,id', + ]); + return $this->repositoryPivot->readAllNotice($request); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/TagController.php b/packages/marvel/src/Http/Controllers/TagController.php new file mode 100644 index 0000000..e991247 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/TagController.php @@ -0,0 +1,123 @@ +repository = $repository; + } + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Tag[] + */ + public function index(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + $limit = $request->limit ? $request->limit : 15; + $tags = $this->repository->where('language', $language)->with(['type'])->paginate($limit); + $data = TagResource::collection($tags)->response()->getData(true); + return formatAPIResourcePaginate($data); + } + + /** + * Store a newly created resource in storage. + * + * @param TagCreateRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(TagCreateRequest $request) + { + try { + $validatedData = $request->validated(); + $validatedData['slug'] = $this->repository->makeSlug($request); + return $this->repository->create($validatedData); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Display the specified resource. + * + * @param int $id + * @return JsonResponse + */ + public function show(Request $request, $params) + { + + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + if (is_numeric($params)) { + $params = (int) $params; + $tag = $this->repository->where('id', $params)->with(['type'])->firstOrFail(); + return new TagResource($tag); + } + $tag = $this->repository->where('slug', $params)->where('language', $language)->with(['type'])->firstOrFail(); + return new TagResource($tag); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Update the specified resource in storage. + * + * @param TagUpdateRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(TagUpdateRequest $request, $id) + { + try { + $request['id'] = $id; + return $this->tagUpdate($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + public function tagUpdate(Request $request) + { + try { + $tag = $this->repository->findOrFail($request->id); + return $this->repository->updateTag($request, $tag); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/TaxController.php b/packages/marvel/src/Http/Controllers/TaxController.php new file mode 100644 index 0000000..a2d3149 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/TaxController.php @@ -0,0 +1,94 @@ +repository = $repository; + } + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return \Illuminate\Database\Eloquent\Collection|Type[] + */ + public function index(Request $request) + { + return $this->repository->all(); + } + + /** + * Store a newly created resource in storage. + * + * @param CreateTaxRequest $request + * @return LengthAwarePaginator|Collection|mixed + * @throws ValidatorException + */ + public function store(CreateTaxRequest $request) + { + $validateData = $request->validated(); + return $this->repository->create($validateData); + } + + /** + * Display the specified resource. + * + * @param int $id + * @return JsonResponse + */ + public function show($id) + { + try { + return $this->repository->findOrFail($id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param CreateTaxRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(UpdateTaxRequest $request, $id) + { + try { + $validatedData = $request->validated(); + return $this->repository->findOrFail($id)->update($validatedData); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/TermsAndConditionsController.php b/packages/marvel/src/Http/Controllers/TermsAndConditionsController.php new file mode 100644 index 0000000..e6837a5 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/TermsAndConditionsController.php @@ -0,0 +1,229 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|TermsAndConditions[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 10; + // $language = $request->language ?? DEFAULT_LANGUAGE; + $termsAndConditions = $this->fetchTermsAndConditions($request)->paginate($limit)->withQueryString(); + $data = TermsConditionResource::collection($termsAndConditions)->response()->getData(true); + return formatAPIResourcePaginate($data); + } + + public function fetchTermsAndConditions(Request $request) + { + + try { + $user = $request->user(); + $language = $request->language ?? DEFAULT_LANGUAGE; + + // if statement is for role base authorized scenerio + // else statment is for global viewers level guest scenerio + + if (isset($user)) { + switch ($user) { + case $user->hasPermissionTo(Permission::SUPER_ADMIN): + return $this->repository->with('shop')->where('language', $language); + break; + + case $user->hasPermissionTo(Permission::STORE_OWNER): + if ($this->repository->hasPermission($user, $request->shop_id)) { + return $this->repository->with('shop')->where('shop_id', '=', $request->shop_id)->where('language', $language); + } else { + return $this->repository->with('shop')->where('user_id', '=', $user->id)->where('language', $language)->whereIn('shop_id', $user->shops->pluck('id')); + } + break; + + case $user->hasPermissionTo(Permission::STAFF): + if ($this->repository->hasPermission($user, $request->shop_id)) { + return $this->repository->with('shop')->where('shop_id', '=', $request->shop_id)->where('language', $language); + } + break; + + default: + return $this->repository->with('shop')->where('language', $language)->where('is_approved', '=', true); + break; + } + } else { + if ($request->shop_id) { + return $this->repository->with('shop')->where('shop_id', '=', $request->shop_id)->where('is_approved', '=', true)->where('language', $language); + } else { + return $this->repository->with('shop')->where('is_approved', '=', true)->where('language', $language); + } + } + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG, $e->getMessage()); + } + } + + /** + * Store a newly created termsAndConditions in storage. + * + * @param CreateTermsAndConditionsRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(CreateTermsAndConditionsRequest $request) + { + try { + return $this->repository->storeTermsAndConditions($request); + // return $this->repository->create($validatedData); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE, $e->getMessage()); + } + } + + /** + * Display the specified termsAndConditions. + * + * @param $id + * @return JsonResponse + */ + public function show(Request $request, $slug) + { + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + $termsAndCondition = $this->repository->with('shop')->where('language', $language)->where('slug', '=', $slug)->first(); + return new TermsConditionResource($termsAndCondition); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND, $e->getMessage()); + } + } + + /** + * Update the specified terms and conditions + * + * @param UpdateTermsAndConditionsRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(UpdateTermsAndConditionsRequest $request, $id) + { + try { + $request["id"] = $id; + return $this->updateTermsAndConditions($request); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_UPDATE_THE_RESOURCE, $e->getMessage()); + } + } + + /** + * updateTermsAndConditions + * + * @param UpdateTermsAndConditionsRequest $request + * @return void + */ + public function updateTermsAndConditions(UpdateTermsAndConditionsRequest $request) + { + $termsAndConditions = $this->repository->findOrFail($request['id']); + return $this->repository->updateTermsAndConditions($request, $termsAndConditions); + } + + /** + * Remove the specified terms and conditions + * + * @param int $id + * @param Request $request + * @return JsonResponse + */ + public function destroy($id, Request $request) + { + $request->merge(['id' => $id]); + return $this->deleteTermsConditions($request); + } + + public function deleteTermsConditions(Request $request) + { + try { + $user = $request->user(); + if ($user && ($user->hasPermissionTo(Permission::SUPER_ADMIN) || $user->hasPermissionTo(Permission::STORE_OWNER) || $user->hasPermissionTo(Permission::STAFF))) { + return $this->repository->findOrFail($request->id)->delete(); + } + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND, $e->getMessage()); + } + } + + /** + * approveTerm + * + * @param Request $request + * @return void + */ + public function approveTerm(Request $request) + { + try { + if (!$request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + throw new MarvelException(NOT_AUTHORIZED); + } + $id = $request->id; + try { + $term = $this->repository->findOrFail($id); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + $term->is_approved = true; + $term->save(); + return $term; + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * disApproveTerm + * + * @param Request $request + * @return void + */ + public function disApproveTerm(Request $request) + { + try { + if (!$request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + throw new MarvelException(NOT_AUTHORIZED); + } + $id = $request->id; + try { + $term = $this->repository->findOrFail($id); + } catch (\Exception $e) { + throw new ModelNotFoundException(NOT_FOUND); + } + + $term->is_approved = false; + $term->save(); + return $term; + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/TypeController.php b/packages/marvel/src/Http/Controllers/TypeController.php new file mode 100644 index 0000000..be83111 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/TypeController.php @@ -0,0 +1,118 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Type[] + */ + public function index(Request $request) + { + $language = $request->language ?? DEFAULT_LANGUAGE; + + $limit = isset($request->limit) ? $request->limit : 10000; + $types = $this->repository->where('language', $language)->paginate($limit); + // $types = $this->repository->where('language', $language)->get(); + return TypeResource::collection($types); + } + + /** + * Store a newly created resource in storage. + * + * @param TypeRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(TypeRequest $request) + { + try { + return $this->repository->storeType($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Display the specified resource. + * + * @param $slug + * @return JsonResponse + */ + public function show(Request $request, $params) + { + + try { + $language = $request->language ?? DEFAULT_LANGUAGE; + if (is_numeric($params)) { + $params = (int) $params; + $type = $this->repository->where('id', $params)->with('banners')->firstOrFail(); + return new TypeResource($type); + } + $type = $this->repository->where('slug', $params)->where('language', $language)->with('banners')->firstOrFail(); + return new TypeResource($type); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param TypeRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(TypeRequest $request, $id) + { + $request->id = $id; + return $this->updateType($request); + } + + public function updateType(TypeRequest $request) + { + try { + $type = $this->repository->with('banners')->findOrFail($request->id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + return $this->repository->updateType($request, $type); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } +} diff --git a/packages/marvel/src/Http/Controllers/UserController.php b/packages/marvel/src/Http/Controllers/UserController.php new file mode 100644 index 0000000..8d9f29a --- /dev/null +++ b/packages/marvel/src/Http/Controllers/UserController.php @@ -0,0 +1,811 @@ +repository = $repository; + $this->applicationIsValid = $this->repository->checkIfApplicationIsValid(); + } + /** + * Validate user email from the link sent to the user. + * @param $id + * @param $hash + * @return RedirectResponse + */ + public function verifyEmail($id, $hash): RedirectResponse + { + $user = User::findOrFail($id); + if (!hash_equals((string) $hash, sha1($user->getEmailForVerification()))) { + abort(403); + } + if ($user->hasVerifiedEmail()) { + if ($user->hasPermissionTo(Permission::SUPER_ADMIN) || $user->hasPermissionTo(Permission::STORE_OWNER)) { + return Redirect::away(config('shop.dashboard_url')); + } else { + return Redirect::away(config('shop.shop_url')); + } + } + $user->markEmailAsVerified(); + if ($user->hasPermissionTo(Permission::SUPER_ADMIN) || $user->hasPermissionTo(Permission::STORE_OWNER)) { + return Redirect::away(config('shop.dashboard_url')); + } else { + return Redirect::away(config('shop.shop_url')); + } + } + /** + * Send the email verification notification. + * + * @return JsonResponse + */ + public function sendVerificationEmail(Request $request): JsonResponse + { + $user = $request->user(); + $user->sendEmailVerificationNotification(); + return response()->json(['message' => 'Email verification link sent on your email id', 'success' => true]); + } + + + /** + * admins + * + * @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection + */ + public function admins(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + $admins = $this->repository + ->with(['profile', 'address', 'permissions']) + ->where('is_active', true) + ->whereHas('permissions', function ($query) { + $query->where('name', Permission::SUPER_ADMIN); + }) + ->paginate($limit); + return $admins; + // return UserResource::collection($admins); + } + + /** + * vendors + * + * @param Request $request + * @return void + */ + public function vendors(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + + return $this->fetchVendors($request)->paginate($limit); + } + + public function fetchVendors(Request $request) + { + $user = $request->user(); + $shopId = $request->shop_id ?? null; + $exclude = is_numeric($request?->exclude) ? $request->exclude : null; + $is_active = $request->is_active === 'true' ? true : false; + $admins = User::permission(Permission::SUPER_ADMIN)->pluck('id')->toArray(); + if ($this->repository->hasPermission($user, $shopId)) { + return $this->repository->permission(Permission::STORE_OWNER) + ->where('is_active', $is_active) + ->whereNotIn('id', $admins) + ->when($exclude, fn ($query) => $query->where('id', '!=', $exclude)); + } + return $this->repository->permission(null); + } + + /** + * customers + * + * @param Request $request + * @return void + */ + public function customers(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + $userWithOtherPermissions = User::permission([Permission::SUPER_ADMIN, Permission::STORE_OWNER, Permission::STAFF])->pluck('id')->toArray(); + return $this->repository->with(['profile', 'address', 'permissions']) + ->permission(Permission::CUSTOMER)->whereNotIn('id', $userWithOtherPermissions)->paginate($limit); + } + + + + /** + * Display a listing of the resource. + * + * @return Response + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + return $this->repository->with(['profile', 'address', 'permissions'])->paginate($limit); + } + + /** + * Store a newly created resource in storage. + *Í + * @param UserCreateRequest $request + * @return bool[] + */ + public function store(UserCreateRequest $request) + { + try { + return $this->repository->storeUser($request); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Display the specified resource. + * + * @param int $id + * @return array + */ + public function show($id) + { + try { + return $this->repository->with(['profile', 'address', 'shops', 'managed_shop'])->findOrFail($id); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + /** + * Update the specified resource in storage. + * + * @param UserUpdateRequest $request + * @param int $id + * @return array + */ + public function update(UserUpdateRequest $request, $id) + { + if ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $user = $this->repository->findOrFail($id); + return $this->repository->updateUser($request, $user); + } elseif ($request->user()->id == $id) { + $user = $request->user(); + return $this->repository->updateUser($request, $user); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return array + */ + public function destroy($id) + { + try { + return $this->repository->findOrFail($id)->delete(); + } catch (MarvelException $e) { + throw new MarvelException(NOT_FOUND); + } + } + + public function me(Request $request) + { + try { + $user = $request->user(); + if (isset($user)) { + return $this->repository + ->with(['profile', 'wallet', 'address', 'shops.balance', 'managed_shop.balance']) + ->find($user->id) + ->loadLastOrder(); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(NOT_AUTHORIZED); + } + } + + public function token(Request $request) + { + $request->validate([ + 'email' => 'required|email', + 'password' => 'required', + ]); + + $user = User::where('email', $request->email)->where('is_active', true)->first(); + + if (!$user || !Hash::check($request->password, $user->password) || !$this->applicationIsValid) { + return ["token" => null, "permissions" => []]; + } + $email_verified = $user->hasVerifiedEmail(); + event(new ProcessUserData()); + return [ + "token" => $user->createToken('auth_token')->plainTextToken, + "permissions" => $user->getPermissionNames(), + "email_verified" => $email_verified, + "role" => $user->getRoleNames()->first() + ]; + } + + public function logout(Request $request) + { + $user = $request->user(); + if (!$user) { + return true; + } + return $request->user()->currentAccessToken()->delete(); + } + + public function register(UserCreateRequest $request) + { + $notAllowedPermissions = [Permission::SUPER_ADMIN]; + if ((isset($request->permission->value) && in_array($request->permission->value, $notAllowedPermissions)) || (isset($request->permission) && in_array($request->permission, $notAllowedPermissions))) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + $permissions = [Permission::CUSTOMER]; + $role = Role::CUSTOMER; + if (isset($request->permission)) { + $permissions[] = isset($request->permission->value) ? $request->permission->value : $request->permission; + $role = Role::STORE_OWNER; + } + $user = $this->repository->create([ + 'name' => $request->name, + 'email' => $request->email, + 'password' => Hash::make($request->password), + ]); + + $user->givePermissionTo($permissions); + $user->assignRole($role); + $this->giveSignupPointsToCustomer($user->id); + $setting = Settings::first(); + $useMustVerifyEmail = isset($setting->options['useMustVerifyEmail']) ? $setting->options['useMustVerifyEmail'] : false; + if ($useMustVerifyEmail) { + event(new Registered($user)); + } + event(new ProcessUserData()); + return [ + "token" => $user->createToken('auth_token')->plainTextToken, + "permissions" => $user->getPermissionNames(), + "role" => $user->getRoleNames()->first() + ]; + } + + public function banUser(Request $request) + { + try { + $user = $request->user(); + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN) && $user->id != $request->id) { + $banUser = User::find($request->id); + $banUser->is_active = false; + $banUser->save(); + $this->inactiveUserShops($banUser->id); + return $banUser; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + function inactiveUserShops($userId) + { + $shops = Shop::where('owner_id', $userId)->get(); + foreach ($shops as $shop) { + $shop->is_active = false; + $shop->save(); + Product::where('shop_id', '=', $shop->id)->update(['status' => 'draft']); + } + } + + public function activeUser(Request $request) + { + try { + $user = $request->user(); + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN) && $user->id != $request->id) { + $activeUser = User::find($request->id); + $activeUser->is_active = true; + $activeUser->save(); + return $activeUser; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function forgetPassword(Request $request) + { + $user = $this->repository->findByField('email', $request->email); + if (count($user) < 1) { + return ['message' => NOT_FOUND, 'success' => false]; + } + $tokenData = DB::table('password_resets') + ->where('email', $request->email)->first(); + if (!$tokenData) { + DB::table('password_resets')->insert([ + 'email' => $request->email, + 'token' => Str::random(16), + 'created_at' => Carbon::now() + ]); + $tokenData = DB::table('password_resets') + ->where('email', $request->email)->first(); + } + + if ($this->repository->sendResetEmail($request->email, $tokenData->token)) { + return ['message' => CHECK_INBOX_FOR_PASSWORD_RESET_EMAIL, 'success' => true]; + } else { + return ['message' => SOMETHING_WENT_WRONG, 'success' => false]; + } + } + public function verifyForgetPasswordToken(Request $request) + { + $tokenData = DB::table('password_resets')->where('token', $request->token)->first(); + if (!$tokenData) { + return ['message' => INVALID_TOKEN, 'success' => false]; + } + $user = $this->repository->findByField('email', $request->email); + if (count($user) < 1) { + return ['message' => NOT_FOUND, 'success' => false]; + } + return ['message' => TOKEN_IS_VALID, 'success' => true]; + } + public function resetPassword(Request $request) + { + try { + $request->validate([ + 'password' => 'required|string', + 'email' => 'email|required', + 'token' => 'required|string' + ]); + + $user = $this->repository->where('email', $request->email)->first(); + $user->password = Hash::make($request->password); + $user->save(); + + DB::table('password_resets')->where('email', $user->email)->delete(); + + return ['message' => PASSWORD_RESET_SUCCESSFUL, 'success' => true]; + } catch (\Exception $th) { + return ['message' => SOMETHING_WENT_WRONG, 'success' => false]; + } + } + + public function changePassword(ChangePasswordRequest $request) + { + try { + $user = $request->user(); + if (Hash::check($request->oldPassword, $user->password)) { + $user->password = Hash::make($request->newPassword); + $user->save(); + return ['message' => PASSWORD_RESET_SUCCESSFUL, 'success' => true]; + } else { + return ['message' => OLD_PASSWORD_INCORRECT, 'success' => false]; + } + } catch (\Exception $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + public function contactAdmin(Request $request) + { + try { + $listedAdmin = []; + $admins = $this->getAdminUsers(); + if (isset($admins)) { + foreach ($admins as $key => $admin) { + array_push($listedAdmin, $admin->email); + } + } + $details = $request->only('subject', 'name', 'email', 'description'); + // config('shop.admin_email') + $emailTo = isset($request['emailTo']) ? $request['emailTo'] : $listedAdmin; + Mail::to($emailTo)->send(new ContactAdmin($details)); + return ['message' => EMAIL_SENT_SUCCESSFUL, 'success' => true]; + } catch (\Exception $e) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function fetchStaff(Request $request) + { + try { + if (!isset($request->shop_id)) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + if ($this->repository->hasPermission($request->user(), $request->shop_id)) { + return $this->repository->with(['profile'])->where('shop_id', '=', $request->shop_id); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + public function staffs(Request $request) + { + $query = $this->fetchStaff($request); + $limit = $request->limit ?? 15; + return $query->paginate($limit); + } + + public function socialLogin(Request $request) + { + $provider = $request->provider; + $token = $request->access_token; + $this->validateProvider($provider); + + try { + $user = Socialite::driver($provider)->userFromToken($token); + $userExist = User::where('email', $user->email)->exists(); + + $userCreated = User::firstOrCreate( + [ + 'email' => $user->getEmail() + ], + [ + 'email_verified_at' => now(), + 'name' => $user->getName(), + ] + ); + + $userCreated->providers()->updateOrCreate( + [ + 'provider' => $provider, + 'provider_user_id' => $user->getId(), + ] + ); + + $avatar = [ + 'thumbnail' => $user->getAvatar(), + 'original' => $user->getAvatar(), + ]; + + $userCreated->profile()->updateOrCreate( + [ + 'avatar' => $avatar + ] + ); + + if (!$userCreated->hasPermissionTo(Permission::CUSTOMER)) { + $userCreated->givePermissionTo(Permission::CUSTOMER); + $userCreated->assignRole(Role::CUSTOMER); + } + + if (empty($userExist)) { + $this->giveSignupPointsToCustomer($userCreated->id); + } + event(new ProcessUserData()); + return [ + "token" => $userCreated->createToken('auth_token')->plainTextToken, + "permissions" => $userCreated->getPermissionNames(), + "role" => $userCreated->getRoleNames()->first() + ]; + } catch (\Exception $e) { + throw new MarvelException(INVALID_CREDENTIALS); + } + } + + protected function validateProvider($provider) + { + if (!in_array($provider, ['facebook', 'google'])) { + throw new MarvelException(PLEASE_LOGIN_USING_FACEBOOK_OR_GOOGLE); + } + } + + protected function getOtpGateway() + { + $gateway = config('auth.active_otp_gateway'); + $gateWayClass = "Marvel\\Otp\\Gateways\\" . ucfirst($gateway) . 'Gateway'; + return new OtpGateway(new $gateWayClass()); + } + + protected function verifyOtp(Request $request) + { + $id = $request->otp_id; + $code = $request->code; + $phoneNumber = $request->phone_number; + try { + $otpGateway = $this->getOtpGateway(); + $verifyOtpCode = $otpGateway->checkVerification($id, $code, $phoneNumber); + if ($verifyOtpCode->isValid()) { + return true; + } + return false; + } catch (\Throwable $e) { + return false; + } + } + + public function sendOtpCode(Request $request) + { + $phoneNumber = $request->phone_number; + try { + if (empty($phoneNumber)) { + return ['message' => config('shop.app_notice_domain') . 'ERROR.EMPTY_MOBILE_NUMBER', 'success' => false]; + } + + $otpGateway = $this->getOtpGateway(); + $sendOtpCode = $otpGateway->startVerification($phoneNumber); + if (!$sendOtpCode->isValid()) { + return ['message' => OTP_SEND_FAIL, 'success' => false]; + } + $profile = Profile::where('contact', $phoneNumber)->first(); + return [ + 'message' => OTP_SEND_SUCCESSFUL, + 'success' => true, + 'provider' => config('auth.active_otp_gateway'), + 'id' => $sendOtpCode->getId(), + 'phone_number' => $phoneNumber, + 'is_contact_exist' => $profile ? true : false + ]; + } catch (MarvelException $e) { + throw new MarvelException(INVALID_GATEWAY); + } + } + + public function verifyOtpCode(Request $request) + { + try { + if ($this->verifyOtp($request)) { + return [ + "message" => OTP_SEND_SUCCESSFUL, + "success" => true, + ]; + } + throw new MarvelException(OTP_VERIFICATION_FAILED); + } catch (\Throwable $e) { + throw new MarvelException(OTP_VERIFICATION_FAILED); + } + } + + public function otpLogin(Request $request) + { + $phoneNumber = $request->phone_number; + + try { + if ($this->verifyOtp($request)) { + // check if phone number exist + $profile = Profile::where('contact', $phoneNumber)->first(); + $user = ''; + if (!$profile) { + // profile not found so could be a new user + $name = $request->name; + $email = $request->email; + if ($name && $email) { + $userExist = User::where('email', $email)->exists(); + $user = User::firstOrCreate([ + 'email' => $email + ], [ + 'name' => $name, + ]); + $user->givePermissionTo(Permission::CUSTOMER); + $user->assignRole(Role::CUSTOMER); + + $user->profile()->updateOrCreate( + ['customer_id' => $user->id], + [ + 'contact' => $phoneNumber + ] + ); + if (empty($userExist)) { + $this->giveSignupPointsToCustomer($user->id); + } + } else { + return ['message' => REQUIRED_INFO_MISSING, 'success' => false]; + } + } else { + $user = User::where('id', $profile->customer_id)->first(); + } + event(new ProcessUserData()); + return [ + "token" => $user->createToken('auth_token')->plainTextToken, + "permissions" => $user->getPermissionNames(), + "role" => $user->getRoleNames()->first() + ]; + } + return ['message' => OTP_VERIFICATION_FAILED, 'success' => false]; + } catch (\Throwable $e) { + return response()->json(['error' => INVALID_GATEWAY], 422); + } + } + + public function updateContact(Request $request) + { + $phoneNumber = $request->phone_number; + $user_id = $request->user_id; + + try { + if ($this->verifyOtp($request)) { + $user = User::find($user_id); + $user->profile()->updateOrCreate( + ['customer_id' => $user_id], + [ + 'contact' => $phoneNumber + ] + ); + return [ + "message" => CONTACT_UPDATE_SUCCESSFUL, + "success" => true, + ]; + } + return ['message' => CONTACT_UPDATE_FAILED, 'success' => false]; + } catch (\Exception $e) { + return response()->json(['error' => INVALID_GATEWAY], 422); + } + } + + public function addPoints(Request $request) + { + $request->validate([ + 'points' => 'required|numeric', + 'customer_id' => ['required', 'exists:Marvel\Database\Models\User,id'] + ]); + $points = $request->points; + $customer_id = $request->customer_id; + + $wallet = Wallet::firstOrCreate(['customer_id' => $customer_id]); + $wallet->total_points = $wallet->total_points + $points; + $wallet->available_points = $wallet->available_points + $points; + $wallet->save(); + } + + public function makeOrRevokeAdmin(Request $request) + { + $user = $request->user(); + if ($this->repository->hasPermission($user)) { + $user_id = $request->user_id; + try { + $newUser = $this->repository->findOrFail($user_id); + if ($newUser->hasPermissionTo(Permission::SUPER_ADMIN)) { + $newUser->revokePermissionTo(Permission::SUPER_ADMIN); + $newUser->removeRole(Role::SUPER_ADMIN); + return true; + } + } catch (Exception $e) { + throw new MarvelException(USER_NOT_FOUND); + } + $newUser->givePermissionTo(Permission::SUPER_ADMIN); + $newUser->assignRole(Role::SUPER_ADMIN); + + return true; + } + + throw new MarvelException(NOT_AUTHORIZED); + } + public function subscribeToNewsletter(Request $request) + { + try { + $email = $request->email; + Newsletter::subscribeOrUpdate($email); + return true; + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + public function updateUserEmail(Request $request) + { + $validator = Validator::make($request->all(), [ + 'email' => 'required|email|unique:users,email', + ]); + if ($validator->fails()) { + throw new MarvelException($validator->errors()->first()); + } + return $this->repository->updateEmail($request); + } + + public function myStaffs(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + return $this->fetchMyStaffs($request)->paginate($limit); + } + public function fetchMyStaffs(Request $request) + { + $user = $request->user(); + if ($this->repository->hasPermission($user, $request->shop_id)) { + return $this->repository->whereRelation('managed_shop', 'owner_id', '=', $user->id); + } + return $this->repository->whereRelation('managed_shop', 'owner_id', '=', null); + } + + public function allStaffs(Request $request) + { + $user = $request->user(); + $limit = $request->limit ? $request->limit : 15; + if ($this->repository->hasPermission($user)) { + return $this->repository->permission(Permission::STAFF)->paginate($limit); + } + return $this->repository->permission(null)->paginate($limit); + } + + + public function verifyLicenseKey(LicenseRequest $request, MarvelVerification $verification) + { + try { + $licenseKey = $request->license_key; + $language = $request['language'] ?? DEFAULT_LANGUAGE; + $marvel = $verification->verify($licenseKey); + if (!$marvel->getTrust()) { + throw new MarvelNotFoundException(INVALID_LICENSE_KEY); + } + return $marvel->modifySettingsData($language); + } catch (MarvelException $th) { + throw new MarvelException(INVALID_LICENSE_KEY); + } + } + public function fetchUsersByPermission(Request $request) + { + $user = $request->user() ?? null; + $permission = strtolower($request->permission) ?? true; + $is_active = $request->is_active ?? true; + $query = $this->repository->where('is_active', $is_active); + if (!$this->repository->hasPermission($user, $request->shop_id)) { + return $query->permission(null); + } + switch ($permission) { + case Permission::SUPER_ADMIN: + $query->permission($permission); + break; + case Permission::STORE_OWNER: + $excludeUsers = User::permission(Permission::SUPER_ADMIN)->pluck('id')->toArray(); + if(isset($request->exclude)){ + $excludeUsers = [...$excludeUsers, $request->exclude]; + } + $query->permission($permission)->whereNotIn('id', $excludeUsers); + break; + case Permission::STAFF: + $query->permission($permission); + break; + case Permission::CUSTOMER: + $excludeUsers = User::permission([Permission::SUPER_ADMIN, Permission::STORE_OWNER, Permission::STAFF]) + ->pluck('id')->toArray(); + $query->permission($permission)->whereNotIn('id', $excludeUsers); + break; + default: + $query->permission(null); + break; + } + return $query; + } +} diff --git a/packages/marvel/src/Http/Controllers/WebHookController.php b/packages/marvel/src/Http/Controllers/WebHookController.php new file mode 100644 index 0000000..ba77ba1 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/WebHookController.php @@ -0,0 +1,58 @@ +repository = $repository; + } + + + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|AbusiveReport[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + $wishlist = $this->repository->pluck('product_id'); + return Product::whereIn('id', $wishlist)->paginate($limit); + } + + /** + * Store a newly created resource in storage. + * + * @param AbusiveReportCreateRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(WishlistCreateRequest $request) + { + try { + return $this->repository->storeWishlist($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_CREATE_THE_RESOURCE); + } + } + + /** + * Store a newly created resource in storage. + * + * @param AbusiveReportCreateRequest $request + * @return mixed + * @throws ValidatorException + */ + public function toggle(WishlistCreateRequest $request) + { + try { + return $this->repository->toggleWishlist($request); + } catch (MarvelException $th) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy(Request $request, $id) + { + try { + $request->id = $id; + return $this->delete($request); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + public function delete(Request $request) + { + try { + if (!$request->user()) { + throw new AuthorizationException(NOT_AUTHORIZED); + } + $product = Product::where('id', $request->id)->first(); + $wishlist = $this->repository->where('product_id', $product->id)->where('user_id', auth()->user()->id)->first(); + if (!empty($wishlist)) { + return $wishlist->delete(); + } + throw new HttpException(404, NOT_FOUND); + } catch (MarvelException $th) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + /** + * Check in wishlist product for authenticated user + * + * @param int $product_id + * @return JsonResponse + */ + public function in_wishlist(Request $request, $product_id) + { + $request->product_id = $product_id; + return $this->inWishlist($request); + } + + public function inWishlist(Request $request) + { + if (auth()->user() && !empty($this->repository->where('product_id', $request->product_id)->where('user_id', auth()->user()->id)->first())) { + return true; + } + return false; + } +} diff --git a/packages/marvel/src/Http/Controllers/WithdrawController.php b/packages/marvel/src/Http/Controllers/WithdrawController.php new file mode 100644 index 0000000..b732908 --- /dev/null +++ b/packages/marvel/src/Http/Controllers/WithdrawController.php @@ -0,0 +1,172 @@ +repository = $repository; + } + /** + * Display a listing of the resource. + * + * @param Request $request + * @return Collection|Withdraw[] + */ + public function index(Request $request) + { + $limit = $request->limit ? $request->limit : 15; + $withdraw = $this->fetchWithdraws($request); + return $withdraw->paginate($limit); + } + + public function fetchWithdraws(Request $request) + { + try { + $user = $request->user(); + $shop_id = isset($request['shop_id']) && $request['shop_id'] != 'undefined' ? $request['shop_id'] : false; + if ($shop_id) { + if ($user->shops->contains('id', $shop_id)) { + return $this->repository->with(['shop'])->where('shop_id', '=', $shop_id); + } elseif ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + return $this->repository->with(['shop'])->where('shop_id', '=', $shop_id); + } else { + throw new AuthorizationException(NOT_AUTHORIZED); + } + } else { + if ($user && $user->hasPermissionTo(Permission::SUPER_ADMIN)) { + return $this->repository->with(['shop'])->where('id', '!=', null); + } else { + throw new AuthorizationException(NOT_AUTHORIZED); + } + } + } catch (MarvelException $e) { + throw new MarvelException($e->getMessage()); + } + } + + /** + * Store a newly created resource in storage. + * + * @param WithdrawRequest $request + * @return mixed + * @throws ValidatorException + */ + public function store(WithdrawRequest $request) + { + try { + if ($request->user() && ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN) || $request->user()->shops->contains('id', $request->shop_id))) { + $validatedData = $request->validated(); + if (!isset($validatedData['shop_id'])) { + throw new BadRequestHttpException(WITHDRAW_MUST_BE_ATTACHED_TO_SHOP); + } + $balance = Balance::where('shop_id', '=', $validatedData['shop_id'])->first(); + if (isset($balance->current_balance) && $balance->current_balance < $validatedData['amount']) { + throw new BadRequestHttpException(INSUFFICIENT_BALANCE); + } + $withdraw = $this->repository->create($validatedData); + $balance->withdrawn_amount = $balance->withdrawn_amount + $validatedData['amount']; + $balance->current_balance = $balance->current_balance - $validatedData['amount']; + $balance->save(); + $withdraw->status = WithdrawStatus::PENDING; + return $withdraw; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * Display the specified resource. + * + * @param int $id + * @return JsonResponse + */ + public function show(Request $request, $id) + { + $request->id = $id; + return $this->fetchSingleWithdraw($request); + } + + public function fetchSingleWithdraw(Request $request) + { + try { + $id = $request->id; + $withdraw = $this->repository->with(['shop'])->findOrFail($id); + if ($request->user() && ($request->user()->hasPermissionTo(Permission::SUPER_ADMIN) || $request->user()->shops->contains('id', $withdraw->shop_id))) { + return $withdraw; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * Update the specified resource in storage. + * + * @param WithdrawRequest $request + * @param int $id + * @return JsonResponse + */ + public function update(UpdateWithdrawRequest $request, $id) + { + throw new HttpException(400, ACTION_NOT_VALID); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return JsonResponse + */ + public function destroy(Request $request, $id) + { + try { + if ($request->user() && $request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + return $this->repository->findOrFail($id)->delete(); + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(COULD_NOT_DELETE_THE_RESOURCE); + } + } + + public function approveWithdraw(Request $request) + { + try { + if ($request->user() && $request->user()->hasPermissionTo(Permission::SUPER_ADMIN)) { + $id = $request->id; + $status = $request->status->value ?? $request->status; + $withdraw = $this->repository->findOrFail($id); + $withdraw->status = $status; + $withdraw->save(); + return $withdraw; + } + throw new AuthorizationException(NOT_AUTHORIZED); + } catch (MarvelException $e) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } +} diff --git a/packages/marvel/src/Http/Middleware/EnsureEmailIsVerified.php b/packages/marvel/src/Http/Middleware/EnsureEmailIsVerified.php new file mode 100644 index 0000000..276bf88 --- /dev/null +++ b/packages/marvel/src/Http/Middleware/EnsureEmailIsVerified.php @@ -0,0 +1,41 @@ +language ?? DEFAULT_LANGUAGE; + $setting = Settings::getData($language); + $useMustVerifyLicense = isset($setting->options['app_settings']['trust']) ? $setting->options['app_settings']['trust'] : false; + $localLicense = getConfig(); + $useLocalLicense = isset($localLicense['trust']) ? $localLicense['trust'] : false; + $useMustVerifyEmail = isset($setting->options['useMustVerifyEmail']) ? $setting->options['useMustVerifyEmail'] : false; + + if ( + $useMustVerifyEmail && $request->user() && ($request->user() instanceof MustVerifyEmail && !$request->user()->hasVerifiedEmail()) + ) { + //return status code 409 + return response()->json(['message' => EMAIL_NOT_VERIFIED], 409); + } + if (!$useMustVerifyLicense || !$useLocalLicense) { + //return status code 417 + return response()->json(['message' => INVALID_LICENSE_KEY], 417); + } + + return $next($request); + } +} diff --git a/packages/marvel/src/Http/Requests/AbusiveReportAcceptOrRejectRequest.php b/packages/marvel/src/Http/Requests/AbusiveReportAcceptOrRejectRequest.php new file mode 100644 index 0000000..5d6880b --- /dev/null +++ b/packages/marvel/src/Http/Requests/AbusiveReportAcceptOrRejectRequest.php @@ -0,0 +1,40 @@ + ['required', 'integer'], + 'model_type' => ['required', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/AbusiveReportCreateRequest.php b/packages/marvel/src/Http/Requests/AbusiveReportCreateRequest.php new file mode 100644 index 0000000..991c45a --- /dev/null +++ b/packages/marvel/src/Http/Requests/AbusiveReportCreateRequest.php @@ -0,0 +1,41 @@ + ['required', 'integer'], + 'model_type' => ['required', 'string'], + 'message' => ['required', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/AddressRequest.php b/packages/marvel/src/Http/Requests/AddressRequest.php new file mode 100644 index 0000000..81ce232 --- /dev/null +++ b/packages/marvel/src/Http/Requests/AddressRequest.php @@ -0,0 +1,43 @@ + ['required', 'string', 'max:255'], + 'type' => ['required', 'string', 'max:255'], + 'default' => ['boolean'], + 'address' => ['required', 'array'], + 'customer_id' => ['required', 'exists:Marvel\Database\Models\User,id'], + ]; + } + + public function failedValidation(Validator $validator) + { + + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/AiDescriptionRequest.php b/packages/marvel/src/Http/Requests/AiDescriptionRequest.php new file mode 100644 index 0000000..a84c99a --- /dev/null +++ b/packages/marvel/src/Http/Requests/AiDescriptionRequest.php @@ -0,0 +1,40 @@ + ['string', 'required'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/AttachmentRequest.php b/packages/marvel/src/Http/Requests/AttachmentRequest.php new file mode 100644 index 0000000..c1d9242 --- /dev/null +++ b/packages/marvel/src/Http/Requests/AttachmentRequest.php @@ -0,0 +1,40 @@ + ['required'], + ]; + } + + public function failedValidation(Validator $validator) + { + + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/AttributeRequest.php b/packages/marvel/src/Http/Requests/AttributeRequest.php new file mode 100644 index 0000000..959d979 --- /dev/null +++ b/packages/marvel/src/Http/Requests/AttributeRequest.php @@ -0,0 +1,42 @@ + ['required', 'string'], + 'slug' => ['nullable', 'string'], + 'shop_id' => ['required', 'exists:Marvel\Database\Models\Shop,id'], + 'values' => ['array'], + 'language' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/AttributeValueRequest.php b/packages/marvel/src/Http/Requests/AttributeValueRequest.php new file mode 100644 index 0000000..d9e3cb0 --- /dev/null +++ b/packages/marvel/src/Http/Requests/AttributeValueRequest.php @@ -0,0 +1,42 @@ + ['required', 'string', 'max:255'], + 'meta' => ['nullable', 'string'], + 'price' => ['numeric'], + 'shop_id' => ['required', 'exists:Marvel\Database\Models\Shop,id'], + 'attribute_id' => ['required', 'exists:Marvel\Database\Models\Attribute,id'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/AuthorRequest.php b/packages/marvel/src/Http/Requests/AuthorRequest.php new file mode 100644 index 0000000..e3f5b9a --- /dev/null +++ b/packages/marvel/src/Http/Requests/AuthorRequest.php @@ -0,0 +1,46 @@ + ['required', 'string'], + 'slug' => ['nullable', 'string'], + 'bio' => ['nullable', 'string'], + 'shop_id' => ['nullable', 'exists:Marvel\Database\Models\Shop,id'], + 'image' => ['array'], + 'cover_image' => ['array'], + 'is_approved' => ['boolean'], + 'language' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/BecameSellersRequest.php b/packages/marvel/src/Http/Requests/BecameSellersRequest.php new file mode 100644 index 0000000..6e3570a --- /dev/null +++ b/packages/marvel/src/Http/Requests/BecameSellersRequest.php @@ -0,0 +1,43 @@ + ['required', 'array'], + 'commission.*.min_balance' => ['required','numeric', 'min:0'], + 'commission.*.max_balance' => ['required'], + 'commission.*.commission' => ['required','numeric', 'min:0'], + 'commission.*.level' => ['required','string'], + 'commission.*.sub_level' => ['required','string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/CategoryCreateRequest.php b/packages/marvel/src/Http/Requests/CategoryCreateRequest.php new file mode 100644 index 0000000..e36d92c --- /dev/null +++ b/packages/marvel/src/Http/Requests/CategoryCreateRequest.php @@ -0,0 +1,66 @@ + ['required', 'string'], + 'slug' => ['nullable', 'string'], + // 'type_id' => ['required', 'integer'], + 'icon' => ['nullable', 'string'], + 'image' => ['array'], + 'banner_image' => ['array'], + 'details' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + 'parent' => ['nullable', 'integer'], + ]; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return [ + 'name.required' => 'Name field is required', + 'name.string' => 'Name is not a valid string', + 'name.max:255' => 'Name can not be more than 255 character', + 'icon.string' => 'Icon is not a valid string', + 'image.string' => 'Image is not a valid image', + 'banner_image.string' => 'Banner image is not a valid image', + 'details.string' => 'Details is not a valid string', + 'parent.integer' => 'Parent is not a valid integer', + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/CategoryUpdateRequest.php b/packages/marvel/src/Http/Requests/CategoryUpdateRequest.php new file mode 100644 index 0000000..ca55f30 --- /dev/null +++ b/packages/marvel/src/Http/Requests/CategoryUpdateRequest.php @@ -0,0 +1,63 @@ + ['string', 'max:255'], + 'slug' => ['nullable', 'string', 'max:255'], + // 'type_id' => ['integer'], + 'icon' => ['nullable', 'string'], + 'image' => ['array'], + 'banner_image' => ['array'], + 'details' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + 'parent' => ['nullable', 'integer'], + ]; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return [ + 'name.string' => 'Name is not a valid string', + 'name.max:255' => 'Name can not be more than 255 character', + 'image.string' => 'image is not a valid string', + 'banner_image.string' => 'Banner image is not a valid image', + 'parent.integer' => 'Parent is not a valid integer', + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ChangePasswordRequest.php b/packages/marvel/src/Http/Requests/ChangePasswordRequest.php new file mode 100644 index 0000000..54e5a73 --- /dev/null +++ b/packages/marvel/src/Http/Requests/ChangePasswordRequest.php @@ -0,0 +1,39 @@ + 'required|string', + 'newPassword' => 'required|string', + ]; + } + + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/CheckoutVerifyRequest.php b/packages/marvel/src/Http/Requests/CheckoutVerifyRequest.php new file mode 100644 index 0000000..e9f8e76 --- /dev/null +++ b/packages/marvel/src/Http/Requests/CheckoutVerifyRequest.php @@ -0,0 +1,66 @@ + 'required|numeric', + 'customer_id' => 'nullable|exists:Marvel\Database\Models\User,id', + 'products' => 'required|array', + 'billing_address' => 'array', + 'shipping_address' => 'array', + ]; + } + + /** + * Determine if the user is authorized to make this request. + * + * @return bool + */ + public function authorize() + { + return true; + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return $this->getRules(); + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return [ + 'products.required' => 'Product field is required', + ]; + } + + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ConversationCreateRequest.php b/packages/marvel/src/Http/Requests/ConversationCreateRequest.php new file mode 100644 index 0000000..95e1ed8 --- /dev/null +++ b/packages/marvel/src/Http/Requests/ConversationCreateRequest.php @@ -0,0 +1,39 @@ + ['required', 'exists:Marvel\Database\Models\Shop,id'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/CouponRequest.php b/packages/marvel/src/Http/Requests/CouponRequest.php new file mode 100644 index 0000000..9422a8c --- /dev/null +++ b/packages/marvel/src/Http/Requests/CouponRequest.php @@ -0,0 +1,76 @@ +language ?? DEFAULT_LANGUAGE; + if ($this->has('type') && $this->type == 'percentage') { + $rules['amount'] = ['required', 'numeric', 'min:0', 'max:100']; + } else { + $rules['amount'] = ['required', 'numeric', 'min:0']; + } + + return [ + 'code' => ['required', Rule::unique('coupons')->where('language', $language)], + 'amount' => $rules['amount'], + 'minimum_cart_amount' => ['required', 'numeric', 'min:0'], + 'shop_id' => ['nullable', 'exists:Marvel\Database\Models\Shop,id'], + 'type' => ['required', Rule::in(CouponType::getValues())], + 'description' => ['nullable', 'string'], + 'image' => ['array'], + 'language' => ['nullable', 'string'], + 'active_from' => ['required', 'date'], + 'expire_at' => ['required', 'date'], + ]; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return [ + 'code.required' => 'Code field is required and it should be unique', + 'amount.required' => 'Amount field is required', + 'minimum_cart_amount.required' => 'Cart Minimum Amount field is required', + 'type.required' => 'Coupon type is required and it can be only ' . CouponType::FIXED_COUPON . ' or ' . CouponType::PERCENTAGE_COUPON . ' or ' . CouponType::FREE_SHIPPING_COUPON . '', + 'type.in' => 'Type only can be ' . CouponType::FIXED_COUPON . ' or ' . CouponType::PERCENTAGE_COUPON . ' or ' . CouponType::FREE_SHIPPING_COUPON . '', + 'active_from.required' => 'Active from field is required', + 'expire_at.required' => 'Expire at field is required', + ]; + } + + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/CreateFaqsRequest.php b/packages/marvel/src/Http/Requests/CreateFaqsRequest.php new file mode 100644 index 0000000..8fb0e4c --- /dev/null +++ b/packages/marvel/src/Http/Requests/CreateFaqsRequest.php @@ -0,0 +1,42 @@ + ['required', 'string'], + 'faq_description' => ['required', 'string'], + 'slug' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/CreateFlashSaleRequest.php b/packages/marvel/src/Http/Requests/CreateFlashSaleRequest.php new file mode 100644 index 0000000..61ca58b --- /dev/null +++ b/packages/marvel/src/Http/Requests/CreateFlashSaleRequest.php @@ -0,0 +1,47 @@ + ['required', 'string'], + 'description' => ['required', 'string', 'max:10000'], + 'start_date' => ['required', 'date'], + 'end_date' => ['required', 'date'], + 'slug' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + 'image' => ['nullable', 'array'], + 'cover_image' => ['nullable', 'array'], + 'sale_builder' => ['required', 'array'] + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/CreateShippingRequest.php b/packages/marvel/src/Http/Requests/CreateShippingRequest.php new file mode 100644 index 0000000..879198d --- /dev/null +++ b/packages/marvel/src/Http/Requests/CreateShippingRequest.php @@ -0,0 +1,42 @@ + ['required', 'string'], + 'amount' => ['nullable', 'numeric'], + 'is_global' => ['boolean'], + 'type' => ['required', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/CreateTaxRequest.php b/packages/marvel/src/Http/Requests/CreateTaxRequest.php new file mode 100644 index 0000000..4a9da70 --- /dev/null +++ b/packages/marvel/src/Http/Requests/CreateTaxRequest.php @@ -0,0 +1,47 @@ + ['required', 'string'], + 'country' => ['nullable', 'string'], + 'state' => ['nullable', 'string'], + 'zip' => ['nullable', 'string'], + 'city' => ['nullable', 'string'], + 'rate' => ['required', 'numeric'], + 'is_global' => ['boolean'], + 'priority' => ['integer'], + 'on_shipping' => ['boolean'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/CreateTermsAndConditionsRequest.php b/packages/marvel/src/Http/Requests/CreateTermsAndConditionsRequest.php new file mode 100644 index 0000000..ac3d971 --- /dev/null +++ b/packages/marvel/src/Http/Requests/CreateTermsAndConditionsRequest.php @@ -0,0 +1,41 @@ + ['required', 'string'], + 'description' => ['required', 'string', 'max:10000'], + 'language' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/CreateVendorFlashSaleRequest.php b/packages/marvel/src/Http/Requests/CreateVendorFlashSaleRequest.php new file mode 100644 index 0000000..ce18c2f --- /dev/null +++ b/packages/marvel/src/Http/Requests/CreateVendorFlashSaleRequest.php @@ -0,0 +1,42 @@ + ['required', 'string'], + 'note' => ['string'], + 'flash_sale_id' => ['required'], + 'language' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/DeliveryTimeRequest.php b/packages/marvel/src/Http/Requests/DeliveryTimeRequest.php new file mode 100644 index 0000000..45eefa3 --- /dev/null +++ b/packages/marvel/src/Http/Requests/DeliveryTimeRequest.php @@ -0,0 +1,44 @@ + ['required', 'string'], + 'slug' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + 'description' => ['nullable', 'string', 'max:10000'], + 'icon' => ['nullable', 'string'], + ]; + } + + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/FeedbackCreateRequest.php b/packages/marvel/src/Http/Requests/FeedbackCreateRequest.php new file mode 100644 index 0000000..c1f75c0 --- /dev/null +++ b/packages/marvel/src/Http/Requests/FeedbackCreateRequest.php @@ -0,0 +1,52 @@ + ['required', 'integer'], + 'model_type' => ['required', 'string'], + 'positive' => ['boolean'], + 'negative' => ['boolean'], + ]; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return []; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/FeedbackUpdateRequest.php b/packages/marvel/src/Http/Requests/FeedbackUpdateRequest.php new file mode 100644 index 0000000..7b112ac --- /dev/null +++ b/packages/marvel/src/Http/Requests/FeedbackUpdateRequest.php @@ -0,0 +1,52 @@ + ['required', 'integer'], + 'model_type' => ['required', 'string'], + 'positive' => ['boolean'], + 'negative' => ['boolean'], + ]; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return []; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/LanguageRequest.php b/packages/marvel/src/Http/Requests/LanguageRequest.php new file mode 100644 index 0000000..7c632ff --- /dev/null +++ b/packages/marvel/src/Http/Requests/LanguageRequest.php @@ -0,0 +1,42 @@ + ['required', 'string'], + 'language_code' => ['required', 'string'], + 'flag' => ['required', 'string'], + ]; + } + + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/LicenseRequest.php b/packages/marvel/src/Http/Requests/LicenseRequest.php new file mode 100644 index 0000000..010b709 --- /dev/null +++ b/packages/marvel/src/Http/Requests/LicenseRequest.php @@ -0,0 +1,37 @@ + ['string', 'required'], + ]; + } + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ManufacturerRequest.php b/packages/marvel/src/Http/Requests/ManufacturerRequest.php new file mode 100644 index 0000000..cc75d82 --- /dev/null +++ b/packages/marvel/src/Http/Requests/ManufacturerRequest.php @@ -0,0 +1,47 @@ + ['required', 'string'], + 'slug' => ['nullable', 'string'], + 'description' => ['nullable', 'string', 'max:10000'], + 'type_id' => ['required', 'exists:Marvel\Database\Models\Type,id'], + 'shop_id' => ['nullable', 'exists:Marvel\Database\Models\Shop,id'], + 'image' => ['array'], + 'language' => ['nullable', 'string'], + 'cover_image' => ['array'], + 'is_approved' => ['boolean'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/MessageCreateRequest.php b/packages/marvel/src/Http/Requests/MessageCreateRequest.php new file mode 100644 index 0000000..399a601 --- /dev/null +++ b/packages/marvel/src/Http/Requests/MessageCreateRequest.php @@ -0,0 +1,39 @@ + ['required', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/OrderCreateRequest.php b/packages/marvel/src/Http/Requests/OrderCreateRequest.php new file mode 100644 index 0000000..63c2ae4 --- /dev/null +++ b/packages/marvel/src/Http/Requests/OrderCreateRequest.php @@ -0,0 +1,58 @@ + 'nullable|exists:Marvel\Database\Models\Coupon,id', + 'shop_id' => 'nullable|exists:Marvel\Database\Models\Shop,id', + 'customer_id' => 'nullable|exists:Marvel\Database\Models\User,id', + 'language' => ['nullable', 'string'], + 'amount' => 'required|numeric', + 'paid_total' => 'required|numeric', + 'total' => 'required|numeric', + 'delivery_time' => 'nullable|string', + 'customer_contact' => 'string|required', + 'customer_name' => 'nullable|string', + 'payment_gateway' => ['required', Rule::in(PaymentGatewayType::getValues())], + 'altered_payment_gateway' => 'nullable|string', + 'products' => 'required|array', + 'card' => 'array', + 'token' => 'nullable|string', + 'use_wallet_points' => 'nullable|boolean', + 'shipping_address' => 'array', + 'billing_address' => 'array', + 'note' => 'nullable|string', + ]; + } + + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/OrderUpdateRequest.php b/packages/marvel/src/Http/Requests/OrderUpdateRequest.php new file mode 100644 index 0000000..ea2e07c --- /dev/null +++ b/packages/marvel/src/Http/Requests/OrderUpdateRequest.php @@ -0,0 +1,68 @@ + 'nullable|exists:Marvel\Database\Models\Coupon,id', + 'shop_id' => 'exists:Marvel\Database\Models\Shop,id', + 'products' => 'array', + 'amount' => 'numeric', + 'paid_total' => 'numeric', + 'total' => 'numeric', + 'order_status' => ['required', Rule::in([ + OrderStatus::PROCESSING, + OrderStatus::COMPLETED, + OrderStatus::AT_LOCAL_FACILITY, + OrderStatus::OUT_FOR_DELIVERY, + OrderStatus::CANCELLED + ])], + 'customer_id' => 'exists:Marvel\Database\Models\User,id', + 'payment_gateway' => 'string', + 'altered_payment_gateway' => 'nullable|string', + ]; + } + + /** + * Determine if the user is authorized to make this request. + * + * @return bool + */ + public function authorize() + { + return true; + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + $this->rules = $this->getRules(); + return $this->rules; + } + + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/PaymentMethodCreateRequest.php b/packages/marvel/src/Http/Requests/PaymentMethodCreateRequest.php new file mode 100644 index 0000000..1baf280 --- /dev/null +++ b/packages/marvel/src/Http/Requests/PaymentMethodCreateRequest.php @@ -0,0 +1,48 @@ + ['required', 'string'], + 'default_card' => ['boolean'], + 'payment_gateway' => ['required', 'string'], + ]; + } + + + /** + * failedValidation + * + * @param mixed $validator + * @return void + */ + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ProductCreateRequest.php b/packages/marvel/src/Http/Requests/ProductCreateRequest.php new file mode 100644 index 0000000..e1aece2 --- /dev/null +++ b/packages/marvel/src/Http/Requests/ProductCreateRequest.php @@ -0,0 +1,90 @@ + ['required', 'string', 'max:255'], + 'slug' => ['nullable', 'string'], + 'price' => ['nullable', 'numeric'], + 'sale_price' => ['nullable', 'lte:price'], + 'type_id' => ['required', 'exists:Marvel\Database\Models\Type,id'], + 'shop_id' => ['required', 'exists:Marvel\Database\Models\Shop,id'], + 'manufacturer_id' => ['nullable', 'exists:Marvel\Database\Models\Manufacturer,id'], + 'author_id' => ['nullable', 'exists:Marvel\Database\Models\Author,id'], + 'product_type' => ['required', Rule::in($productType)], + 'categories' => ['array'], + 'tags' => ['array'], + 'language' => ['nullable', 'string'], + 'dropoff_locations' => ['array'], + 'pickup_locations' => ['array'], + 'digital_file' => ['array'], + 'variations' => ['array'], + 'variation_options' => ['array'], + 'quantity' => ['nullable', 'integer'], + 'unit' => ['required', 'string'], + 'description' => ['nullable', 'string', 'max:10000'], + 'sku' => ['string', 'unique:variation_options,sku'], + 'image' => ['array'], + 'gallery' => ['array'], + 'video' => ['array'], + 'status' => ['string', Rule::in($productStatus)], + 'height' => ['nullable', 'string'], + 'length' => ['nullable', 'string'], + 'width' => ['nullable', 'string'], + 'external_product_url' => ['nullable', 'string'], + 'external_product_button_text' => ['nullable', 'string'], + 'in_stock' => ['boolean'], + 'is_taxable' => ['boolean'], + 'is_digital' => ['boolean'], + 'is_external' => ['boolean'], + 'is_rental' => ['boolean'], + "variation_options.upsert.*.sku" => ['string', 'unique:variation_options,sku'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ProductUpdateRequest.php b/packages/marvel/src/Http/Requests/ProductUpdateRequest.php new file mode 100644 index 0000000..9600358 --- /dev/null +++ b/packages/marvel/src/Http/Requests/ProductUpdateRequest.php @@ -0,0 +1,84 @@ + ['string', 'max:255'], + 'price' => ['nullable', 'numeric'], + 'sale_price' => ['nullable', 'lte:price'], + 'type_id' => ['exists:Marvel\Database\Models\Type,id'], + 'shop_id' => ['exists:Marvel\Database\Models\Shop,id'], + 'manufacturer_id' => ['nullable', 'exists:Marvel\Database\Models\Manufacturer,id'], + 'author_id' => ['nullable', 'exists:Marvel\Database\Models\Author,id'], + 'categories' => ['exists:Marvel\Database\Models\Category,id'], + 'tags' => ['exists:Marvel\Database\Models\Tag,id'], + 'dropoff_locations' => ['array'], + 'pickup_locations' => ['array'], + 'language' => ['nullable', 'string'], + 'digital_file' => ['array'], + 'product_type' => ['required', Rule::in($productType)], + 'unit' => ['string'], + 'description' => ['nullable', 'string', 'max:10000'], + 'quantity' => ['nullable', 'integer'], + 'sku' => ['string', Rule::unique('variation_options')->where(fn ($query) => $query->whereSku($this->sku))], + 'image' => ['array'], + 'gallery' => ['array'], + 'video' => ['array'], + 'status' => ['string', Rule::in($productStatus)], + 'height' => ['nullable', 'string'], + 'length' => ['nullable', 'string'], + 'width' => ['nullable', 'string'], + 'external_product_url' => ['nullable', 'string'], + 'external_product_button_text' => ['nullable', 'string'], + 'in_stock' => ['boolean'], + 'is_taxable' => ['boolean'], + 'is_digital' => ['boolean'], + 'is_external' => ['boolean'], + 'is_rental' => ['boolean'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ProfileRequest.php b/packages/marvel/src/Http/Requests/ProfileRequest.php new file mode 100644 index 0000000..a9ef518 --- /dev/null +++ b/packages/marvel/src/Http/Requests/ProfileRequest.php @@ -0,0 +1,42 @@ + ['string'], + 'socials' => ['array'], + 'bio' => ['string'], + 'contact' => ['string'], + 'customer_id' => ['required', 'exists:Marvel\Database\Models\User,id'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/QuestionCreateRequest.php b/packages/marvel/src/Http/Requests/QuestionCreateRequest.php new file mode 100644 index 0000000..8b3d2d5 --- /dev/null +++ b/packages/marvel/src/Http/Requests/QuestionCreateRequest.php @@ -0,0 +1,41 @@ + ['required', 'exists:Marvel\Database\Models\Product,id'], + 'shop_id' => ['required', 'exists:Marvel\Database\Models\Shop,id'], + 'question' => ['required', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/QuestionUpdateRequest.php b/packages/marvel/src/Http/Requests/QuestionUpdateRequest.php new file mode 100644 index 0000000..0d12eca --- /dev/null +++ b/packages/marvel/src/Http/Requests/QuestionUpdateRequest.php @@ -0,0 +1,39 @@ + ['required', 'string'] + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/RefundReasonCreateRequest.php b/packages/marvel/src/Http/Requests/RefundReasonCreateRequest.php new file mode 100644 index 0000000..b4686a3 --- /dev/null +++ b/packages/marvel/src/Http/Requests/RefundReasonCreateRequest.php @@ -0,0 +1,53 @@ + ['required', 'string'], + 'slug' => ['nullable', 'string'], + ]; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return [ + 'name.required' => 'Name field is required', + 'name.string' => 'Name is not a valid string', + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/RefundReasonUpdateRequest.php b/packages/marvel/src/Http/Requests/RefundReasonUpdateRequest.php new file mode 100644 index 0000000..3bcb1bd --- /dev/null +++ b/packages/marvel/src/Http/Requests/RefundReasonUpdateRequest.php @@ -0,0 +1,53 @@ + ['required', 'string', 'max:255'], + 'slug' => ['nullable', 'string', 'max:255'], + ]; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return [ + 'name.string' => 'Name is not a valid string', + 'name.max:255' => 'Name can not be more than 255 character', + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/RefundRequest.php b/packages/marvel/src/Http/Requests/RefundRequest.php new file mode 100644 index 0000000..439690a --- /dev/null +++ b/packages/marvel/src/Http/Requests/RefundRequest.php @@ -0,0 +1,42 @@ + ['required', 'exists:Marvel\Database\Models\Order,id'], + 'title' => ['string'], + 'description' => ['string', 'nullable', 'max:10000'], + 'images' => ['array', 'nullable'], + 'refund_reason_id' => ['exists:Marvel\Database\Models\RefundReason,id'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ResourceCreateRequest.php b/packages/marvel/src/Http/Requests/ResourceCreateRequest.php new file mode 100644 index 0000000..8e2933d --- /dev/null +++ b/packages/marvel/src/Http/Requests/ResourceCreateRequest.php @@ -0,0 +1,47 @@ + ['required', 'string'], + 'slug' => ['nullable', 'string'], + 'type' => ['required', Rule::in(ResourceType::getValues())], + 'price' => ['nullable', 'numeric'], + 'image' => ['nullable', 'array'], + 'icon' => ['nullable', 'string'], + 'details' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ResourceUpdateRequest.php b/packages/marvel/src/Http/Requests/ResourceUpdateRequest.php new file mode 100644 index 0000000..3b883e6 --- /dev/null +++ b/packages/marvel/src/Http/Requests/ResourceUpdateRequest.php @@ -0,0 +1,47 @@ + ['required', 'string'], + 'type' => ['required', Rule::in(ResourceType::getValues())], + 'price' => ['nullable', 'numeric'], + 'is_approved' => ['boolean'], + 'image' => ['nullable', 'array'], + 'icon' => ['nullable', 'string'], + 'details' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ReviewCreateRequest.php b/packages/marvel/src/Http/Requests/ReviewCreateRequest.php new file mode 100644 index 0000000..5c05146 --- /dev/null +++ b/packages/marvel/src/Http/Requests/ReviewCreateRequest.php @@ -0,0 +1,45 @@ + ['required', 'exists:Marvel\Database\Models\Order,id'], + 'product_id' => ['required', 'exists:Marvel\Database\Models\Product,id'], + 'variation_option_id' => ['integer', 'exists:Marvel\Database\Models\Variation,id'], + 'comment' => ['required', 'string'], + 'rating' => ['required', 'integer', 'min:1', 'max:5'], + 'shop_id' => ['required', 'exists:Marvel\Database\Models\Shop,id'], + 'photos' => ['array'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ReviewUpdateRequest.php b/packages/marvel/src/Http/Requests/ReviewUpdateRequest.php new file mode 100644 index 0000000..199b76e --- /dev/null +++ b/packages/marvel/src/Http/Requests/ReviewUpdateRequest.php @@ -0,0 +1,41 @@ + ['required', 'string'], + 'rating' => ['required', 'integer', 'min:1', 'max:5'], + 'photos' => ['array'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/SettingsRequest.php b/packages/marvel/src/Http/Requests/SettingsRequest.php new file mode 100644 index 0000000..bdd63d8 --- /dev/null +++ b/packages/marvel/src/Http/Requests/SettingsRequest.php @@ -0,0 +1,38 @@ + ['required', 'array'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ShopCreateRequest.php b/packages/marvel/src/Http/Requests/ShopCreateRequest.php new file mode 100644 index 0000000..b4341e1 --- /dev/null +++ b/packages/marvel/src/Http/Requests/ShopCreateRequest.php @@ -0,0 +1,49 @@ + ['required', 'string', 'max:255'], + 'categories' => ['array'], + 'is_active' => ['boolean'], + 'description' => ['nullable', 'string', 'max:10000'], + 'admin_commission_rate' => ['nullable', 'numeric'], + 'total_earnings' => ['nullable', 'numeric'], + 'withdrawn_amount' => ['nullable', 'numeric'], + 'current_balance' => ['nullable', 'numeric'], + 'image' => ['nullable', 'array'], + 'cover_image' => ['nullable', 'array'], + 'settings' => ['array'], + 'address' => ['array'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/ShopUpdateRequest.php b/packages/marvel/src/Http/Requests/ShopUpdateRequest.php new file mode 100644 index 0000000..84c893d --- /dev/null +++ b/packages/marvel/src/Http/Requests/ShopUpdateRequest.php @@ -0,0 +1,45 @@ + ['required', 'string', 'max:255'], + 'categories' => ['array'], + 'is_active' => ['boolean'], + 'description' => ['nullable', 'string', 'max:10000'], + 'balance' => ['array'], + 'image' => ['nullable', 'array'], + 'cover_image' => ['nullable', 'array'], + 'settings' => ['array'], + 'address' => ['array'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/StoreNoticeRequest.php b/packages/marvel/src/Http/Requests/StoreNoticeRequest.php new file mode 100644 index 0000000..489c892 --- /dev/null +++ b/packages/marvel/src/Http/Requests/StoreNoticeRequest.php @@ -0,0 +1,93 @@ + ['required', 'string', Rule::in($this->priorityArr)], + 'notice' => ['required', 'string'], + 'description' => ['nullable', 'string', 'max:10000'], + 'effective_from' => ['nullable', 'date'], + 'expired_at' => ['required', 'date','after:effective_from'], + 'type' => ['required', 'string', Rule::in($this->typeArr)], + 'received_by' => ['array','required_if: type,' . StoreNoticeType::SPECIFIC_VENDOR . ',' . StoreNoticeType::SPECIFIC_SHOP], + 'received_by.*' => ['nullable', 'integer'] + ]; + } + + /** + * Get the validation custom messages that apply to the request. + * + * @return array + */ + public function messages() + { + return [ + 'received_by.required_if' => 'Please! Select at least one Specific receiver.' + ]; + } + + /** + * Handle a failed validation attempt. + * + * @param Validator $validator + * @return void + */ + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/StoreNoticeUpdateRequest.php b/packages/marvel/src/Http/Requests/StoreNoticeUpdateRequest.php new file mode 100644 index 0000000..2b2e26c --- /dev/null +++ b/packages/marvel/src/Http/Requests/StoreNoticeUpdateRequest.php @@ -0,0 +1,93 @@ + ['required', 'string', Rule::in($this->priorityArr)], + 'notice' => ['required', 'string'], + 'description' => ['nullable', 'string', 'max:10000'], + 'effective_from' => ['nullable', 'date'], + 'expired_at' => ['required', 'date', 'after:effective_from'], + 'type' => ['required', 'string', Rule::in($this->typeArr)], + 'received_by' => ['required_if :type,' . StoreNoticeType::SPECIFIC_VENDOR . ',' . StoreNoticeType::SPECIFIC_SHOP, 'array'], + 'received_by.*' => ['nullable', 'integer'] + ]; + } + + /** + * Get the validation custom messages that apply to the request. + * + * @return array + */ + public function messages() + { + return [ + 'received_by.required_if' => 'Please! Select at least one Specific receiver.' + ]; + } + + /** + * Handle a failed validation attempt. + * + * @param Validator $validator + * @return void + */ + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/StoreRefundPolicyRequest.php b/packages/marvel/src/Http/Requests/StoreRefundPolicyRequest.php new file mode 100644 index 0000000..1288cd8 --- /dev/null +++ b/packages/marvel/src/Http/Requests/StoreRefundPolicyRequest.php @@ -0,0 +1,47 @@ + ['required', 'string', 'max: 255'], + 'target' => ['required', ], + 'status' => ['required',], + 'slug' => ['nullable', 'string', 'max: 255'], + 'description' => ['nullable', 'string', 'max:10000'], + 'shop_id' => ['nullable', 'exists: ' . Shop::class . ',id'], + 'language' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/TagCreateRequest.php b/packages/marvel/src/Http/Requests/TagCreateRequest.php new file mode 100644 index 0000000..6ce8ace --- /dev/null +++ b/packages/marvel/src/Http/Requests/TagCreateRequest.php @@ -0,0 +1,62 @@ + ['required', 'string'], + 'slug' => ['nullable', 'string'], + // 'type_id' => ['required', 'integer'], + 'icon' => ['nullable', 'string'], + 'image' => ['nullable', 'array'], + 'details' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + ]; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return [ + 'name.required' => 'Name field is required', + 'name.string' => 'Name is not a valid string', + 'icon.string' => 'Icon is not a valid string', + 'image.string' => 'Image is not a valid image', + 'details.string' => 'Details is not a valid string', + 'parent.integer' => 'Parent is not a valid integer', + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/TagUpdateRequest.php b/packages/marvel/src/Http/Requests/TagUpdateRequest.php new file mode 100644 index 0000000..bcfe310 --- /dev/null +++ b/packages/marvel/src/Http/Requests/TagUpdateRequest.php @@ -0,0 +1,60 @@ + ['required', 'string', 'max: 255'], + 'slug' => ['nullable', 'string', 'max: 255'], + // 'type_id' => ['required', 'integer'], + 'icon' => ['nullable', 'string'], + 'image' => ['nullable', 'array'], + 'details' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + ]; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return [ + 'name.string' => 'Name is not a valid string', + 'name.max:255' => 'Name can not be more than 255 character', + 'image.string' => 'image is not a valid string', + 'parent.integer' => 'Parent is not a valid integer', + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/TransferShopOwnerShipRequest.php b/packages/marvel/src/Http/Requests/TransferShopOwnerShipRequest.php new file mode 100644 index 0000000..13cf0a5 --- /dev/null +++ b/packages/marvel/src/Http/Requests/TransferShopOwnerShipRequest.php @@ -0,0 +1,41 @@ + ['required', 'exists:Marvel\Database\Models\Shop,id'], + 'vendor_id' => ['required', 'exists:Marvel\Database\Models\User,id'], + 'message' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/TypeRequest.php b/packages/marvel/src/Http/Requests/TypeRequest.php new file mode 100644 index 0000000..f4260eb --- /dev/null +++ b/packages/marvel/src/Http/Requests/TypeRequest.php @@ -0,0 +1,43 @@ + ['required', 'string'], + 'slug' => ['nullable', 'string'], + 'icon' => ['nullable', 'string'], + 'banners' => ['nullable', 'array'], + 'language' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/UpdateCouponRequest.php b/packages/marvel/src/Http/Requests/UpdateCouponRequest.php new file mode 100644 index 0000000..98cae14 --- /dev/null +++ b/packages/marvel/src/Http/Requests/UpdateCouponRequest.php @@ -0,0 +1,82 @@ +language ?? DEFAULT_LANGUAGE; + if( $this->has('type') && $this->type == 'percentage' ) { + $rule['amount'] = ['required', 'numeric', 'min:0','max:100']; + }else{ + $rule['amount'] = ['required', 'numeric', 'min:0']; + } + + + $rules = [ + 'description' => ['nullable', 'string', 'max:10000'], + 'image' => ['array',], + 'language' => ['nullable', 'string'], + 'amount' => $rule['amount'], + 'minimum_cart_amount' => ['numeric','min:0'], + ]; + + if ($this->language === DEFAULT_LANGUAGE) { + $rules['code'] = ['string', Rule::unique('coupons')->where('language', $language)]; + $rules['type'] = ['required',Rule::in([CouponType::FIXED_COUPON, CouponType::PERCENTAGE_COUPON, CouponType::FREE_SHIPPING_COUPON])]; + $rules['active_from'] = ['date']; + $rules['expire_at'] = ['date']; + } + + return $rules; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return [ + 'code.required' => 'Code field is required and it should be unique', + 'amount.required' => 'Amount field is required', + 'minimum_cart_amount.required' => 'Cart Minimum Amount field is required', + 'type.required' => 'Coupon type is required and it can be only ' . CouponType::FIXED_COUPON . ' or ' . CouponType::PERCENTAGE_COUPON . ' or ' . CouponType::FREE_SHIPPING_COUPON . '', + 'type.in' => 'Type only can be ' . CouponType::FIXED_COUPON . ' or ' . CouponType::PERCENTAGE_COUPON . ' or ' . CouponType::FREE_SHIPPING_COUPON . '', + 'active_from.required' => 'Active from field is required', + 'expire_at.required' => 'Expire at field is required', + ]; + } + + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/UpdateFaqsRequest.php b/packages/marvel/src/Http/Requests/UpdateFaqsRequest.php new file mode 100644 index 0000000..13e2922 --- /dev/null +++ b/packages/marvel/src/Http/Requests/UpdateFaqsRequest.php @@ -0,0 +1,47 @@ +language ?? DEFAULT_LANGUAGE; + + $rules = [ + 'faq_title' => ['required', 'string'], + 'faq_description' => ['required', 'string'], + 'slug' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + ]; + return $rules; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/UpdateFlashSaleRequest.php b/packages/marvel/src/Http/Requests/UpdateFlashSaleRequest.php new file mode 100644 index 0000000..a4b3cca --- /dev/null +++ b/packages/marvel/src/Http/Requests/UpdateFlashSaleRequest.php @@ -0,0 +1,51 @@ +language ?? DEFAULT_LANGUAGE; + + $rules = [ + 'title' => ['required', 'string'], + 'description' => ['required', 'string', 'max:10000'], + 'start_date' => ['required', 'string'], + 'end_date' => ['required', 'string'], + 'slug' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + 'image' => ['nullable', 'array'], + 'cover_image' => ['nullable', 'array'], + ]; + return $rules; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} \ No newline at end of file diff --git a/packages/marvel/src/Http/Requests/UpdateRefundPolicyRequest.php b/packages/marvel/src/Http/Requests/UpdateRefundPolicyRequest.php new file mode 100644 index 0000000..22f9679 --- /dev/null +++ b/packages/marvel/src/Http/Requests/UpdateRefundPolicyRequest.php @@ -0,0 +1,47 @@ + ['string', 'string', 'max : 255'], + 'target' => ['string', 'max:255', Rule::in(RefundPolicyTarget::getValues())], + 'status' => ['string', 'max:255', Rule::in(RefundPolicyStatus::getValues())], + 'slug' => ['nullable', 'string', 'max: 255'], + 'description' => ['nullable', 'string', 'max:10000'], + 'shop_id' => ['nullable', 'exists:' . Shop::class . ',id'], + 'language' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/UpdateShippingRequest.php b/packages/marvel/src/Http/Requests/UpdateShippingRequest.php new file mode 100644 index 0000000..e2707b0 --- /dev/null +++ b/packages/marvel/src/Http/Requests/UpdateShippingRequest.php @@ -0,0 +1,42 @@ + ['string'], + 'amount' => ['numeric'], + 'is_global' => ['boolean'], + 'type' => ['string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/UpdateTaxRequest.php b/packages/marvel/src/Http/Requests/UpdateTaxRequest.php new file mode 100644 index 0000000..b596ca4 --- /dev/null +++ b/packages/marvel/src/Http/Requests/UpdateTaxRequest.php @@ -0,0 +1,47 @@ + ['required', 'string'], + 'country' => ['nullable', 'string'], + 'state' => ['nullable', 'string'], + 'zip' => ['nullable', 'string'], + 'city' => ['nullable', 'string'], + 'rate' => ['required', 'numeric'], + 'is_global' => ['boolean'], + 'priority' => ['integer'], + 'on_shipping' => ['boolean'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/UpdateTermsAndConditionsRequest.php b/packages/marvel/src/Http/Requests/UpdateTermsAndConditionsRequest.php new file mode 100644 index 0000000..9e373f2 --- /dev/null +++ b/packages/marvel/src/Http/Requests/UpdateTermsAndConditionsRequest.php @@ -0,0 +1,47 @@ +language ?? DEFAULT_LANGUAGE; + + $rules = [ + 'title' => ['required', 'string'], + 'description' => ['required', 'string', 'max:10000'], + 'slug' => ['nullable', 'string'], + 'language' => ['nullable', 'string'], + ]; + return $rules; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/UpdateVendorFlashSaleRequest.php b/packages/marvel/src/Http/Requests/UpdateVendorFlashSaleRequest.php new file mode 100644 index 0000000..3ae4dc0 --- /dev/null +++ b/packages/marvel/src/Http/Requests/UpdateVendorFlashSaleRequest.php @@ -0,0 +1,47 @@ +language ?? DEFAULT_LANGUAGE; + + $rules = [ + 'title' => ['required', 'string'], + 'note' => ['string'], + 'flash_sale_id' => ['required'], + 'language' => ['nullable', 'string'], + ]; + return $rules; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/UpdateWithdrawRequest.php b/packages/marvel/src/Http/Requests/UpdateWithdrawRequest.php new file mode 100644 index 0000000..4622c72 --- /dev/null +++ b/packages/marvel/src/Http/Requests/UpdateWithdrawRequest.php @@ -0,0 +1,51 @@ + ['required', 'exists:Marvel\Database\Models\Shop,id'], + 'amount' => ['required', 'numeric'], + 'payment_method' => ['nullable', 'string'], + 'details' => ['nullable', 'string'], + 'note' => ['nullable', 'string'], + 'status' => ['required', Rule::in([ + WithdrawStatus::APPROVED, + WithdrawStatus::PROCESSING, + WithdrawStatus::REJECTED, + WithdrawStatus::PENDING, + WithdrawStatus::ON_HOLD, + ])], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/UserCreateRequest.php b/packages/marvel/src/Http/Requests/UserCreateRequest.php new file mode 100644 index 0000000..c60caa0 --- /dev/null +++ b/packages/marvel/src/Http/Requests/UserCreateRequest.php @@ -0,0 +1,66 @@ + ['required', 'string', 'max:255'], + 'email' => ['required', 'email', 'unique:users'], + 'password' => ['required', 'string'], + 'shop_id' => ['nullable', 'exists:Marvel\Database\Models\Shop,id'], + 'profile' => ['array'], + 'address' => ['array'], + // 'shop' => ['array'], + ]; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return [ + 'name.required' => 'Name is required', + 'name.string' => 'Name is not a valid string', + 'name.max:255' => 'Name can not be more than 255 character', + 'email.required' => 'email is required', + 'email.email' => 'email is not a valid email address', + 'email.unique:users' => 'email must be unique', + 'password.required' => 'password is required', + 'password.string' => 'password is not a valid string', + 'address.array' => 'address is not a valid json', + 'profile.array' => 'profile is not a valid json', + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/UserUpdateRequest.php b/packages/marvel/src/Http/Requests/UserUpdateRequest.php new file mode 100644 index 0000000..2655c45 --- /dev/null +++ b/packages/marvel/src/Http/Requests/UserUpdateRequest.php @@ -0,0 +1,61 @@ + ['string', 'max:255'], + 'email' => ['email', 'unique:users'], + 'shop_id' => ['nullable', 'exists:Marvel\Database\Models\Shop,id'], + 'profile' => ['array'], + 'address' => ['array'], + // 'shop' => ['array'], + ]; + } + + /** + * Get the error messages that apply to the request parameters. + * + * @return array + */ + public function messages() + { + return [ + 'name.string' => 'Name is not a valid string', + 'name.max:255' => 'Name can not be more than 255 character', + 'email.email' => 'email is not a valid email address', + 'email.unique:users' => 'email must be unique', + 'address.array' => 'address is not a valid json', + 'profile.array' => 'profile is not a valid json', + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/WebHookRequest.php b/packages/marvel/src/Http/Requests/WebHookRequest.php new file mode 100644 index 0000000..e69de29 diff --git a/packages/marvel/src/Http/Requests/WishlistCreateRequest.php b/packages/marvel/src/Http/Requests/WishlistCreateRequest.php new file mode 100644 index 0000000..8f4115c --- /dev/null +++ b/packages/marvel/src/Http/Requests/WishlistCreateRequest.php @@ -0,0 +1,40 @@ + ['required', 'exists:Marvel\Database\Models\Product,id'], + 'variation_option_id' => ['integer', 'exists:Marvel\Database\Models\Variation,id'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Requests/WithdrawRequest.php b/packages/marvel/src/Http/Requests/WithdrawRequest.php new file mode 100644 index 0000000..a979b8f --- /dev/null +++ b/packages/marvel/src/Http/Requests/WithdrawRequest.php @@ -0,0 +1,44 @@ + ['required', 'exists:Marvel\Database\Models\Shop,id'], + 'amount' => ['required', 'numeric'], + 'payment_method' => ['nullable', 'string'], + 'details' => ['nullable', 'string'], + 'note' => ['nullable', 'string'], + ]; + } + + public function failedValidation(Validator $validator) + { + throw new HttpResponseException(response()->json($validator->errors(), 422)); + } +} diff --git a/packages/marvel/src/Http/Resources/AttributeResource.php b/packages/marvel/src/Http/Resources/AttributeResource.php new file mode 100644 index 0000000..7dc6905 --- /dev/null +++ b/packages/marvel/src/Http/Resources/AttributeResource.php @@ -0,0 +1,28 @@ + $this->id, + 'name' => $this->name, + 'shop_id' => $this->shop_id, + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + 'slug' => $this->slug, + 'type' => getResourceData($this->type,[]), // if you need extra data then pass key in array by second parameter + 'values' => AttributeValueResource::collection($this->values) + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/AttributeValueResource.php b/packages/marvel/src/Http/Resources/AttributeValueResource.php new file mode 100644 index 0000000..dcbf3ba --- /dev/null +++ b/packages/marvel/src/Http/Resources/AttributeValueResource.php @@ -0,0 +1,27 @@ + $this->id, + 'value' => $this->value, + 'attribute_id' => $this->attribute_id, + 'slug' => $this->slug, + 'meta' => $this->meta, + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/AuthorResource.php b/packages/marvel/src/Http/Resources/AuthorResource.php new file mode 100644 index 0000000..c49ca16 --- /dev/null +++ b/packages/marvel/src/Http/Resources/AuthorResource.php @@ -0,0 +1,35 @@ + $this->id, + 'name' => $this->name, + 'language' => $this->language, + 'is_approved' => $this->is_approved, + 'translated_languages' => $this->translated_languages, + 'slug' => $this->slug, + 'bio' => $this->bio, + 'quote' => $this->quote, + 'products_count' => $this->products_count, + 'born' => $this->born, + 'death' => $this->death, + 'languages' => $this->languages, + 'socials' => $this->socials, + 'image' => $this->image, + 'cover_image' => $this->cover_image, + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/BannerResource.php b/packages/marvel/src/Http/Resources/BannerResource.php new file mode 100644 index 0000000..e9c38a3 --- /dev/null +++ b/packages/marvel/src/Http/Resources/BannerResource.php @@ -0,0 +1,25 @@ + $this->id, + 'title' => $this->title, + 'type_id' => $this->type_id, + 'description' => $this->description, + 'image' => $this->image + ]; + } +} \ No newline at end of file diff --git a/packages/marvel/src/Http/Resources/CategoryResource.php b/packages/marvel/src/Http/Resources/CategoryResource.php new file mode 100644 index 0000000..c22e10a --- /dev/null +++ b/packages/marvel/src/Http/Resources/CategoryResource.php @@ -0,0 +1,35 @@ + $this->id, + 'name' => $this->name, + 'slug' => $this->slug, + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + 'parent' => ['name' => $this->parentCategory->name ?? null], + 'children' => ChildrenCategoryResource::collection($this->children), + 'products_count' => $this->products_count, + 'details' => $this->details, + 'image' => $this->image, + 'icon' => $this->icon, + 'type_id' => $this->type_id, + 'banner_image' => $this->banner_image, + 'type' => getResourceData($this->type, []) // if you need extra data then pass key in array by second parameter + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/ChildrenCategoryResource.php b/packages/marvel/src/Http/Resources/ChildrenCategoryResource.php new file mode 100644 index 0000000..039ba90 --- /dev/null +++ b/packages/marvel/src/Http/Resources/ChildrenCategoryResource.php @@ -0,0 +1,27 @@ + $this->id, + 'name' => $this->name, + 'slug' => $this->slug, + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + 'products_count' => $this->products_count, + 'image' => $this->image, + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/ConversationResource.php b/packages/marvel/src/Http/Resources/ConversationResource.php new file mode 100644 index 0000000..e5fd0e6 --- /dev/null +++ b/packages/marvel/src/Http/Resources/ConversationResource.php @@ -0,0 +1,40 @@ + $this->id, + 'user_id' => $this->user_id, + 'user' => $this->when($this->needToInclude($request, 'conversation.user'), function () { + return new UserResource($this->user); + }), + 'to_user_id' => $this->to_user_id, + 'to_user' => $this->when($this->needToInclude($request, 'conversation.to_user'), function () { + return new UserResource($this->to_user); + }), + 'shop_id' => $this->shop_id, + 'shop' => $this->when($this->needToInclude($request, 'conversation.shop'), function () { + return new ShopResource($this->shop); + }), + 'messages' => $this->when($this->needToInclude($request, 'conversation.messages'), function () { + return new MessageResourceCollection($this->messages); + }), + 'latest_message' => new MessageResource($this->latest_message), + 'unseen' => $this->unseen, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/ConversationResourceCollection.php b/packages/marvel/src/Http/Resources/ConversationResourceCollection.php new file mode 100644 index 0000000..e9288d2 --- /dev/null +++ b/packages/marvel/src/Http/Resources/ConversationResourceCollection.php @@ -0,0 +1,22 @@ + $this->id, + 'code' => $this->code, + 'language' => $this->language, + 'description' => $this->description, + 'image' => $this->image, + 'type' => $this->type, + 'amount' => $this->amount, + 'minimum_cart_amount' => $this->minimum_cart_amount, + 'active_from' => $this->active_from, + 'expire_at' => $this->expire_at, + 'is_valid' => $this->is_valid, + 'target' => $this->target, + 'is_approve' => $this->is_approve, + 'translated_languages' => $this->translated_languages, + 'shop_id' => $this->shop_id, + 'user_id' => $this->user_id, + ]; + } +} \ No newline at end of file diff --git a/packages/marvel/src/Http/Resources/FaqResource.php b/packages/marvel/src/Http/Resources/FaqResource.php new file mode 100644 index 0000000..6f5e6f6 --- /dev/null +++ b/packages/marvel/src/Http/Resources/FaqResource.php @@ -0,0 +1,29 @@ + $this->id, + 'faq_title' => $this->faq_title, + 'slug' => $this->slug, + 'faq_description' => $this->faq_description, + 'faq_type' => $this->faq_type, + 'issued_by' => $this->issued_by, + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/FlashSaleResource.php b/packages/marvel/src/Http/Resources/FlashSaleResource.php new file mode 100644 index 0000000..4dad870 --- /dev/null +++ b/packages/marvel/src/Http/Resources/FlashSaleResource.php @@ -0,0 +1,38 @@ + $this->id, + "title" => $this->title, + "slug" => $this->slug, + "description" => $this->description, + "start_date" => $this->start_date, + "end_date" => $this->end_date, + "sale_status" => $this->sale_status, + "type" => $this->type, + "rate" => $this->rate, + "sale_builder" => $this->sale_builder, + "image" => $this->image, + "cover_image" => $this->cover_image, + "products" => ProductResource::collection($this->products), + "language" => $this->language, + "deleted_at" => $this->deleted_at, + "created_at" => $this->created_at, + "updated_at" => $this->updated_at, + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/GetResource.php b/packages/marvel/src/Http/Resources/GetResource.php new file mode 100644 index 0000000..b4554d9 --- /dev/null +++ b/packages/marvel/src/Http/Resources/GetResource.php @@ -0,0 +1,24 @@ + $this->id, + 'name' => $this->name, + 'slug' => $this->slug, + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/GetSingleRefundResource.php b/packages/marvel/src/Http/Resources/GetSingleRefundResource.php new file mode 100644 index 0000000..4f21138 --- /dev/null +++ b/packages/marvel/src/Http/Resources/GetSingleRefundResource.php @@ -0,0 +1,75 @@ + $this->id, + 'title' => $this->title, + 'refund_reason' => $this->refund_reason, + 'description' => $this->description, + 'amount' => $this->amount, + 'status' => $this->status, + 'images' => $this->images, + 'customer' => [ + 'email' => $this->customer->email + ], + 'order' => $this->getOrderData($this->order), + 'created_at' => $this->created_at, + ]; + } + + // TODO When order resource done then use OrderResource Instead of these function + + private function getOrderData($data) + { + return [ + 'id' => $data->id, + 'tracking_number' => $data->tracking_number, + 'shipping_address' => $data->shipping_address, + 'billing_address' => $data->billing_address, + 'customer_contact' => $data->customer_contact, + 'customer_name' => $data->customer_name, + 'amount' => $data->amount, + 'sales_tax' => $data->sales_tax, + 'discount' => $data->discount, + 'delivery_fee' => $data->delivery_fee, + 'order_status' => $data->order_status, + 'products' => $this->getProductData($data->products), + 'paid_total' => $data->paid_total, + 'created_at' => $this->created_at, + ]; + } + private function getProductData($products) + { + $item = []; + foreach ($products as $product) { + $item[] = [ + 'id' => $product['id'], + 'name' => $product['name'], + 'image' => $product['image'], + 'pivot' => $this->getProductPivot($product['pivot']), + ]; + } + return $item; + } + private function getProductPivot($pivot) + { + return [ + 'order_quantity' => $pivot->order_quantity, + 'subtotal' => $pivot->subtotal, + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/GetSingleStoreNoticeResource.php b/packages/marvel/src/Http/Resources/GetSingleStoreNoticeResource.php new file mode 100644 index 0000000..58b75ac --- /dev/null +++ b/packages/marvel/src/Http/Resources/GetSingleStoreNoticeResource.php @@ -0,0 +1,36 @@ + $this->id, + 'type' => $this->type, + 'priority' => $this->priority, + 'notice' => $this->notice, + 'description' => $this->description, + 'effective_from' => $this->effective_from, + 'expired_at' => $this->expired_at, + 'creator_role' => $this->creator_role, + 'users' => $this->users, + 'shops' => $this->shops, + + + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/ManufacturerResource.php b/packages/marvel/src/Http/Resources/ManufacturerResource.php new file mode 100644 index 0000000..721bb68 --- /dev/null +++ b/packages/marvel/src/Http/Resources/ManufacturerResource.php @@ -0,0 +1,33 @@ + $this->id, + 'name' => $this->name, + 'slug' => $this->slug, + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + 'products_count' => $this->products_count, + 'is_approved' => $this->is_approved, + 'description' => $this->description, + 'website' => $this->website, + 'socials' => $this->socials, + 'image' => $this->image, + 'cover_image' => $this->cover_image, + 'type' => getResourceData($this->type,[]) // if you need extra data then pass key in array by second parameter + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/MessageResource.php b/packages/marvel/src/Http/Resources/MessageResource.php new file mode 100644 index 0000000..06798d3 --- /dev/null +++ b/packages/marvel/src/Http/Resources/MessageResource.php @@ -0,0 +1,32 @@ + $this->id, + 'conversation_id' => $this->conversation_id, + 'conversation' => $this->when($this->needToInclude($request, 'message.conversation'), function () { + return new ConversationResource($this->conversation); + }), + 'user_id' => $this->user_id, + 'user' => $this->when($this->needToInclude($request, 'message.user'), function () { + return new UserResource($this->user); + }), + 'body' => $this->body, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/MessageResourceCollection.php b/packages/marvel/src/Http/Resources/MessageResourceCollection.php new file mode 100644 index 0000000..7c9dd49 --- /dev/null +++ b/packages/marvel/src/Http/Resources/MessageResourceCollection.php @@ -0,0 +1,22 @@ +whereNotNull('orders.parent_id') + // ->whereDate('orders.created_at', '<=', Carbon::now()) + // ->where('orders.shop_id', '=', $shop_id) + // ->select( + // 'orders.order_status', + // DB::raw('count(*) as order_count') + // ) + // ->groupBy('orders.order_status') + // ->pluck('order_count', 'order_status'); + + // return [ + // 'pending' => $query[OrderStatus::PENDING] ?? 0, + // 'processing' => $query[OrderStatus::PROCESSING] ?? 0, + // 'complete' => $query[OrderStatus::COMPLETED] ?? 0, + // 'cancelled' => $query[OrderStatus::CANCELLED] ?? 0, + // 'refunded' => $query[OrderStatus::REFUNDED] ?? 0, + // 'failed' => $query[OrderStatus::FAILED] ?? 0, + // 'localFacility' => $query[OrderStatus::AT_LOCAL_FACILITY] ?? 0, + // 'outForDelivery' => $query[OrderStatus::OUT_FOR_DELIVERY] ?? 0, + // ]; + // } + + // public function balanceInfoRelatedToShop($shop_id) + // { + // $shopBalanceInfo = DB::table('balances')->where('shop_id', '=', $shop_id)->first(); + // return $shopBalanceInfo; + // } + + // public function refundInfoRelatedToShop($shop_id) + // { + // $shopRefundInfo = DB::table('refunds')->where('shop_id', '=', $shop_id)->get(); + // return $shopRefundInfo; + // } + + // public function withdrawInfoRelatedToShop($shop_id) + // { + // $shopRefundInfo = DB::table('withdraws')->where('shop_id', '=', $shop_id)->get(); + // return $shopRefundInfo; + // } + + /** + * Transform the resource into an array. + * + * @param Request $request + * @return array + */ + public function toArray($request) + { + return [ + 'id' => $this->id, + 'transaction_identifier' => $this->transaction_identifier, + 'previous_owner' => $this->previous_owner, + 'current_owner' => $this->current_owner, + 'message' => $this->message, + 'created_by' => $this->created_by, + 'status' => $this->status, + 'shop' => new ShopResource($this->whenLoaded('shop')), + 'order_info' => $this->order_info, + 'balance_info' => $this->balance_info, + 'refund_info' => $this->refund_info, + 'withdrawal_info' => $this->withdrawal_info, + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/RefundPolicyResource.php b/packages/marvel/src/Http/Resources/RefundPolicyResource.php new file mode 100644 index 0000000..8b8ff3a --- /dev/null +++ b/packages/marvel/src/Http/Resources/RefundPolicyResource.php @@ -0,0 +1,31 @@ + $this->id, + 'title' => $this->title, + 'slug' => $this->slug, + 'target' => $this->target, + 'status' => $this->status, + 'description' => $this->description, + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + 'shop' => new ShopResource($this->whenLoaded('shop')), + 'refunds' => RefundResource::collection($this->whenLoaded('refunds')), + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/RefundResource.php b/packages/marvel/src/Http/Resources/RefundResource.php new file mode 100644 index 0000000..af0731b --- /dev/null +++ b/packages/marvel/src/Http/Resources/RefundResource.php @@ -0,0 +1,37 @@ + $this->id, + 'refund_reason' => ['name'=>$this->refund_reason->name ?? null], + 'amount' => $this->amount, + 'status' => $this->status, + 'customer' => ['email' => $this->customer->email ?? null], + 'order' => $this->getOrderData($this->order), + 'created_at' => $this->created_at, + ]; + } + + private function getOrderData($data) + { + return [ + 'id' => $data->id, + 'tracking_number' => $data->tracking_number, + 'created_at' => $this->created_at, + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/Resource.php b/packages/marvel/src/Http/Resources/Resource.php new file mode 100644 index 0000000..dc8750d --- /dev/null +++ b/packages/marvel/src/Http/Resources/Resource.php @@ -0,0 +1,21 @@ +get('include'))); + } +} diff --git a/packages/marvel/src/Http/Resources/ShopResource.php b/packages/marvel/src/Http/Resources/ShopResource.php new file mode 100644 index 0000000..43457c9 --- /dev/null +++ b/packages/marvel/src/Http/Resources/ShopResource.php @@ -0,0 +1,36 @@ + $this->id, + 'owner_id' => $this->owner_id, + 'owner' => $this->when($this->needToInclude($request, 'shop.owner'), function () { + return new UserResource($this->owner); + }), + 'name' => $this->name, + 'slug' => $this->slug, + 'description' => $this->description, + 'cover_image' => $this->cover_image, + 'logo' => $this->logo, + 'is_active' => $this->is_active, + 'address' => $this->address, + 'settings' => $this->settings, + 'notifications' => $this->notifications, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/ShopResourceCollection.php b/packages/marvel/src/Http/Resources/ShopResourceCollection.php new file mode 100644 index 0000000..afe9e71 --- /dev/null +++ b/packages/marvel/src/Http/Resources/ShopResourceCollection.php @@ -0,0 +1,19 @@ + $this->id, + 'type' => $this->type, + 'priority' => $this->priority, + 'notice' => $this->notice, + 'description' => $this->description, + 'effective_from' => $this->effective_from, + 'expired_at' => $this->expired_at, + 'creator_role' => $this->creator_role, + 'is_read' => $this->is_read, + 'creator' => ['id' => $this->creator->id, 'name' => $this->creator->name, 'email' => $this->creator->email], + 'users' => getResourceCollection($this->users, ['email']), + 'shops' => getResourceCollection($this->shops), + 'read_status' => $this->readStatusRecourseData($this->read_status), + ]; + } + + + private function readStatusRecourseData($read_status): array + { + return collect($read_status)->map(function ($value) { + return [ + 'id' => $value->id, + 'name' => $value->name, + 'email' => $value->email, + 'is_read' => $value->pivot->is_read, + 'pivot' => $value->pivot, + ]; + })->toArray(); + } +} diff --git a/packages/marvel/src/Http/Resources/TagResource.php b/packages/marvel/src/Http/Resources/TagResource.php new file mode 100644 index 0000000..76406e5 --- /dev/null +++ b/packages/marvel/src/Http/Resources/TagResource.php @@ -0,0 +1,30 @@ + $this->id, + 'name' => $this->name, + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + 'slug' => $this->slug, + 'details' => $this->details, + 'image' => $this->image, + 'icon' => $this->icon, + 'type' => getResourceData($this->type, []) // if you need extra data then pass key in array by second parameter + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/TermsConditionResource.php b/packages/marvel/src/Http/Resources/TermsConditionResource.php new file mode 100644 index 0000000..7947ebb --- /dev/null +++ b/packages/marvel/src/Http/Resources/TermsConditionResource.php @@ -0,0 +1,31 @@ + $this->id, + 'title' => $this->title, + 'slug' => $this->slug, + 'description' => $this->description, + 'type' => $this->type, + 'issued_by' => $this->issued_by, + 'is_approved' => $this->is_approved, + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + 'is_approved' => $this->is_approved, + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/TypeResource.php b/packages/marvel/src/Http/Resources/TypeResource.php new file mode 100644 index 0000000..ee7ce6a --- /dev/null +++ b/packages/marvel/src/Http/Resources/TypeResource.php @@ -0,0 +1,30 @@ + $this->id, + 'name' => $this->name, + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + 'slug' => $this->slug, + 'banners' => BannerResource::collection($this->banners), + 'promotional_sliders' => $this->promotional_sliders, + 'settings' => $this->settings, + 'icon' => $this->icon, + 'images' => $this->images, + ]; + } +} \ No newline at end of file diff --git a/packages/marvel/src/Http/Resources/UserResource.php b/packages/marvel/src/Http/Resources/UserResource.php new file mode 100644 index 0000000..6e2c675 --- /dev/null +++ b/packages/marvel/src/Http/Resources/UserResource.php @@ -0,0 +1,28 @@ + $this->id, + 'name' => $this->name, + 'email' => $this->email, + 'email_verified_at' => $this->email_verified_at, + 'is_active' => $this->is_active, + 'shop_id' => $this->shop_id, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/UserResourceCollection.php b/packages/marvel/src/Http/Resources/UserResourceCollection.php new file mode 100644 index 0000000..fa4a21e --- /dev/null +++ b/packages/marvel/src/Http/Resources/UserResourceCollection.php @@ -0,0 +1,19 @@ + $this->id, + 'name' => $this->name, + 'slug' => $this->slug, + 'type' => getResourceData($this->type, []), // if you need extra data then pass key in array by second parameter + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + 'product_type' => $this->product_type, + 'categories' => getResourceCollection($this->categories, []), // if you need extra data then pass key in array by second parameter + 'tags' => getResourceCollection($this->tags, []), // if you need extra data then pass key in array by second parameter + 'metas' => $this->metas, + 'digital_file' => $this->digital_file, + 'variations' => getVariations($this->variations), + 'variation_options' => $this->variation_options, + 'shop_id' => $this->shop_id, + 'shop' => getResourceData($this->shop, []), // if you need extra data then pass key in array by second parameter + 'author' => getResourceData($this->author, []), // if you need extra data then pass key in array by second parameter + 'manufacturer' => getResourceData($this->manufacturer, []), // if you need extra data then pass key in array by second parameter + 'related_products' => RelatedProductResource::collection($this->related_products), + 'description' => $this->description, + 'in_stock' => $this->in_stock, + 'is_taxable' => $this->is_taxable, + 'is_digital' => $this->is_digital, + 'is_external' => $this->is_external, + 'external_product_url' => $this->external_product_url, + 'external_product_button_text' => $this->external_product_button_text, + 'sale_price' => $this->sale_price, + 'max_price' => $this->max_price, + 'min_price' => $this->min_price, + 'ratings' => $this->ratings, + 'total_reviews' => $this->total_reviews, + 'rating_count' => $this->rating_count, + 'my_review' => $this->my_review, + 'in_wishlist' => $this->in_wishlist, + 'sku' => $this->sku, + 'gallery' => $this->gallery, + 'image' => $this->image, + 'video' => $this->video, + 'status' => $this->status, + 'height' => $this->height, + 'length' => $this->length, + 'width' => $this->width, + 'price' => $this->price, + 'quantity' => $this->quantity, + 'unit' => $this->unit, + 'in_flash_sale' => $this->in_flash_sale + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/product/ProductResource.php b/packages/marvel/src/Http/Resources/product/ProductResource.php new file mode 100644 index 0000000..ea11c4d --- /dev/null +++ b/packages/marvel/src/Http/Resources/product/ProductResource.php @@ -0,0 +1,40 @@ + $this->id, + 'name' => $this->name, + 'slug' => $this->slug, + 'type' => getResourceData($this->type, ['settings']), // if you need extra data then pass key in array by second parameter + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + 'product_type' => $this->product_type, + 'shop' => getResourceData($this->shop, []), // if you need extra data then pass key in array by second parameter + 'sale_price' => $this->sale_price, + 'max_price' => $this->max_price, + 'min_price' => $this->min_price, + 'image' => $this->image, + 'status' => $this->status, + 'price' => $this->price, + 'quantity' => $this->quantity, + 'unit' => $this->unit, + 'sku' => $this->sku, + 'sold_quantity' => $this->sold_quantity, + 'in_flash_sale' => $this->in_flash_sale, + 'visibility' => $this->visibility + ]; + } +} diff --git a/packages/marvel/src/Http/Resources/product/RelatedProductResource.php b/packages/marvel/src/Http/Resources/product/RelatedProductResource.php new file mode 100644 index 0000000..a1e1d23 --- /dev/null +++ b/packages/marvel/src/Http/Resources/product/RelatedProductResource.php @@ -0,0 +1,33 @@ + $this->id, + 'name' => $this->name, + 'slug' => $this->slug, + 'language' => $this->language, + 'translated_languages' => $this->translated_languages, + 'product_type' => $this->product_type, + 'sale_price' => $this->sale_price, + 'max_price' => $this->max_price, + 'min_price' => $this->min_price, + 'image' => $this->image, + 'video' => $this->video, + 'price' => $this->price, + 'unit' => $this->unit + ]; + } +} \ No newline at end of file diff --git a/packages/marvel/src/Jobs/SendConversationReminder.php b/packages/marvel/src/Jobs/SendConversationReminder.php new file mode 100644 index 0000000..bd9b18c --- /dev/null +++ b/packages/marvel/src/Jobs/SendConversationReminder.php @@ -0,0 +1,50 @@ +participant = $participant; + } + + /** + * Execute the job. + * + * @return void + */ + public function handle() + { + $email = new ConversationReminderMail($this->participant); + if('user' === $this->participant->type) { + Mail::to($this->participant->user->email)->send($email); + } else { + Mail::to($this->participant->shop->owner->email)->send($email); + } + + $this->participant->notify = 1; + $this->participant->save(); + } +} diff --git a/packages/marvel/src/Listeners/AppDataListener.php b/packages/marvel/src/Listeners/AppDataListener.php new file mode 100644 index 0000000..bea3a19 --- /dev/null +++ b/packages/marvel/src/Listeners/AppDataListener.php @@ -0,0 +1,41 @@ +config = $config; + } + + /** + * Handle the event. + * + * @param ProcessUserData $event + * @return void + */ + public function handle(ProcessUserData $event) + { + $last_checking_time = $this->config->getLastCheckingTime(); + $lastCheckingTimeDifferenceFromNow = Carbon::parse($last_checking_time)->diffInHours(Carbon::now()); + if ($lastCheckingTimeDifferenceFromNow < 12) return; + $key = $this->config->getPrivateKey(); + $language = isset(request()['language']) ? request()['language'] : DEFAULT_LANGUAGE; + $this->config->verify($key)->modifySettingsData($language); + } +} diff --git a/packages/marvel/src/Listeners/CheckAndSetDefaultCard.php b/packages/marvel/src/Listeners/CheckAndSetDefaultCard.php new file mode 100644 index 0000000..eb39431 --- /dev/null +++ b/packages/marvel/src/Listeners/CheckAndSetDefaultCard.php @@ -0,0 +1,38 @@ +payment_methods; + $allPaymentMethods = $this->fetchAllPaymentMethods(); + + if ($currentPaymentMethods->default_card) { + foreach ($allPaymentMethods as $key => $paymentMethod) { + if ($paymentMethod->method_key !== $currentPaymentMethods->method_key) { + $paymentMethod->default_card = false; + $paymentMethod->save(); + } + } + } + } +} diff --git a/packages/marvel/src/Listeners/CommissionRateUpdateListener.php b/packages/marvel/src/Listeners/CommissionRateUpdateListener.php new file mode 100644 index 0000000..bad3ec3 --- /dev/null +++ b/packages/marvel/src/Listeners/CommissionRateUpdateListener.php @@ -0,0 +1,51 @@ +shop; + $balance = $event->balance; + + try{ + $admins = $this->getAdminUsers(); + if($admins){ + foreach($admins as $admin){ + Mail::to($admin->email)->send(new AdminCommissionRateUpdate($shop, $balance)); + } + } + Mail::to($shop->owner->email)->send(new VendorCommissionRateUpdate($shop, $balance)); + }catch(Exception $e){ + logger("Error in CommissionRateUpdateListener! ". $e->getMessage()); + } + + + } +} diff --git a/packages/marvel/src/Listeners/DigitalProductNotifyLogs.php b/packages/marvel/src/Listeners/DigitalProductNotifyLogs.php new file mode 100644 index 0000000..c1123a2 --- /dev/null +++ b/packages/marvel/src/Listeners/DigitalProductNotifyLogs.php @@ -0,0 +1,118 @@ +product)) { + $ordered_files = DB::table('ordered_files') + ->join('digital_files', 'ordered_files.digital_file_id', '=', 'digital_files.id') + ->when($event->product['product_type'] == 'variable', function ($query) use ($event) { + $query->join('variation_options', 'digital_files.fileable_id', '=', 'variation_options.id') + ->join('products', 'products.id', '=', 'variation_options.product_id'); + }) + ->when($event->product['product_type'] == 'simple', function ($query) use ($event) { + $query->join('products', 'products.id', '=', 'digital_files.fileable_id'); + }) + ->select( + 'ordered_files.id as id', + 'ordered_files.customer_id as customer_id', + 'ordered_files.purchase_key as purchase_key', + 'ordered_files.digital_file_id as digital_file_id', + 'ordered_files.tracking_number as tracking_number' + ) + ->where('products.id', '=', $event->product->id) + ->groupBy( + 'ordered_files.id', + 'ordered_files.customer_id', + 'ordered_files.purchase_key', + 'ordered_files.digital_file_id', + 'ordered_files.tracking_number' + ) + ->get(); + + // create notify_logs for that ordered files with each purchased customer. + if (isset($ordered_files)) { + foreach ($ordered_files as $key => $value) { + // if (!NotifyLogs::where('notify_tracker', '=', $event->product->id)->where('receiver', '=', $value->customer_id)->exists()) { + NotifyLogs::create([ + 'receiver' => $value->customer_id, + 'sender' => $event->user->id, + 'notify_type' => 'product_update', + 'notify_receiver_type' => 'customer', + // 'is_read' => $event->optional_data['inform_customer'], + 'is_read' => false, + 'notify_text' => $event->optional_data['update_message'], + 'notify_tracker' => $event->product->id + ]); + + // send email to the customers + $customer = User::where('id', '=', $value->customer_id)->first(); + $customer->notify( + new DigitalProductUpdateNotification($customer, $event->product, $event->optional_data) + ); + // } + } + } + } + } + + + /** + * Determine whether the listener should be queued. + */ + // public function shouldQueue(DigitalProductUpdateEvent $event): bool + // { + // // $settings = Settings::getData(); + // // $enableDigitalProductEmail = $settings['options']['enableEmailForDigitalProduct']; + + // // return $event->order->subtotal >= 5000; + + // // return true; + + // // try { + // // $settings = Settings::first(); + // // $enableDigitalProductEmail = false; + + // // if (isset($settings['options']['enableEmailForDigitalProduct'])) { + // // if ($settings['options']['enableEmailForDigitalProduct'] === true) { + // // $enableDigitalProductEmail = true; + // // } + // // } + // // return $enableDigitalProductEmail; + // // } catch (MarvelException $th) { + // // throw new MarvelException(SOMETHING_WENT_WRONG, $th->getMessage()); + // // } + // } +} diff --git a/packages/marvel/src/Listeners/FlashSaleProductProcess.php b/packages/marvel/src/Listeners/FlashSaleProductProcess.php new file mode 100644 index 0000000..a08fb2b --- /dev/null +++ b/packages/marvel/src/Listeners/FlashSaleProductProcess.php @@ -0,0 +1,245 @@ +action; + $language = $event->language; + $current_date = date("Y-m-d"); + + if ($flash_sales_action === 'index') { + $flash_sales = FlashSale::where('language', $language)->withTrashed()->get(); + + if (isset($flash_sales)) { + foreach ($flash_sales as $key => $flash_sale) { + + if (!isset($flash_sale->deleted_at)) { + $this->processFlashSaleProducts($flash_sale); + } + + // process for time over item. + $end_date = Carbon::parse($flash_sale->end_date)->toDateString(); + + if ($current_date > $end_date) { + $this->processFlashSaleAfterExpired($flash_sale); + } + + // process for soft deleted item + if (isset($flash_sale->deleted_at)) { + $this->processSoftDeletedFlashSales($flash_sale); + } + } + } + } + + if ($flash_sales_action === 'append_attached_products') { + $this->processNewlyAddedProductInFlashSale($event->optional_data); + } + + if ($flash_sales_action === 'remove_attached_products') { + if (isset($event->optional_data['detached_product_ids'])) { + // $requested_flash_sale = $event->optional_data['requested_flash_sale']; + // $requested_flash_sale->products()->detach($event->optional_data['detached_product_ids']); + // $requested_flash_sale->save(); + $this->unsetProductFromFlashSale($event->optional_data['detached_product_ids']); + } + } + + if ($flash_sales_action === 'delete_vendor_request') { + $this->unsetProductFromFlashSale($event->optional_data['detached_products']); + } + } + + + /** + * processNewlyAddedProductInFlashSale + * + * @param mixed $products + * @return void + */ + public function processNewlyAddedProductInFlashSale($data) + { + if (isset($data['attached_product_ids'])) { + $current_date = date("Y-m-d"); + $start_date = Carbon::parse($data['requested_flash_sale']->start_date)->toDateString(); + $flash_sale = $data['requested_flash_sale']; + + foreach ($data['attached_product_ids'] as $key => $product_id) { + $product = Product::where('id', '=', $product_id)->with(['variation_options'])->first(); + + if ($current_date === $start_date) { + switch ($flash_sale->type) { + case 'percentage': + if ($product->product_type === ProductType::VARIABLE) { + foreach ($product->variation_options as $key => $variation) { + $sale_price = $variation->price - ($variation->price * ($flash_sale->rate / 100)); + Variation::where('id', $variation->id)->update(['sale_price' => $sale_price]); + } + } + + if ($product->product_type === ProductType::SIMPLE) { + $product->sale_price = $product->price - ($product->price * ($flash_sale->rate / 100)); + } + + break; + + case 'fixed_rate': + if ($product->product_type === ProductType::VARIABLE) { + foreach ($product->variation_options as $key => $variation) { + $sale_price = $variation->price - $flash_sale->rate; + $sale_price = $sale_price <= 0 ? null : $sale_price; + Variation::where('id', $variation->id)->update(['sale_price' => $sale_price]); + } + } + + if ($product->product_type === ProductType::SIMPLE) { + $sale_price = $product->price - $flash_sale->rate <= 0 ? null : $product->price - $flash_sale->rate; + $product->sale_price = $sale_price; + } + + break; + } + } + + $product->in_flash_sale = true; + $product->save(); + } + } + } + + + /** + * processFlashSaleProducts + * + * @param mixed $flash_sale + * @return void + */ + public function processFlashSaleProducts($flash_sale) + { + $current_date = date("Y-m-d"); + $start_date = Carbon::parse($flash_sale->start_date)->toDateString(); + + if (isset($flash_sale['sale_builder']['product_ids'])) { + $product_ids = $flash_sale['sale_builder']['product_ids']; + + foreach ($product_ids as $key => $product_id) { + $product = Product::where('id', '=', $product_id)->with(['variation_options'])->first(); + + if ($flash_sale->sale_status == 1) { + if ($current_date === $start_date) { + switch ($flash_sale->type) { + case 'percentage': + if ($product->product_type === ProductType::VARIABLE) { + foreach ($product->variation_options as $key => $variation) { + $sale_price = $variation->price - ($variation->price * ($flash_sale->rate / 100)); + Variation::where('id', $variation->id)->update(['sale_price' => $sale_price]); + } + } + + if ($product->product_type === ProductType::SIMPLE) { + $product->sale_price = $product->price - ($product->price * ($flash_sale->rate / 100)); + } + + break; + + case 'fixed_rate': + if ($product->product_type === ProductType::VARIABLE) { + foreach ($product->variation_options as $key => $variation) { + $sale_price = $variation->price - $flash_sale->rate; + $sale_price = $sale_price <= 0 ? null : $sale_price; + Variation::where('id', $variation->id)->update(['sale_price' => $sale_price]); + } + } + + if ($product->product_type === ProductType::SIMPLE) { + $sale_price = $product->price - $flash_sale->rate <= 0 ? null : $product->price - $flash_sale->rate; + $product->sale_price = $sale_price; + } + + break; + } + } + } + $product->in_flash_sale = true; + $product->save(); + } + } + } + + + /** + * processFlashSaleAfterExpired + * + * @param mixed $flash_sale + * @return void + */ + public function processFlashSaleAfterExpired($flash_sale) + { + $flash_sale->delete(); + $flash_sale->products()->detach($flash_sale['sale_builder']['product_ids']); + + if (isset($flash_sale['sale_builder']['product_ids'])) { + $product_ids = $flash_sale['sale_builder']['product_ids']; + $this->unsetProductFromFlashSale($product_ids); + } + } + + + /** + * processSoftDeletedFlashSales + * + * @param mixed $flash_sale + * @return void + */ + public function processSoftDeletedFlashSales($flash_sale) + { + $flash_sale->sale_status = false; + $flash_sale->products()->detach($flash_sale['sale_builder']['product_ids']); + $flash_sale->save(); + + if (isset($flash_sale['sale_builder']['product_ids'])) { + $product_ids = $flash_sale['sale_builder']['product_ids']; + $this->unsetProductFromFlashSale($product_ids); + } + } + + + /** + * unsetProductFromFlashSale + * + * @param mixed $product_ids + * @return void + */ + public function unsetProductFromFlashSale($product_ids) + { + foreach ($product_ids as $key => $product_id) { + $product = Product::where('id', '=', $product_id)->with(['variation_options'])->first(); + + if ($product->product_type === ProductType::VARIABLE) { + foreach ($product->variation_options as $key => $variation) { + Variation::where('id', $variation->id)->update(['sale_price' => null]); + } + } + + if ($product->product_type === ProductType::SIMPLE) { + $product->sale_price = null; + } + + $product->in_flash_sale = false; + $product->save(); + } + } +} diff --git a/packages/marvel/src/Listeners/MaintenanceNotification.php b/packages/marvel/src/Listeners/MaintenanceNotification.php new file mode 100644 index 0000000..d2afd6a --- /dev/null +++ b/packages/marvel/src/Listeners/MaintenanceNotification.php @@ -0,0 +1,69 @@ +language; + $settings = Settings::getData($language); + $shouldSendEmail = $this->shouldSendEmail($settings); + + if (!$shouldSendEmail) return; + + $admins = User::permission(Permission::SUPER_ADMIN)->pluck('id')->toArray(); + $users = User::permission(Permission::STORE_OWNER)->whereNotIN('id', $admins)->get(); + if ($users) { + foreach ($users as $user) { + Notification::route('mail', [ + $user->email, + ])->notify(new MaintenanceReminder($settings)); + } + } + } + + public function shouldSendEmail(Settings $settings): bool + { + $shouldSendEmail = false; + try { + $isUnderMaintenance = $settings->options['isUnderMaintenance'] ?? false; + $currentTime = now(); + $startTime = Carbon::parse($settings->options['maintenance']['start']); + + $shouldSendEmail = $isUnderMaintenance && ($currentTime < $startTime); + } catch (Exception $th) { + } + return $shouldSendEmail; + } +} diff --git a/packages/marvel/src/Listeners/ManageProductInventory.php b/packages/marvel/src/Listeners/ManageProductInventory.php new file mode 100644 index 0000000..e8da4d2 --- /dev/null +++ b/packages/marvel/src/Listeners/ManageProductInventory.php @@ -0,0 +1,63 @@ +quantity - $product->pivot->order_quantity; + if ($updatedQuantity > -1) { + if (TRANSLATION_ENABLED) { + $this->updateTranslationsInventory($product, $updatedQuantity); + } else { + Product::find($product->id)->update(['quantity' => $updatedQuantity]); + } + if (!empty($product->pivot->variation_option_id)) { + $variationOption = Variation::findOrFail($product->pivot->variation_option_id); + $variationOption->quantity = $variationOption->quantity - $product->pivot->order_quantity; + if (TRANSLATION_ENABLED) { + $this->updateVariationTranslationsInventory($variationOption, $variationOption->quantity); + } else { + $variationOption->update([['quantity' => $variationOption->quantity]]); + } + } + } + } catch (Exception $th) { + // + } + } + + public function updateTranslationsInventory($product, $updatedQuantity) + { + Product::where('sku', $product->sku)->update(['quantity' => $updatedQuantity]); + } + + public function updateVariationTranslationsInventory($variationOption, $updatedQuantity) + { + Variation::where('sku', $variationOption->sku)->update(['quantity' => $updatedQuantity]); + } + + + + /** + * Handle the event. + * + * @param OrderCreated $event + * @return void + */ + public function handle(OrderCreated $event) + { + $products = $event->order->products; + foreach ($products as $product) { + $this->updateProductInventory($product); + } + } +} diff --git a/packages/marvel/src/Listeners/MessageParticipantNotification.php b/packages/marvel/src/Listeners/MessageParticipantNotification.php new file mode 100644 index 0000000..ace2215 --- /dev/null +++ b/packages/marvel/src/Listeners/MessageParticipantNotification.php @@ -0,0 +1,27 @@ + $event->type, + 'conversation_id' => $event->conversation->id, + 'shop_id' => $event->conversation->shop->id, + 'user_id' => $event->conversation->user_id, + 'message_id' => $event->message->id, + ]); + } +} diff --git a/packages/marvel/src/Listeners/OwnershipTransferStatusControlListener.php b/packages/marvel/src/Listeners/OwnershipTransferStatusControlListener.php new file mode 100644 index 0000000..99e9d96 --- /dev/null +++ b/packages/marvel/src/Listeners/OwnershipTransferStatusControlListener.php @@ -0,0 +1,105 @@ +ownershipTransfer->status) { + case 'processing': + $this->processingOwnerShipTransferStatus($event->ownershipTransfer); + break; + + case 'approved': + $this->approvedOwnerShipTransferStatus($event->ownershipTransfer); + break; + + case 'rejected': + $this->rejectingOwnerShipTransferStatus($event->ownershipTransfer); + break; + } + } + + + public function processingOwnerShipTransferStatus($ownershipRequest) + { + // disable shop + $shop = $ownershipRequest->shop; + $shop->is_active = false; + $shop->save(); + $shop->refresh(); + // draft products + Product::where('shop_id', '=', $ownershipRequest->shop_id)->update(['status' => 'draft']); + + $message = [ + 'message' => 'Shop transfer request #' . $ownershipRequest->transaction_identifier . ' is on processing.' + ]; + $this->notificationThrowingFunction($shop, $ownershipRequest, $message); + } + + public function approvedOwnerShipTransferStatus($ownershipRequest) + { + $shop = $ownershipRequest->shop; + $shop->owner_id = $ownershipRequest->to; + $shop->save(); + $shop->refresh(); + $message = [ + 'message' => 'Congratulations! Shop transfer request #' . $ownershipRequest->transaction_identifier . ' is approved.' + ]; + $this->notificationThrowingFunction($shop, $ownershipRequest, $message); + } + + public function rejectingOwnerShipTransferStatus($ownershipRequest) + { + // disable shop + $shop = $ownershipRequest->shop; + $shop->is_active = false; + $shop->save(); + // draft products + Product::where('shop_id', '=', $ownershipRequest->shop_id)->update(['status' => 'draft']); + $message = [ + 'message' => 'Sorry! Shop transfer request #' . $ownershipRequest->transaction_identifier . ' is rejected. For more details please contact with site admin.' + ]; + $this->notificationThrowingFunction($shop, $ownershipRequest, $message); + } + + + public function notificationThrowingFunction($shop, $ownershipRequest, $message) + { + $previousOwner = User::findOrFail($ownershipRequest->from); + $newOwner = User::findOrFail($ownershipRequest->to); + $users = [...$this->getAdminUsers(), $previousOwner, $newOwner]; + if ($users) { + foreach ($users as $user) { + Notification::route('mail', [ + $user->email, + ])->notify(new TransferredShopOwnershipStatus( + $shop, + $previousOwner, + $newOwner, + $message + )); + } + } + } +} diff --git a/packages/marvel/src/Listeners/ProductInventoryDecrement.php b/packages/marvel/src/Listeners/ProductInventoryDecrement.php new file mode 100644 index 0000000..ce39008 --- /dev/null +++ b/packages/marvel/src/Listeners/ProductInventoryDecrement.php @@ -0,0 +1,91 @@ +id); + $currentQuantity = $fetchedProduct->quantity - (int) $eventData->pivot->order_quantity; + $sold_quantity = $fetchedProduct->sold_quantity + (int) $eventData->pivot->order_quantity; + + if ($currentQuantity > -1) { + + $fetchedProduct->update( + [ + 'quantity' => $currentQuantity, + 'sold_quantity' => $sold_quantity + ] + ); + + // ****** there was a cause for this condition + + // if (TRANSLATION_ENABLED) { + // $this->updateTranslationsInventory($eventData, $currentQuantity, $eventData->sold_quantity); + // } else { + // $fetchedProduct->update( + // [ + // 'quantity' => $currentQuantity, + // 'sold_quantity' => $sold_quantity + // ] + // ); + // } + + if (!empty($eventData->pivot->variation_option_id)) { + $variationOption = Variation::findOrFail($eventData->pivot->variation_option_id); + $currentVariationOptionQuantity = $variationOption->quantity - (int) $eventData->pivot->order_quantity; + $variationOptionSoldQuantity = $variationOption->sold_quantity + (int) $eventData->pivot->order_quantity; + + $variationOption->update([ + 'quantity' => $currentVariationOptionQuantity, + 'sold_quantity' => $variationOptionSoldQuantity + ]); + + // ****** there was a cause for this condition + // if (TRANSLATION_ENABLED) { + // $this->updateVariationTranslationsInventory($variationOption, $variationOption->quantity); + // } else { + // $variationOption->update([ + // 'quantity' => $currentVariationOptionQuantity, + // 'sold_quantity' => $variationOptionSoldQuantity + // ]); + // } + } + } + } catch (Exception $th) { + // + } + } + + // public function updateTranslationsInventory($product, $updatedQuantity, $sold_quantity) + // { + // Product::where('id', $product->id)->update([ + // 'quantity' => $updatedQuantity, + // 'sold_quantity' => $sold_quantity + // ]); + // } + + // public function updateVariationTranslationsInventory($variationOption, $updatedQuantity) + // { + // Variation::where('id', $variationOption->id)->update([ + // 'quantity' => $updatedQuantity, + // 'sold_quantity' => $variationOption->sold_quantity + // ]); + // } + + + public function handle($event) + { + $products = $event->order->products; + foreach ($products as $product) { + $this->updateProductInventory($product); + } + } +} \ No newline at end of file diff --git a/packages/marvel/src/Listeners/ProductInventoryRestore.php b/packages/marvel/src/Listeners/ProductInventoryRestore.php new file mode 100644 index 0000000..71ca22a --- /dev/null +++ b/packages/marvel/src/Listeners/ProductInventoryRestore.php @@ -0,0 +1,78 @@ +id); + $current_quantity = $fetchedProduct->quantity + (int) $eventData->pivot->order_quantity; + $sold_quantity = $fetchedProduct->sold_quantity - (int) $eventData->pivot->order_quantity; + + if ($current_quantity > -1) { + + $fetchedProduct->update( + [ + 'quantity' => $current_quantity, + 'sold_quantity' => $sold_quantity + ] + ); + + + // ****** there was a cause for this condition + + // if (TRANSLATION_ENABLED) { + // $this->updateTranslationsInventory($eventData, $current_quantity); + // } else { + // Product::find($eventData->id)->update(['quantity' => $current_quantity]); + // } + + if (!empty($eventData->pivot->variation_option_id)) { + $variationOption = Variation::findOrFail($eventData->pivot->variation_option_id); + $currentVariationOptionQuantity = $variationOption->quantity + (int) $eventData->pivot->order_quantity; + $variationOptionSoldQuantity = $variationOption->sold_quantity - (int) $eventData->pivot->order_quantity; + + $variationOption->update([ + 'quantity' => $currentVariationOptionQuantity, + 'sold_quantity' => $variationOptionSoldQuantity + ]); + + // ****** there was a cause for this condition + + // if (TRANSLATION_ENABLED) { + // $this->updateVariationTranslationsInventory($variationOption, $variationOption->quantity); + // } else { + // $variationOption->update([['quantity' => $variationOption->quantity]]); + // } + } + } + } catch (Exception $th) { + // + } + } + + // public function updateTranslationsInventory($product, $updatedQuantity) + // { + // Product::where('sku', $product->sku)->update(['quantity' => $updatedQuantity]); + // } + + // public function updateVariationTranslationsInventory($variationOption, $updatedQuantity) + // { + // Variation::where('sku', $variationOption->sku)->update(['quantity' => $updatedQuantity]); + // } + + public function handle($event) + { + $products = $event->order->products; + foreach ($products as $product) { + $this->updateProductInventory($product); + } + } +} diff --git a/packages/marvel/src/Listeners/ProductReviewApprovedListener.php b/packages/marvel/src/Listeners/ProductReviewApprovedListener.php new file mode 100644 index 0000000..e5088d1 --- /dev/null +++ b/packages/marvel/src/Listeners/ProductReviewApprovedListener.php @@ -0,0 +1,22 @@ +product->shop->owner; + $vendor->notify(new ProductApprovedNotification($event->product)); + } +} diff --git a/packages/marvel/src/Listeners/ProductReviewRejectedListener.php b/packages/marvel/src/Listeners/ProductReviewRejectedListener.php new file mode 100644 index 0000000..d60edaf --- /dev/null +++ b/packages/marvel/src/Listeners/ProductReviewRejectedListener.php @@ -0,0 +1,22 @@ +product->shop->owner; + $vendor->notify(new ProductRejectedNotification($event->product)); + } +} diff --git a/packages/marvel/src/Listeners/RatingRemoved.php b/packages/marvel/src/Listeners/RatingRemoved.php new file mode 100644 index 0000000..5962afb --- /dev/null +++ b/packages/marvel/src/Listeners/RatingRemoved.php @@ -0,0 +1,30 @@ +refund->customer_id)->where('order_id', $event->refund->order_id)->delete(); + } +} diff --git a/packages/marvel/src/Listeners/Refund/SendRefundRequestedNotification.php b/packages/marvel/src/Listeners/Refund/SendRefundRequestedNotification.php new file mode 100644 index 0000000..d50007d --- /dev/null +++ b/packages/marvel/src/Listeners/Refund/SendRefundRequestedNotification.php @@ -0,0 +1,40 @@ +refund; + $customer = $refund->customer; + $order = $refund->order; + $emailReceiver = $this->getWhichUserWillGetEmail(EventType::ORDER_REFUND, $order->language); + if ($emailReceiver['admin']) { + $admins = $this->adminList(); + foreach ($admins as $admin) { + $admin->notify(new RefundRequested($refund, 'admin')); + } + } + if ($emailReceiver['customer']) { + $customer->notify(new RefundRequested($refund, 'customer')); + } + $this->sendRefundRequestedSms($refund); + } +} diff --git a/packages/marvel/src/Listeners/Refund/SendRefundUpdateNotification.php b/packages/marvel/src/Listeners/Refund/SendRefundUpdateNotification.php new file mode 100644 index 0000000..e2ed53e --- /dev/null +++ b/packages/marvel/src/Listeners/Refund/SendRefundUpdateNotification.php @@ -0,0 +1,38 @@ +refund; + $order = $refund->order; + if ($order->parent_id) return; + $emailReceiver = $this->getWhichUserWillGetEmail(EventType::ORDER_REFUND, $event->refund->order->language); + + if ($emailReceiver['customer'] && $refund->customer()) { + $refund->customer->notify(new RefundUpdate($refund, 'customer')); + } + + if ($emailReceiver['admin']) { + $admins = $this->adminList(); + foreach ($admins as $admin) { + $admin->notify(new RefundUpdate($refund, 'admin')); + } + } + } +} diff --git a/packages/marvel/src/Listeners/SendMessageNotification.php b/packages/marvel/src/Listeners/SendMessageNotification.php new file mode 100644 index 0000000..a8bf7e3 --- /dev/null +++ b/packages/marvel/src/Listeners/SendMessageNotification.php @@ -0,0 +1,64 @@ +message->id)->first(); + + if (null === $participant->last_read) { + if (0 === $participant->notify) { + if ('user' == $event->type) { + $user = User::findOrFail($event->conversation->user_id); + $notification = isset($user->profile->notifications) ? $user->profile->notifications : null; + if (empty($notification)) { + $notification['enable'] = 1; + $notification['email'] = $user->email; + } + } else { + $shop = Shop::findOrFail($event->conversation->shop_id); + $notification = json_decode($shop->notifications, true); + if (empty($notification)) { + $notification['enable'] = 1; + $notification['email'] = $shop->owner->email; + } + } + if (1 == $notification["enable"]) { + Notification::route('mail', [ + $notification["email"], + ])->notify(new MessageReminder($participant)); + + $participant->notify = 1; + $participant->save(); + } + } + } + } +} diff --git a/packages/marvel/src/Listeners/SendOrderCancelledNotification.php b/packages/marvel/src/Listeners/SendOrderCancelledNotification.php new file mode 100644 index 0000000..255703c --- /dev/null +++ b/packages/marvel/src/Listeners/SendOrderCancelledNotification.php @@ -0,0 +1,62 @@ +getWhichUserWillGetEmail(EventType::ORDER_CANCELLED, $event->order->language); + if ($emailReceiver['customer'] && $event->order->customer && $event->order->parent_id == null) { + $event->order->customer->notify(new OrderCancelledNotification($event->order)); + } + if ($emailReceiver['vendor']) { + if ($event->order->parent_id == null) { + + foreach ($event->order->children as $key => $child_order) { + try { + $vendor_id = $child_order->shop->owner_id; + $vendor = User::find($vendor_id); + $vendor->notify(new OrderCancelledNotification($event->order)); + } catch (Exception $exception) { + //Log::error($exception->getMessage()); + } + } + } else { + try { + $vendor_id = $event->order->shop->owner_id; + $vendor = User::find($vendor_id); + $vendor->notify(new OrderCancelledNotification($event->order)); + } catch (Exception $exception) { + // + } + } + } + if ($emailReceiver['admin']) { + $admins = $this->adminList(); + foreach ($admins as $key => $admin) { + + $admin->notify(new OrderCancelledNotification($event->order)); + } + } + $this->sendOrderCancelSms($event->order); + } +} diff --git a/packages/marvel/src/Listeners/SendOrderCreationNotification.php b/packages/marvel/src/Listeners/SendOrderCreationNotification.php new file mode 100644 index 0000000..241fb72 --- /dev/null +++ b/packages/marvel/src/Listeners/SendOrderCreationNotification.php @@ -0,0 +1,39 @@ +order; + $customer = $event->order->customer; + $emailReceiver = $this->getWhichUserWillGetEmail(EventType::ORDER_CREATED, $order->language); + if ($customer && $emailReceiver['customer'] && $order->parent_id == null) { + $customer->notify(new OrderPlacedSuccessfully($event->invoiceData)); + } + if ($emailReceiver['admin']) { + $admins = $this->adminList(); + foreach ($admins as $admin) { + $admin->notify(new NewOrderReceived($order, 'admin')); + } + } + $this->sendOrderCreationSms($order); + } +} diff --git a/packages/marvel/src/Listeners/SendOrderDeliveredNotification.php b/packages/marvel/src/Listeners/SendOrderDeliveredNotification.php new file mode 100644 index 0000000..683ea80 --- /dev/null +++ b/packages/marvel/src/Listeners/SendOrderDeliveredNotification.php @@ -0,0 +1,51 @@ +order; + $emailReceiver = $this->getWhichUserWillGetEmail(EventType::ORDER_DELIVERED, $order->language); + if ($emailReceiver['customer'] && $order->customer && $order->parent_id == null) { + $order->customer->notify(new OrderDeliveredNotification($order)); + } + if ($emailReceiver['vendor']) { + if ($order->parent_id) { + try { + $vendor_id = $order->shop->owner_id; + $vendor = User::findOrFail($vendor_id); + $vendor->notify(new OrderDeliveredNotification($order)); + } catch (Exception $exception) { + // + } + } + } + if ($emailReceiver['admin']) { + $admins = $this->adminList(); + foreach ($admins as $key => $admin) { + $admin->notify(new OrderDeliveredNotification($order)); + } + } + $this->sendOrderDeliveredSms($order); + } +} diff --git a/packages/marvel/src/Listeners/SendOrderReceivedNotification.php b/packages/marvel/src/Listeners/SendOrderReceivedNotification.php new file mode 100644 index 0000000..733aa0c --- /dev/null +++ b/packages/marvel/src/Listeners/SendOrderReceivedNotification.php @@ -0,0 +1,28 @@ +getWhichUserWillGetEmail(EventType::ORDER_CREATED, $event->order->language); + if ($emailReceiver['vendor']) { + $vendor = $event->order->shop->owner; + $vendor->notify(new NewOrderReceived($event->order)); + } + } +} diff --git a/packages/marvel/src/Listeners/SendOrderStatusChangedNotification.php b/packages/marvel/src/Listeners/SendOrderStatusChangedNotification.php new file mode 100644 index 0000000..60efd0a --- /dev/null +++ b/packages/marvel/src/Listeners/SendOrderStatusChangedNotification.php @@ -0,0 +1,49 @@ +order; + $customer = $event->order->customer; + + + $this->sendOrderStatusChangeSms($order); + $emailReceiver = $this->getWhichUserWillGetEmail(EventType::ORDER_STATUS_CHANGED, $order->language ?? DEFAULT_LANGUAGE); + if ($emailReceiver['vendor'] && $order->parent_id != null) { + $vendor_id = $order->shop->owner_id; + $vendor = User::find($vendor_id); + + if ($vendor) + $vendor->notify(new OrderStatusChangedNotification($event->order)); + } + if ($emailReceiver['customer'] && $order->parent_id == null) { + $customer->notify(new OrderStatusChangedNotification($event->order)); + } + if ($emailReceiver['admin']) { + $admins = $this->adminList(); + foreach ($admins as $key => $admin) { + $admin->notify(new OrderStatusChangedNotification($order)); + } + } + } +} diff --git a/packages/marvel/src/Listeners/SendPaymentFailedNotification.php b/packages/marvel/src/Listeners/SendPaymentFailedNotification.php new file mode 100644 index 0000000..50ad6b8 --- /dev/null +++ b/packages/marvel/src/Listeners/SendPaymentFailedNotification.php @@ -0,0 +1,40 @@ +getWhichUserWillGetEmail(EventType::ORDER_PAYMENT_FAILED, $event->order->language ?? DEFAULT_LANGUAGE); + if ($emailReceiver['vendor']) { + foreach ($event->order->children as $key => $child_order) { + $vendor_id = $child_order->shop->owner_id; + $vendor = User::findOrFail($vendor_id); + $vendor->notify(new PaymentFailedNotification($event->order)); + } + } + + if ($emailReceiver['customer']) { + $customer = $event->order->customer; + $customer?->notify(new PaymentFailedNotification($event->order)); + } + $this->sendPaymentFailedSms($event->order); + } +} diff --git a/packages/marvel/src/Listeners/SendPaymentSuccessNotification.php b/packages/marvel/src/Listeners/SendPaymentSuccessNotification.php new file mode 100644 index 0000000..a1d2aed --- /dev/null +++ b/packages/marvel/src/Listeners/SendPaymentSuccessNotification.php @@ -0,0 +1,42 @@ +getWhichUserWillGetEmail(EventType::ORDER_PAYMENT_SUCCESS, $event->order->language ?? DEFAULT_LANGUAGE); + if ($emailReceiver['vendor']) { + foreach ($event->order->children as $key => $child_order) { + $vendor_id = $child_order->shop->owner_id; + $vendor = User::findOrFail($vendor_id); + $vendor->notify(new PaymentSuccessfulNotification($event->order)); + } + } + + $customer = $event->order->customer; + if (isset($customer) && $emailReceiver['customer']) { + $customer->notify(new PaymentSuccessfulNotification($event->order)); + } + + + $this->sendPaymentDoneSuccessfullySms($event->order); + } +} diff --git a/packages/marvel/src/Listeners/SendQuestionAnsweredNotification.php b/packages/marvel/src/Listeners/SendQuestionAnsweredNotification.php new file mode 100644 index 0000000..cbd56ac --- /dev/null +++ b/packages/marvel/src/Listeners/SendQuestionAnsweredNotification.php @@ -0,0 +1,30 @@ +getWhichUserWillGetEmail(EventType::QUESTION_ANSWERED, $event->question->language ?? DEFAULT_LANGUAGE); + if ($emailReceiver['customer'] && $event->question->customer) { + $customer = User::findOrFail($event->question->user_id); + $customer->notify(new NotifyQuestionAnswered($event->question)); + } + } +} diff --git a/packages/marvel/src/Listeners/SendReviewNotification.php b/packages/marvel/src/Listeners/SendReviewNotification.php new file mode 100644 index 0000000..a76f87f --- /dev/null +++ b/packages/marvel/src/Listeners/SendReviewNotification.php @@ -0,0 +1,33 @@ +getWhichUserWillGetEmail(EventType::REVIEW_CREATED, $event->review->language ?? DEFAULT_LANGUAGE); + if ($emailReceiver['vendor']) { + $shop_id = $event->review->shop_id; + $shop = Shop::with('owner')->findOrFail($shop_id); + $shop_owner = $shop->owner; + $shop_owner->notify(new NewReviewCreated($event->review)); + } + } +} diff --git a/packages/marvel/src/Listeners/ShopMaintenanceListener.php b/packages/marvel/src/Listeners/ShopMaintenanceListener.php new file mode 100644 index 0000000..69ac668 --- /dev/null +++ b/packages/marvel/src/Listeners/ShopMaintenanceListener.php @@ -0,0 +1,68 @@ +action; + $shop = $event->shop; + + + $shopOwnerAndStaff = User::where(function ($query) use ($shop) { + $query->where('id', $shop->owner_id) + ->orWhere('shop_id', $shop->id); + }) + ->get(); + + $adminUsers = $this->getAdminUsers(); + + // Merge admin users and shop owner/staff + $users = $adminUsers->merge($shopOwnerAndStaff); + + + $start = Carbon::parse($event->shop->settings['shopMaintenance']['start'])->toDayDateTimeString(); + $until = Carbon::parse($event->shop->settings['shopMaintenance']['until'])->toDayDateTimeString(); + if ($action === 'enable') { + $message = $shop->name . ' shop is going under maintenance'; + $body = "Due to our regular shop maintenance, this shop will be down from $start to $until ."; + } elseif ($action === 'start') { + $message = $shop->name . ' shop maintenance period is started'; + $body = "Due to our regular store maintenance, this store maintenance period has started from $start to $until ."; + + }else { + $message = $shop->name . ' shop maintenance period is over'; + $body = "Due to our regular store maintenance, this store maintenance is over from $start to $until."; + + } + + if ($users) { + foreach ($users as $user) { + Notification::route('mail', [ + $user->email, + ])->notify(new ShopMaintenanceNotification( + $shop, + $body, + $message + )); + } + } + } +} diff --git a/packages/marvel/src/Listeners/StoreNoticeListener.php b/packages/marvel/src/Listeners/StoreNoticeListener.php new file mode 100644 index 0000000..3e70a95 --- /dev/null +++ b/packages/marvel/src/Listeners/StoreNoticeListener.php @@ -0,0 +1,43 @@ +whereIn('name', [Permission::SUPER_ADMIN]); + })->get(); + + if (!empty($users)) { + foreach ($users as $user) { + $user->notify(new StoreNoticeNotification($event->storeNotice, $event->action)); + } + } + } +} diff --git a/packages/marvel/src/Listeners/StoredMessagedNotifyLogsListener.php b/packages/marvel/src/Listeners/StoredMessagedNotifyLogsListener.php new file mode 100644 index 0000000..85f8290 --- /dev/null +++ b/packages/marvel/src/Listeners/StoredMessagedNotifyLogsListener.php @@ -0,0 +1,67 @@ +type) { + case 'shop': + // save notification for vendor + $shop_owner = Shop::findOrFail($event->conversation->shop_id); + NotifyLogs::create([ + 'receiver' => $shop_owner->owner_id, + 'sender' => $event->user->id, + 'notify_type' => 'message', + 'notify_receiver_type' => 'vendor', + 'is_read' => false, + 'notify_text' => mb_substr($event->message->body, 0, 15) . '...', + 'notify_tracker' => $event->conversation->id + ]); + + break; + + case 'user': + // save notification for admin + $admins = $this->getAdminUsers(); + if (isset($admins)) { + foreach ($admins as $key => $admin) { + NotifyLogs::create([ + 'receiver' => $admin->id, + 'sender' => $event->user->id, + 'notify_type' => 'message', + 'notify_receiver_type' => 'admin', + 'is_read' => false, + 'notify_text' => mb_substr($event->message->body, 0, 15) . '...', + 'notify_tracker' => $event->conversation->id + ]); + } + } + break; + } + } +} diff --git a/packages/marvel/src/Listeners/StoredOrderNotifyLogsListener.php b/packages/marvel/src/Listeners/StoredOrderNotifyLogsListener.php new file mode 100644 index 0000000..717fb72 --- /dev/null +++ b/packages/marvel/src/Listeners/StoredOrderNotifyLogsListener.php @@ -0,0 +1,64 @@ +getAdminUsers(); + if (isset($admins)) { + foreach ($admins as $key => $admin) { + NotifyLogs::create([ + 'receiver' => $admin->id, + 'sender' => isset($event->user) ? $event->order->customer_id : null, + 'notify_type' => 'order', + 'notify_receiver_type' => 'admin', + 'is_read' => false, + 'notify_text' => 'One new order created. Order ID : ' . $event->order->tracking_number, + 'notify_tracker' => $event->order->tracking_number + ]); + } + } + + + // save notification for vendor + $child_order = Order::where('tracking_number', '=', $event->order->tracking_number)->with('children')->firstOrFail(); + foreach ($child_order->children as $key => $single_order) { + $vendor_shop = Shop::findOrFail($single_order->shop_id); + NotifyLogs::create([ + 'receiver' => $vendor_shop->owner_id, + 'sender' => isset($event->user) ? $single_order->customer_id : null, + 'notify_type' => 'order', + 'notify_receiver_type' => 'vendor', + 'is_read' => false, + 'notify_text' => 'One new order created. Order ID : ' . $single_order->tracking_number, + 'notify_tracker' => $single_order->tracking_number + ]); + } + } +} diff --git a/packages/marvel/src/Listeners/StoredStoreNoticeNotifyLogsListener.php b/packages/marvel/src/Listeners/StoredStoreNoticeNotifyLogsListener.php new file mode 100644 index 0000000..f05b2ee --- /dev/null +++ b/packages/marvel/src/Listeners/StoredStoreNoticeNotifyLogsListener.php @@ -0,0 +1,47 @@ +storeNotice->users)) { + foreach ($event->storeNotice->users as $key => $user) { + NotifyLogs::create([ + 'receiver' => $user->id, + 'sender' => $event->user->id, + 'notify_type' => 'store_notice', + 'notify_receiver_type' => 'vendor', + 'is_read' => false, + 'notify_text' => mb_substr($event->storeNotice->notice, 0, 15) . '...', + 'notify_tracker' => $event->storeNotice->id + ]); + } + } + } +} diff --git a/packages/marvel/src/Listeners/TransferredShopOwnershipNotification.php b/packages/marvel/src/Listeners/TransferredShopOwnershipNotification.php new file mode 100644 index 0000000..ccd944c --- /dev/null +++ b/packages/marvel/src/Listeners/TransferredShopOwnershipNotification.php @@ -0,0 +1,55 @@ +shop; + $previousOwner = $event->previousOwner; + $newOwner = $event->newOwner; + $users = [...$this->getAdminUsers(), $previousOwner, $newOwner]; + if ($users) { + foreach ($users as $user) { + Notification::route('mail', [ + $user->email, + ])->notify(new TransferredShopOwnership( + $shop, + $previousOwner, + $newOwner, + $event->optional + )); + } + } + } catch (\Throwable $th) { + Log::error("Error from TransferredShopOwnershipNotification: " . $th->getMessage()); + } + } +} diff --git a/packages/marvel/src/Mail/AdminCommissionRateUpdate.php b/packages/marvel/src/Mail/AdminCommissionRateUpdate.php new file mode 100644 index 0000000..417a05d --- /dev/null +++ b/packages/marvel/src/Mail/AdminCommissionRateUpdate.php @@ -0,0 +1,42 @@ +shop = $shop; + $this->balance = $balance; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this->markdown('emails.order.admin-commission-rate-update'); + } +} diff --git a/packages/marvel/src/Mail/ContactAdmin.php b/packages/marvel/src/Mail/ContactAdmin.php new file mode 100644 index 0000000..bc9581a --- /dev/null +++ b/packages/marvel/src/Mail/ContactAdmin.php @@ -0,0 +1,35 @@ +details = $details; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this->from($this->details['email'])->markdown('emails.contact-admin'); + } +} diff --git a/packages/marvel/src/Mail/ForgetPassword.php b/packages/marvel/src/Mail/ForgetPassword.php new file mode 100644 index 0000000..77cc31f --- /dev/null +++ b/packages/marvel/src/Mail/ForgetPassword.php @@ -0,0 +1,35 @@ +token = $token; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this->markdown('emails.forget-password'); + } +} diff --git a/packages/marvel/src/Mail/VendorCommissionRateUpdate.php b/packages/marvel/src/Mail/VendorCommissionRateUpdate.php new file mode 100644 index 0000000..5c0b27e --- /dev/null +++ b/packages/marvel/src/Mail/VendorCommissionRateUpdate.php @@ -0,0 +1,42 @@ +shop = $shop; + $this->balance = $balance; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this->markdown('emails.order.vendor-commission-rate-update'); + } +} diff --git a/packages/marvel/src/Notifications/DigitalProductUpdateNotification.php b/packages/marvel/src/Notifications/DigitalProductUpdateNotification.php new file mode 100644 index 0000000..2cde2e7 --- /dev/null +++ b/packages/marvel/src/Notifications/DigitalProductUpdateNotification.php @@ -0,0 +1,79 @@ +user = $user; + $this->product = $product; + $this->optional_message = $optional_message; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + return (new MailMessage) + ->subject('New product update is available.') + ->markdown( + 'products.digital_product.update', + [ + 'user' => $this->user, + 'product' => $this->product, + 'url' => config('shop.shop_url') . '/products/' . $this->product->slug, + 'optional_message' => $this->optional_message, + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/MaintenanceReminder.php b/packages/marvel/src/Notifications/MaintenanceReminder.php new file mode 100644 index 0000000..2ade889 --- /dev/null +++ b/packages/marvel/src/Notifications/MaintenanceReminder.php @@ -0,0 +1,75 @@ +settings = $settings; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + $url = config('shop.dashboard_url'); + $start = Carbon::parse($this->settings->options['maintenance']['start'])->toFormattedDateString(); + $until = Carbon::parse($this->settings->options['maintenance']['until'])->toFormattedDateString(); + return (new MailMessage) + ->subject(APP_NOTICE_DOMAIN . ' Maintenance Reminder') + ->priority(1) + ->markdown( + 'emails.maintenance.reminder', + [ + 'start' => $start, + 'until' => $until, + 'url' => $url + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/MessageReminder.php b/packages/marvel/src/Notifications/MessageReminder.php new file mode 100644 index 0000000..845cf4c --- /dev/null +++ b/packages/marvel/src/Notifications/MessageReminder.php @@ -0,0 +1,67 @@ +participant = $participant; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + $prefix = ($this->participant->type === 'user') ? 'message' : 'shop-message'; + $url = config('shop.dashboard_url') . '/'.$prefix.'/' . $this->participant->conversation_id; + + return (new MailMessage) + ->markdown('emails.message.reminder', ['participant' => $this->participant, 'url' => $url]); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/NewOrderProcessed.php b/packages/marvel/src/Notifications/NewOrderProcessed.php new file mode 100644 index 0000000..e66d3c1 --- /dev/null +++ b/packages/marvel/src/Notifications/NewOrderProcessed.php @@ -0,0 +1,69 @@ +order = $order; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + return (new MailMessage) + ->subject('New Order is Processed!') + ->markdown( + 'emails.order.order-processed', + [ + 'order' => $this->order, + 'url' => config('shop.dashboard_url') . $this->order->shop->slug . '/orders/' . $this->order->id + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/NewOrderReceived.php b/packages/marvel/src/Notifications/NewOrderReceived.php new file mode 100644 index 0000000..3111ea8 --- /dev/null +++ b/packages/marvel/src/Notifications/NewOrderReceived.php @@ -0,0 +1,80 @@ +order = $order; + $this->receiver = $receiver; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + App::setLocale($this->order->language ?? DEFAULT_LANGUAGE); + $customer = $this->order->customer ?? null; + if (!$customer) { + $customer = 'Guest Customer'; + } else { + $customer = $customer->name; + } + if ($this->receiver == 'admin') { + $subject = __('sms.order.orderCreated.admin.subject'); + $url = config('shop.dashboard_url') . '/orders/' . $this->order->id; + } else { + $subject = __('sms.order.orderCreated.storeOwner.subject'); + $url = config('shop.dashboard_url') . $this->order->shop->slug . '/orders/' . $this->order->id; + } + return (new MailMessage) + ->subject($subject) + ->markdown('emails.order.order-received', ['order' => $this->order, 'customer' => $customer, 'receiver' => $this->receiver, 'url' => $url]); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/NewReviewCreated.php b/packages/marvel/src/Notifications/NewReviewCreated.php new file mode 100644 index 0000000..9d0048f --- /dev/null +++ b/packages/marvel/src/Notifications/NewReviewCreated.php @@ -0,0 +1,70 @@ +review = $review; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + $url = ''; + $product = Product::findOrFail($this->review->product_id); + if( $product) { + $url = config('shop.shop_url') . '/products/' . $product->slug; + } + return (new MailMessage) + ->markdown('emails.review.created', ['review' => $this->review, 'url' => $url, 'product' => $product]); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/NotifyQuestionAnswered.php b/packages/marvel/src/Notifications/NotifyQuestionAnswered.php new file mode 100644 index 0000000..0ce89c8 --- /dev/null +++ b/packages/marvel/src/Notifications/NotifyQuestionAnswered.php @@ -0,0 +1,71 @@ +question = $question; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + $url = ''; + $product = Product::findOrFail($this->question->product_id); + if( $product) { + $url = config('shop.shop_url') . '/products/' . $product->slug; + } + + return (new MailMessage) + ->markdown('emails.question.answered', ['question' => $this->question, 'url' => $url, 'product' => $product]); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/OrderCancelledNotification.php b/packages/marvel/src/Notifications/OrderCancelledNotification.php new file mode 100644 index 0000000..fd74054 --- /dev/null +++ b/packages/marvel/src/Notifications/OrderCancelledNotification.php @@ -0,0 +1,72 @@ +order = $order; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + App::setLocale($this->order->language); + return (new MailMessage) + ->subject(__('sms.order.cancelOrder.admin.subject')) + ->markdown( + 'emails.order.order-cancelled', + [ + 'order' => $this->order, + 'url' => config('shop.shop_url') . '/orders/' . $this->order->tracking_number + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/OrderDeliveredNotification.php b/packages/marvel/src/Notifications/OrderDeliveredNotification.php new file mode 100644 index 0000000..5057065 --- /dev/null +++ b/packages/marvel/src/Notifications/OrderDeliveredNotification.php @@ -0,0 +1,70 @@ +order = $order; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + return (new MailMessage) + ->subject('Order was delivered') + ->markdown( + 'emails.order.order-delivered', + [ + 'order' => $this->order, + 'url' => config('shop.shop_url') . '/orders/' . $this->order->tracking_number + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/OrderPlacedSuccessfully.php b/packages/marvel/src/Notifications/OrderPlacedSuccessfully.php new file mode 100644 index 0000000..d43c875 --- /dev/null +++ b/packages/marvel/src/Notifications/OrderPlacedSuccessfully.php @@ -0,0 +1,75 @@ +invoiceData = $invoiceData; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + App::setLocale($this->invoiceData['language'] ?? DEFAULT_LANGUAGE); + $invoiceData = $this->invoiceData; + $pdf = PDF::loadView('pdf.order-invoice', $invoiceData); + $options = new Options(); + $options->setIsPhpEnabled(true); + $options->setIsJavascriptEnabled(true); + $pdf->getDomPDF()->setOptions($options); + + return (new MailMessage) + ->subject(__('sms.order.orderCreated.customer.subject')) + ->markdown('emails.order.order-invoice', $invoiceData) + ->attachData($pdf->output(), 'invoice.pdf'); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/OrderStatusChangedNotification.php b/packages/marvel/src/Notifications/OrderStatusChangedNotification.php new file mode 100644 index 0000000..c827169 --- /dev/null +++ b/packages/marvel/src/Notifications/OrderStatusChangedNotification.php @@ -0,0 +1,71 @@ +order = $order; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + App::setLocale($this->order->language ?? DEFAULT_LANGUAGE); + return (new MailMessage) + ->subject(__('sms.order.statusChangeOrder.admin.subject')) + ->markdown( + 'emails.order.order-status-changed', + [ + 'order' => $this->order, + 'url' => config('shop.shop_url') . '/orders/' . $this->order->tracking_number + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/PaymentFailedNotification.php b/packages/marvel/src/Notifications/PaymentFailedNotification.php new file mode 100644 index 0000000..5b21a49 --- /dev/null +++ b/packages/marvel/src/Notifications/PaymentFailedNotification.php @@ -0,0 +1,71 @@ +order = $order; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + App::setLocale($this->order->language ?? DEFAULT_LANGUAGE); + return (new MailMessage) + ->subject(__('sms.order.paymentFailedOrder.admin.subject')) + ->markdown( + 'emails.payment.payment-failed', + [ + 'order' => $this->order, + 'url' => config('shop.shop_url') . '/orders/' . $this->order->tracking_number + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/PaymentSuccessfulNotification.php b/packages/marvel/src/Notifications/PaymentSuccessfulNotification.php new file mode 100644 index 0000000..dc9fc95 --- /dev/null +++ b/packages/marvel/src/Notifications/PaymentSuccessfulNotification.php @@ -0,0 +1,71 @@ +order = $order; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + App::setLocale($this->order->language ?? DEFAULT_LANGUAGE); + return (new MailMessage) + ->subject(__('sms.order.paymentSuccessOrder.admin.subject')) + ->markdown( + 'emails.payment.payment-successful', + [ + 'order' => $this->order, + 'url' => config('shop.shop_url') . '/orders/' . $this->order->tracking_number + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/ProductApprovedNotification.php b/packages/marvel/src/Notifications/ProductApprovedNotification.php new file mode 100644 index 0000000..a9a93b7 --- /dev/null +++ b/packages/marvel/src/Notifications/ProductApprovedNotification.php @@ -0,0 +1,68 @@ +product = $product; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + return (new MailMessage) + ->subject('Product Approved') + ->markdown('emails.product.product-approved', + [ + 'name' => $this->product->name, + 'url' => config('shop.shop_url') . '/products/' . $this->product->slug .'/edit' + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/ProductRejectedNotification.php b/packages/marvel/src/Notifications/ProductRejectedNotification.php new file mode 100644 index 0000000..ba9b201 --- /dev/null +++ b/packages/marvel/src/Notifications/ProductRejectedNotification.php @@ -0,0 +1,68 @@ +product = $product; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + return (new MailMessage) + ->subject('Product Rejected') + ->markdown('emails.product.product-rejected', + [ + 'name' => $this->product->name, + 'url' => config('shop.shop_url') . '/products/' . $this->product->slug .'/edit' + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/RefundRequested.php b/packages/marvel/src/Notifications/RefundRequested.php new file mode 100644 index 0000000..c4000eb --- /dev/null +++ b/packages/marvel/src/Notifications/RefundRequested.php @@ -0,0 +1,90 @@ +refund = $refund; + $this->receiver = $receiver; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + $order = $this->refund->order; + App::setLocale($order->language ?? DEFAULT_LANGUAGE); + if ($this->receiver == 'admin') { + $subject = __('sms.order.refundRequested.admin.subject'); + $url = config('shop.dashboard_url') . '/refunds/' . $this->refund->id; + return (new MailMessage) + ->subject($subject) + ->markdown('emails.refund.refund-updated', [ + 'order' => $order, + 'refund' => $this->refund, + 'url' => $url, + 'receiver' => $this->receiver + ]); + } else { + $subject = __('sms.order.refundRequested.customer.subject'); + $url = config('shop.shop_url') . '/orders/' . $order->tracking_id; + return (new MailMessage) + ->subject($subject) + ->markdown('emails.refund.refund-requested', [ + 'order' => $order, + 'refund' => $this->refund, + 'url' => $url, + 'receiver' => $this->receiver + ]); + } + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/RefundUpdate.php b/packages/marvel/src/Notifications/RefundUpdate.php new file mode 100644 index 0000000..94fbe18 --- /dev/null +++ b/packages/marvel/src/Notifications/RefundUpdate.php @@ -0,0 +1,93 @@ +refund = $refund; + $this->receiver = $receiver; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + $order = $this->refund->order; + App::setLocale($order->language ?? DEFAULT_LANGUAGE); + $status = " **" . $this->refund->status . "** "; + if ($this->receiver == 'admin') { + $subject = __('sms.order.refundStatusChange.admin.subject'); + $url = config('shop.dashboard_url') . '/orders/' . $order->id; + return (new MailMessage) + ->subject($subject) + ->markdown('emails.refund.refund-updated', [ + 'order' => $order, + 'refund' => $this->refund, + 'status' => $status, + 'url' => $url, + 'receiver' => $this->receiver + ]); + } else { + $subject = __('sms.order.refundStatusChange.customer.subject'); + $url = config('shop.dashboard_url') . '/orders/' . $order->id; + return (new MailMessage) + ->subject($subject) + ->markdown('emails.refund.refund-updated', [ + 'order' => $order, + 'refund' => $this->refund, + 'url' => $url, + 'status' => $status, + 'receiver' => $this->receiver + ]); + } + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/ShopMaintenanceNotification.php b/packages/marvel/src/Notifications/ShopMaintenanceNotification.php new file mode 100644 index 0000000..e042d42 --- /dev/null +++ b/packages/marvel/src/Notifications/ShopMaintenanceNotification.php @@ -0,0 +1,81 @@ +shop = $shop; + $this->body = $body; + $this->message = $message; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + $url = config('shop.dashboard_url'); + // $start = Carbon::parse($this->shop->settings['shopMaintenance']['start'])->toFormattedDateString(); + // $until = Carbon::parse($this->shop->settings['shopMaintenance']['until'])->toFormattedDateString(); + return (new MailMessage) + ->subject(APP_NOTICE_DOMAIN . ' Shop Maintenance Reminder') + ->priority(1) + ->markdown( + 'emails.maintenance.shop-maintenance', + [ + 'message' => $this->message, + 'body' => $this->body, + 'url' => $url . '/' . $this->shop->slug + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/StoreNoticeNotification.php b/packages/marvel/src/Notifications/StoreNoticeNotification.php new file mode 100644 index 0000000..94e2722 --- /dev/null +++ b/packages/marvel/src/Notifications/StoreNoticeNotification.php @@ -0,0 +1,77 @@ +storeNotice = $storeNotice; + $this->action = $action; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return MailMessage + */ + public function toMail($notifiable) + { + if ($this->storeNotice->creator->hasPermissionTo(Permission::SUPER_ADMIN)) { + $role = "Admin"; + } else { + $role = "Shop Owner"; + } + + return (new MailMessage) + ->subject('Notice From ' . $role . '.') + ->markdown('emails.storeNotice.storeNotice', [ + 'notice' => $this->storeNotice, + 'action' => $this->action, + 'role' => $role, + ]); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/TransferredShopOwnership.php b/packages/marvel/src/Notifications/TransferredShopOwnership.php new file mode 100644 index 0000000..05ca019 --- /dev/null +++ b/packages/marvel/src/Notifications/TransferredShopOwnership.php @@ -0,0 +1,92 @@ +shop = $shop; + $this->previousOwner = $previousOwner; + $this->newOwner = $newOwner; + $this->optional = $optional; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + $url = config('shop.dashboard_url') . "/{$this->shop->slug}"; + $shopName = $this->shop->name; + $newOwnerName = $this->newOwner->name; + $previousOwnerName = $this->previousOwner->name; + return (new MailMessage) + ->subject(APP_NOTICE_DOMAIN . ' Shop Ownership Reminder') + ->markdown( + 'emails.ownership.reminder', + [ + 'shopName' => $shopName, + 'newOwnerName' => $newOwnerName, + 'previousOwnerName' => $previousOwnerName, + 'url' => $url, + 'message' => $this->optional['message'] + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Notifications/TransferredShopOwnershipStatus.php b/packages/marvel/src/Notifications/TransferredShopOwnershipStatus.php new file mode 100644 index 0000000..92e8918 --- /dev/null +++ b/packages/marvel/src/Notifications/TransferredShopOwnershipStatus.php @@ -0,0 +1,92 @@ +shop = $shop; + $this->previousOwner = $previousOwner; + $this->newOwner = $newOwner; + $this->optional = $optional; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + $url = config('shop.dashboard_url') . "/{$this->shop->slug}"; + $shopName = $this->shop->name; + $newOwnerName = $this->newOwner->name; + $previousOwnerName = $this->previousOwner->name; + return (new MailMessage) + ->subject(APP_NOTICE_DOMAIN . ' Shop Ownership Reminder') + ->markdown( + 'emails.ownership.status', + [ + 'shopName' => $shopName, + 'newOwnerName' => $newOwnerName, + 'previousOwnerName' => $previousOwnerName, + 'url' => $url, + 'message' => $this->optional['message'] + ] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/packages/marvel/src/Otp/Gateways/MessagebirdGateway.php b/packages/marvel/src/Otp/Gateways/MessagebirdGateway.php new file mode 100644 index 0000000..aa0421f --- /dev/null +++ b/packages/marvel/src/Otp/Gateways/MessagebirdGateway.php @@ -0,0 +1,78 @@ +client = new Client($api_key); + } + + + /** + * Start a phone verification process + * + * @param $phone_number + * @return Result + */ + public function startVerification($phone_number) + { + try { + $verify = new Verify(); + $verify->originator = config('services.messagebird.originator');; + $verify->recipient = $phone_number; + $result = $this->client->verify->create($verify); + return new Result($result->getId()); + } catch (Exception $exception) { + return new Result(["Verification failed to start: {$exception->getMessage()}"]); + } + } + + /** + * Check verification code + * + * @param $id + * @param $code + * @param $phone_number + * @return Result + */ + public function checkVerification($id, $code, $phone_number) + { + try { + $this->client->verify->verify($id, $code); + return new Result('success'); + } catch (Exception $exception) { + return new Result(["Verification check failed: {$exception->getMessage()}"]); + } + } + + public function sendSms($phone_number, $messageBody) + { + try { + $message = new \MessageBird\Objects\Message(); + $message->originator = config('services.messagebird.originator'); + $message->recipients = [$phone_number]; + $message->body = $message; + $this->client->messages->create($messageBody); + return new Result('success'); + } catch (Exception $exception) { + return new Result(["Verification check failed: {$exception->getMessage()}"]); + } + } +} diff --git a/packages/marvel/src/Otp/Gateways/OtpGateway.php b/packages/marvel/src/Otp/Gateways/OtpGateway.php new file mode 100644 index 0000000..e640e35 --- /dev/null +++ b/packages/marvel/src/Otp/Gateways/OtpGateway.php @@ -0,0 +1,34 @@ +gateway = $gateway; + } + + public function startVerification($phone_number) + { + return $this->gateway->startVerification($phone_number); + } + + public function checkVerification($id, $code, $phone_number) + { + return $this->gateway->checkVerification($id, $code, $phone_number); + } + + public function sendSms($phone_number, $messageBody) + { + return $this->gateway->sendSms($phone_number, $messageBody); + } +} diff --git a/packages/marvel/src/Otp/Gateways/TwilioGateway.php b/packages/marvel/src/Otp/Gateways/TwilioGateway.php new file mode 100644 index 0000000..a76f75c --- /dev/null +++ b/packages/marvel/src/Otp/Gateways/TwilioGateway.php @@ -0,0 +1,111 @@ +client = $client; + $this->verification_sid = $verification_sid ?: config('services.twilio.verification_sid'); + } + + + /** + * Start a phone verification process using Twilio Verify V2 API + * + * @param $phone_number + * @return Result + */ + public function startVerification($phone_number) + { + try { + $verification = $this->client->verify->v2->services($this->verification_sid) + ->verifications + ->create($phone_number, 'sms'); + return new Result($verification->sid); + } catch (TwilioException $exception) { + return new Result(["Verification failed to start: {$exception->getMessage()}"]); + } + } + + /** + * Check verification code using Twilio Verify V2 API + * + * @param $phone_number + * @param $code + * @return Result + */ + public function checkVerification($id, $code, $phone_number) + { + try { + $verification_check = $this->client->verify->v2->services($this->verification_sid) + ->verificationChecks + ->create(['to' => $phone_number, 'code' => $code]); + if ($verification_check->status === 'approved') { + return new Result($verification_check->sid); + } + return new Result(['Verification check failed: Invalid code.']); + } catch (TwilioException $exception) { + return new Result(["Verification check failed: {$exception->getMessage()}"]); + } + } + + /** + * The function sends an SMS message using Twilio API and returns a result object. + * + * @param phone_number The phone number to which the SMS message will be sent. + * @param message The message to be sent via SMS. + * + * @return Result an instance of the `Result` class. If the message is successfully sent, it returns a + * `Result` object with the `sid` property set to the message ID. If there is an error, it returns a + * `Result` object with an array containing an error message. + */ + public function sendSms($phone_number, $messageBody): Result + { + + try { + $message = $this->client->messages->create( + "+$phone_number", + [ + 'from' => config('services.twilio.from'), + 'body' => $messageBody + ] + ); + return new Result($message->sid); + } catch (TwilioException $exception) { + return new Result(["Message failed to send: {$exception->getMessage()}"]); + } + } +} diff --git a/packages/marvel/src/Otp/OtpInterface.php b/packages/marvel/src/Otp/OtpInterface.php new file mode 100644 index 0000000..6b76f17 --- /dev/null +++ b/packages/marvel/src/Otp/OtpInterface.php @@ -0,0 +1,36 @@ + string $id | array $errors + */ + public function __construct($value) + { + if (is_string($value)) { + $this->id = $value; + $this->valid = true; + } else if (is_array($value)) { + $this->errors = $value; + $this->valid = false; + } else { + throw new InvalidArgumentException('Invalid argument: Only string or array allowed.'); + } + } + + /** + * @return bool + */ + public function isValid(): bool + { + return $this->valid; + } + + /** + * @return array + */ + public function getErrors(): array + { + return $this->errors; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } +} diff --git a/packages/marvel/src/Payment/Base.php b/packages/marvel/src/Payment/Base.php new file mode 100644 index 0000000..1a9d6d4 --- /dev/null +++ b/packages/marvel/src/Payment/Base.php @@ -0,0 +1,16 @@ +currency = $settings->options['currency']; + } +} diff --git a/packages/marvel/src/Payment/Flutterwave.php b/packages/marvel/src/Payment/Flutterwave.php new file mode 100644 index 0000000..ccfe27e --- /dev/null +++ b/packages/marvel/src/Payment/Flutterwave.php @@ -0,0 +1,222 @@ +flutterwave = new FlutterwaveFacade(config('shop.flutterwave.secret_key'), config('shop.flutterwave.public_key')); + } + + public function getIntent($data): array + { + try { + extract($data); + $reference = FlutterwaveFacade::generateReference(); + + // Enter the details of the payment + $paymentData = [ + 'payment_options' => 'card,banktransfer', + 'amount' => number_format($amount, 2), + 'email' => $user_email ?? $order_tracking_number . '@email.com', + 'tx_ref' => $reference, + 'currency' => $this->currency, + 'redirect_url' => route('callback.flutterwave'), + 'meta' => [ + 'order_tracking_number' => $order_tracking_number + ], + 'customer' => [ + 'email' => $user_email ?? $order_tracking_number . '@email.com', + ] + ]; + + $order = FlutterwaveFacade::initializePayment($paymentData); + + return [ + 'order_tracking_number' => $order_tracking_number, + 'is_redirect' => true, + 'payment_id' => $paymentData['tx_ref'], + 'tx_ref_id' => $paymentData['tx_ref'], + 'redirect_url' => $order['data']['link'], + ]; + } catch (Exception $e) { + throw new MarvelException(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * Flutterwave callback + * + * @param mixed $request + * @return void + */ + public static function callback(Request $request) + { + try { + $tx_ref = $request['tx_ref']; + if ($request['status'] == 'cancelled') { + $tracking_number1 = PaymentIntent::whereJsonContains('payment_intent_info->payment_id', $tx_ref)->first(); + return redirect(config("shop.shop_url") . "/orders/{$tracking_number1->payment_intent_info['order_tracking_number']}/payment"); + } + + $transactionID = $request['transaction_id']; + $result = FlutterwaveFacade::verifyTransaction($transactionID); + $tracking_number = $result['data']['meta']['order_tracking_number']; + PaymentIntent::whereJsonContains('payment_intent_info->payment_id', $tx_ref)->update([ + 'payment_intent_info->payment_id' => $transactionID + ]); + + return redirect(config("shop.shop_url") . "/orders/{$tracking_number}/thank-you"); + } catch (Exception $e) { + throw new MarvelException(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + + + public function verify($transaction): mixed + { + + try { + $result = FlutterwaveFacade::verifyTransaction($transaction); + return isset($result['data']['status']) ? $result['data']['status'] : false; + } catch (Exception $e) { + throw new MarvelException(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * handleWebHooks + * + * @param mixed $request + * @return void + * @throws Throwable + */ + public function handleWebHooks($request): void + { + try { + $verified = FlutterwaveFacade::verifyWebhook(); + + if ($verified && $request->event == 'charge.completed' && $request->data['status'] == 'successful') { + $verificationData = FlutterwaveFacade::verifyTransaction($request->data['id']); + if ($verificationData['status'] === 'success') { + $this->updatePaymentOrderStatus($request, OrderStatus::PROCESSING, PaymentStatus::SUCCESS); + } + } + } catch (Exception $e) { + throw new MarvelException(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * Update Payment and Order Status + * + * @param $request + * @param $orderStatus + * @param $paymentStatus + * @return void + */ + public function updatePaymentOrderStatus($request, $orderStatus, $paymentStatus): void + { + $paymentIntent = PaymentIntent::whereJsonContains('payment_intent_info', ['tx_ref_id' => $request['data']['tx_ref']])->first(); + $trackingId = $paymentIntent->tracking_number; + $order = Order::where('tracking_number', '=', $trackingId)->first(); + $this->webhookSuccessResponse($order, $orderStatus, $paymentStatus); + } + + + /** + * createCustomer + * + * @param mixed $request + * @return array + */ + public function createCustomer($request): array + { + return []; + } + + /** + * attachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @param object $request + * @return object + */ + public function attachPaymentMethodToCustomer(string $retrieved_payment_method, object $request): object + { + return (object) []; + } + + /** + * detachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @return object + */ + public function detachPaymentMethodToCustomer(string $retrieved_payment_method): object + { + return (object) []; + } + + + public function retrievePaymentIntent($payment_intent_id): object + { + return (object) []; + } + + /** + * confirmPaymentIntent + * + * @param string $payment_intent_id + * @param array $data + * @return object + */ + public function confirmPaymentIntent(string $payment_intent_id, array $data): object + { + return (object) []; + } + + /** + * setIntent + * + * @param array $data + * @return array + */ + public function setIntent(array $data): array + { + return []; + } + + /** + * retrievePaymentMethod + * + * @param string $method_key + * @return object + */ + public function retrievePaymentMethod(string $method_key): object + { + return (object) []; + } +} diff --git a/packages/marvel/src/Payment/Iyzico.php b/packages/marvel/src/Payment/Iyzico.php new file mode 100644 index 0000000..c2a3437 --- /dev/null +++ b/packages/marvel/src/Payment/Iyzico.php @@ -0,0 +1,305 @@ +iyzicoClient = new IyzicoClient(); + $this->iyzicoClient->setApiKey(config('shop.iyzico.api_Key')); + $this->iyzicoClient->setSecretKey(config('shop.iyzico.secret_Key')); + $this->iyzicoClient->setBaseUrl(config('shop.iyzico.baseUrl')); + } + + /** + * getIntent + * + * @param mixed $data + * @return array + * @throws Throwable + */ + public function getIntent($data): array + { + try { + + $iyzicoOrder = $this->requestToIyzico($data); + if ($iyzicoOrder->getStatus() == "failure") { + throw new ErrorException($iyzicoOrder->getErrorMessage()); + } + return [ + 'payment_id' => $iyzicoOrder->getToken(), + 'is_redirect' => true, + 'redirect_url' => $iyzicoOrder->getPayWithIyzicoPageUrl(), + ]; + } catch (Exception $e) { + logger($e->getMessage()); + throw new Exception(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * After payment verify that payment + * + * @param $id + * @return mixed + * @throws Throwable + */ + public function verify($id): mixed + { + try { + $request = new RetrieveCheckoutFormRequest(); + $request->setToken($id); + $result = CheckoutForm::retrieve($request, $this->iyzicoClient); + return $result->getPaymentStatus() ? $result->getPaymentStatus() : false; + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * handleWebHooks + * + * @param mixed $request + * @return void + * @throws Throwable + */ + public function handleWebHooks($request): void + { + $webhookSignature = $request->header('x-iyz-signature'); + $stringToBeHashed = base64_encode(sha1(config('shop.iyzico.secret_Key') . $request->iyziEventType . $request->token, true)); + try { + $orderStatus = $this->verify($request?->token); + } catch (Throwable $e) { + $orderStatus = false; + } + // Verify webhook + if ($stringToBeHashed == $webhookSignature || $orderStatus) { + switch ($request->status) { + case "SUCCESS": + $this->updatePaymentOrderStatus($request, OrderStatus::PROCESSING, PaymentStatus::SUCCESS); + break; + case "FAILURE": + $this->updatePaymentOrderStatus($request, OrderStatus::PENDING, PaymentStatus::FAILED); + break; + } + // To prevent loop for any case + http_response_code(200); + exit(); + } else { + // Invalid request + http_response_code(400); + exit(); + } + } + + /** + * retrievePaymentIntent + * + * @param $data + * @return object + */ + public function retrievePaymentIntent($data): object + { + return (object) []; + } + + /** + * confirmPaymentIntent + * + * @param string $payment_intent_id + * @param array $data + * @return object + */ + public function confirmPaymentIntent($payment_intent_id, $data): object + { + return (object) []; + } + + + + /** + * createCustomer + * + * @param mixed $request + * @return array + */ + public function createCustomer($request): array + { + return []; + } + + /** + * attachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @param object $request + * @return object + */ + public function attachPaymentMethodToCustomer($retrieved_payment_method, $request): object + { + return (object) []; + } + + /** + * detachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @return object + */ + public function detachPaymentMethodToCustomer($retrieved_payment_method): object + { + return (object) []; + } + + /** + * setIntent + * + * @param array $data + * @return array + */ + public function setIntent($data): array + { + return []; + } + + /** + * retrievePaymentMethod + * + * @param string $method_key + * @return object + */ + public function retrievePaymentMethod($method_key): object + { + return (object) []; + } + + + /** + * Update Payment and Order Status + * + * @param $request + * @param $orderStatus + * @param $paymentStatus + * @return void + */ + public function updatePaymentOrderStatus($request, $orderStatus, $paymentStatus): void + { + $token = $request?->token; + $paymentGateway = PaymentIntent::where('payment_intent_info->payment_id', $token)->first(); + $order = Order::where('tracking_number', '=', $paymentGateway->tracking_number)->orWhere('id', $paymentGateway->tracking_number)->first(); + $this->webhookSuccessResponse($order, $orderStatus, $paymentStatus); + } + + /** + * It creates a payment request and returns the response + * + * @param array data + * + * @return PayWithIyzicoInitialize + */ + public function requestToIyzico(array $data): PayWithIyzicoInitialize + { + extract($data); + $redirectUrl = config('shop.shop_url'); + $order = Order::where('tracking_number', $order_tracking_number)->OrWhere('id', $order_tracking_number)->first(); + + /* Creating a new instance of the class `CreatePayWithIyzicoInitializeRequest` */ + $request = new CreatePayWithIyzicoInitializeRequest(); + $request->setLocale(Locale::EN); + $request->setPrice($amount); + $request->setPaidPrice($amount); + $request->setCurrency($this->currency ?? Currency::USD); + $request->setCallbackUrl("{$redirectUrl}/orders/{$order_tracking_number}/thank-you"); + + $buyer = new Buyer(); + $uuid = Str::uuid(); + $buyer->setId($uuid); + $buyer->setName($order->customer_name); + $buyer->setSurname($order->customer_name); + $buyer->setEmail($order->customer->email ?? 'customer@demo.com'); + $buyer->setIdentityNumber($order_tracking_number); + $buyer->setRegistrationAddress(json_encode($order->billing_address)); + $buyer->setIp($ip); + $buyer->setCity($order->billing_address['city']); + $buyer->setCountry($order->billing_address['country']); + + /* Setting the buyer information. */ + $request->setBuyer($buyer); + + $shippingAddress = new IyzicoAddress(); + $shippingAddress->setContactName($order->customer_name ?? "Jane Doe"); + $shippingAddress->setCity($order->shipping_address['city']); + $shippingAddress->setCountry($order->shipping_address['country']); + $shippingAddress->setAddress(json_encode($order->shipping_address)); + + /* Setting the shipping address. */ + $request->setShippingAddress($shippingAddress); + + $billingAddress = new IyzicoAddress(); + $billingAddress->setContactName($order->customer_name ?? "Jane Doe"); + $billingAddress->setCity($order->billing_address['city']); + $billingAddress->setCountry($order->billing_address['country']); + $billingAddress->setAddress(json_encode($order->billing_address)); + + /* Setting the billing address. */ + $request->setBillingAddress($billingAddress); + + /* Creating a new instance of the class `BasketItem` and setting the values of the properties. */ + $basketItems = Arr::map(collect($order->products)->toArray(), function ($product) { + $product = (object) $product; + $type = $product->is_digital ? BasketItemType::VIRTUAL : BasketItemType::PHYSICAL; + $basketItem = new BasketItem(); + $basketItem->setId($product->id); + $basketItem->setName($product->name); + $basketItem->setCategory1($product->product_type); + $basketItem->setItemType($type); + if ($product->sale_price < 1) { + $product->sale_price = 1; + } + $basketItem->setPrice(ceil($product->sale_price)); + return $basketItem; + }); + + $restPrice = $amount - array_reduce($basketItems, fn ($price, $basketItem) => $price + $basketItem->getPrice(), 0); + $basketItems[0]->setPrice($basketItems[0]->getPrice() + $restPrice); + + /* Setting the basket items. */ + $request->setBasketItems($basketItems); + /* Creating a payment request. */ + $payWithIyzicoInitialize = PayWithIyzicoInitialize::create($request, $this->iyzicoClient); + return $payWithIyzicoInitialize; + } +} diff --git a/packages/marvel/src/Payment/Mollie.php b/packages/marvel/src/Payment/Mollie.php new file mode 100644 index 0000000..3498c70 --- /dev/null +++ b/packages/marvel/src/Payment/Mollie.php @@ -0,0 +1,203 @@ +mollieFacade = new MollieFacade(config('shop.mollie.mollie_key')); + } + + + public function getIntent($data): array + { + try { + + extract($data); + $order = MollieFacade::api()->payments->create([ + "amount" => [ + "currency" => $this->currency, + "value" => number_format($amount, 2) + ], + "description" => "Order From " . $order_tracking_number, + "redirectUrl" => config("shop.shop_url") . "/orders/{$order_tracking_number}/thank-you", + "webhookUrl" => config("shop.mollie.webhook_url") ?? url('webhooks/mollie'), + "metadata" => [ + "order_id" => $order_tracking_number, + ], + ]); + return [ + 'payment_id' => $order->id, + 'amount' => $order->amount->value, + 'invoice_id' => $order_tracking_number, + 'redirect_url' => $order->getCheckoutUrl(), + 'is_redirect' => true, + ]; + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + public function verify($paymentId): mixed + { + try { + $order = MollieFacade::api()->payments()->get($paymentId); + return isset($order->status) ? $order->status : false; + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + + /** + * createCustomer + * + * @param mixed $request + * @return array + */ + public function createCustomer($request): array + { + return []; + } + + /** + * attachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @param object $request + * @return object + */ + public function attachPaymentMethodToCustomer($retrieved_payment_method, $request): object + { + return (object) []; + } + + /** + * detachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @return object + */ + public function detachPaymentMethodToCustomer($retrieved_payment_method): object + { + return (object) []; + } + + + /** + * retrievePaymentIntent + * + * @param $data + * @return object + */ + public function retrievePaymentIntent($data): object + { + return (object) []; + } + + /** + * confirmPaymentIntent + * + * @param string $payment_intent_id + * @param array $data + * @return object + */ + public function confirmPaymentIntent($payment_intent_id, $data): object + { + return (object) []; + } + + /** + * handleWebHooks + * + * @param mixed $request + * @return void + * @throws Throwable + */ + public function handleWebHooks($request): void + { + try { + $payment = MollieFacade::api()->payments()->get($request->id); + + if ($payment->isPaid() && !$payment->hasRefunds() && !$payment->hasChargebacks()) { + $this->updatePaymentOrderStatus($request, OrderStatus::PROCESSING, PaymentStatus::SUCCESS); + } elseif ($payment->isOpen()) { + $this->updatePaymentOrderStatus($request, OrderStatus::PENDING, PaymentStatus::PENDING); + } elseif ($payment->isPending()) { + $this->updatePaymentOrderStatus($request, OrderStatus::PENDING, PaymentStatus::AWAITING_FOR_APPROVAL); + } elseif ($payment->isCanceled()) { + $this->updatePaymentOrderStatus($request, OrderStatus::PENDING, PaymentStatus::PENDING); + } elseif ($payment->isFailed() || $payment->isExpired() || $payment->hasRefunds() || $payment->hasRefunds() || $payment->hasChargebacks()) { + $this->updatePaymentOrderStatus($request, OrderStatus::FAILED, PaymentStatus::FAILED); + } + + // To prevent loop for any case + http_response_code(200); + exit(); + } catch (SignatureVerificationError $e) { + // Invalid signature + http_response_code(400); + exit(); + } + } + + /** + * setIntent + * + * @param array $data + * @return array + */ + public function setIntent($data): array + { + return []; + } + + /** + * retrievePaymentMethod + * + * @param string $method_key + * @return object + */ + public function retrievePaymentMethod($method_key): object + { + return (object) []; + } + + + /** + * Update Payment and Order Status + * + * @param $request + * @param $orderStatus + * @param $paymentStatus + * @return void + */ + public function updatePaymentOrderStatus($request, $orderStatus, $paymentStatus): void + { + $payment = MollieFacade::api()->payments()->get($request->id); + $trackingId = $payment->metadata->order_id; + $order = Order::where('tracking_number', '=', $trackingId)->first(); + $this->webhookSuccessResponse($order, $orderStatus, $paymentStatus); + } +} diff --git a/packages/marvel/src/Payment/Payment.php b/packages/marvel/src/Payment/Payment.php new file mode 100644 index 0000000..5ed1d2b --- /dev/null +++ b/packages/marvel/src/Payment/Payment.php @@ -0,0 +1,128 @@ +payment = $payment; + } + + /** + * createCustomer + * + * @param object $request + * @return array + */ + public function createCustomer($request) + { + return $this->payment->createCustomer($request); + } + + + /** + * attachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @param object $request + * @return object + */ + public function attachPaymentMethodToCustomer($retrieved_payment_method, $request) + { + return $this->payment->attachPaymentMethodToCustomer($retrieved_payment_method, $request); + } + + + /** + * detachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @return object + */ + public function detachPaymentMethodToCustomer($retrieved_payment_method) + { + return $this->payment->detachPaymentMethodToCustomer($retrieved_payment_method); + } + + /** + * getIntent + * + * @param array $data + * @return array + */ + public function getIntent($data) + { + return $this->payment->getIntent($data); + } + + /** + * retrievePaymentIntent + * + * @param string $payment_intent_id + * @return object + */ + public function retrievePaymentIntent($payment_intent_id) + { + return $this->payment->retrievePaymentIntent($payment_intent_id); + } + + /** + * confirmPaymentIntent + * + * @param string $payment_intent_id + * @param array $data + * @return object + */ + public function confirmPaymentIntent($payment_intent_id, $data) + { + return $this->payment->confirmPaymentIntent($payment_intent_id, $data); + } + + /** + * verify + * + * @param $id + * @return bool + */ + public function verify($id): mixed + { + return $this->payment->verify($id); + } + + /** + * handleWebHooks + * + * @param object $request + * @return void + */ + public function handleWebHooks($request) + { + $this->payment->handleWebHooks($request); + } + + /** + * setIntent + * + * @param array $data + * @return array + */ + public function setIntent($data) + { + return $this->payment->setIntent($data); + } + + /** + * retrievePaymentMethod + * + * @param string $method_key + * @return object + */ + public function retrievePaymentMethod($method_key) + { + return $this->payment->retrievePaymentMethod($method_key); + } +} diff --git a/packages/marvel/src/Payment/PaymentInterface.php b/packages/marvel/src/Payment/PaymentInterface.php new file mode 100644 index 0000000..7bdad4d --- /dev/null +++ b/packages/marvel/src/Payment/PaymentInterface.php @@ -0,0 +1,26 @@ +PaymongoFacade = new PaymongoFacade(config('shop.paymongo.public_key'), config('shop.paymongo.secret_key')); + } + + /** + * Get payment intent for payment + * + * @param $data + * @return array + * @throws MarvelException + */ + public function getIntent($data): array + { + try { + extract($data); + $redirectUrl = config('shop.shop_url'); + + $order = PaymongoFacade::source()->create([ + 'type' => $selected_payment_path, + 'amount' => round($amount), + 'currency' => $this->currency, + "metadata" => [ + "tracking_number" => $order_tracking_number, + ], + 'redirect' => [ + "success" => "{$redirectUrl}/orders/{$order_tracking_number}/thank-you", + "failed" => "{$redirectUrl}/orders/{$order_tracking_number}/thank-you" + ] + ]); + + return [ + 'payment_id' => $order->id, + 'amount' => $order->amount, + 'invoice_id' => $order_tracking_number, + 'redirect_url' => $order->redirect['checkout_url'], + 'is_redirect' => true, + ]; + } catch (Exception $e) { + throw new MarvelException(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * Verify a payment + * + * @param $id + * @return false|mixed + * @throws MarvelException + */ + public function verify($paymentId): mixed + { + $source = PaymongoFacade::source()->find($paymentId); + try { + if ($source->status == 'chargeable') { + $order = PaymongoFacade::payment()->create([ + 'amount' => $source->amount, + 'currency' => $this->currency, + 'description' => 'Payment Source', + 'statement_descriptor' => 'Source Paymongo', + 'source' => [ + 'id' => $source->id, + 'type' => 'source' + ] + ]); + return $order->status ?? false; + } + return $source->status ?? false; + } catch (Exception $e) { + throw new MarvelException(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * handleWebHooks + * + * @param mixed $request + * @return void + * @throws Throwable + */ + public function handleWebHooks($request): void + { + try { + $payload = @file_get_contents('php://input'); + $signatureHeader = $_SERVER['HTTP_PAYMONGO_SIGNATURE']; + $webhookSecretKey = config('shop.paymongo.webhook_sig'); + } catch (SignatureVerificationException $e) { + // Invalid signature + http_response_code(400); + exit(); + } + + $eventStatus = $request['data']['attributes']['data']['attributes']['status']; + switch ($eventStatus) { + case 'chargeable': + $this->updatePaymentOrderStatus($request, OrderStatus::PROCESSING, PaymentStatus::SUCCESS); + break; + case 'payment.paid': + $this->updatePaymentOrderStatus($request, OrderStatus::PROCESSING, PaymentStatus::SUCCESS); + break; + case 'payment.failed ': + $this->updatePaymentOrderStatus($request, OrderStatus::FAILED, PaymentStatus::FAILED); + break; + } + + // To prevent loop for any case + http_response_code(200); + exit(); + } + + /** + * Update Payment and Order Status + * + * @param $request + * @param $orderStatus + * @param $paymentStatus + * @return void + */ + public function updatePaymentOrderStatus($request, $orderStatus, $paymentStatus): void + { + $trackingId = $request['data']['attributes']['data']['attributes']['metadata']['tracking_number']; + $order = Order::where('tracking_number', '=', $trackingId)->first(); + $this->webhookSuccessResponse($order, $orderStatus, $paymentStatus); + } + + /** + * createCustomer + * + * @param mixed $request + * @return array + */ + public function createCustomer($request): array + { + return []; + } + + /** + * attachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @param object $request + * @return object + */ + public function attachPaymentMethodToCustomer(string $retrieved_payment_method, object $request): object + { + return (object) []; + } + + /** + * detachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @return object + */ + public function detachPaymentMethodToCustomer(string $retrieved_payment_method): object + { + return (object) []; + } + + public function retrievePaymentIntent($payment_intent_id): object + { + return (object) []; + } + + /** + * confirmPaymentIntent + * + * @param string $payment_intent_id + * @param array $data + * @return object + */ + public function confirmPaymentIntent(string $payment_intent_id, array $data): object + { + return (object) []; + } + + /** + * setIntent + * + * @param array $data + * @return array + */ + public function setIntent(array $data): array + { + return []; + } + + /** + * retrievePaymentMethod + * + * @param string $method_key + * @return object + */ + public function retrievePaymentMethod(string $method_key): object + { + return (object) []; + } +} diff --git a/packages/marvel/src/Payment/Paypal.php b/packages/marvel/src/Payment/Paypal.php new file mode 100644 index 0000000..0445286 --- /dev/null +++ b/packages/marvel/src/Payment/Paypal.php @@ -0,0 +1,251 @@ +paypalClient = new PayPalClient(config('shop.paypal')); + $token = $this->paypalClient->getAccessToken(); + $this->paypalClient->setAccessToken($token); + } + + /** + * createCustomer + * + * @param mixed $request + * @return array + */ + public function createCustomer($request): array + { + return []; + } + + /** + * attachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @param object $request + * @return object + */ + public function attachPaymentMethodToCustomer($retrieved_payment_method, $request): object + { + return (object) []; + } + + /** + * detachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @return object + */ + public function detachPaymentMethodToCustomer($retrieved_payment_method): object + { + return (object) []; + } + + + /** + * getIntent + * + * @param mixed $data + * @return array + * @throws Throwable + */ + public function getIntent($data): array + { + try { + extract($data); + $redirectUrl = config('shop.shop_url'); + $this->paypalClient->setRequestHeader("PayPal-Request-Id", Str::uuid()); + $order = $this->paypalClient->createOrder([ + "intent" => "CAPTURE", + "purchase_units" => [ + [ + "invoice_id" => $order_tracking_number, + "amount" => [ + "currency_code" => $this->currency, + "value" => round($amount, 2), + ], + 'description' => "Order From " . config('app.name'), + ] + ], + + "payment_source" => [ + "paypal" => [ + "experience_context" => [ + 'user_action' => 'PAY_NOW', + 'payment_method_preference' => 'IMMEDIATE_PAYMENT_REQUIRED', + 'cancel_url' => "{$redirectUrl}/orders/{$order_tracking_number}/payment", + 'return_url' => "{$redirectUrl}/orders/{$order_tracking_number}/thank-you" + ] + ] + ], + ]); + return ['redirect_url' => $order['links'][1]['href'], 'payment_id' => $order["id"], 'is_redirect' => true]; + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * retrievePaymentIntent + * + * @param $data + * @return object + */ + public function retrievePaymentIntent($data): object + { + return (object) []; + } + + /** + * confirmPaymentIntent + * + * @param string $payment_intent_id + * @param array $data + * @return object + */ + public function confirmPaymentIntent($payment_intent_id, $data): object + { + return (object) []; + } + + /** + * After payment verify that payment + * + * @param $id + * @return mixed + * @throws Throwable + */ + public function verify($id): mixed + { + try { + $result = $this->paypalClient->capturePaymentOrder($id); + return isset($result["status"]) ? $result : false; + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * handleWebHooks + * + * @param mixed $request + * @return void + * @throws Throwable + */ + public function handleWebHooks($request): void + { + $webhookId = config('shop.paypal.webhook_id'); + // gather webhook data to verify it + $verifyData = [ + 'auth_algo' => $request->header('PAYPAL-AUTH-ALGO', null), + 'cert_url' => $request->header('PAYPAL-CERT-URL', null), + 'transmission_id' => $request->header('PAYPAL-TRANSMISSION-ID', null), + 'transmission_sig' => $request->header('PAYPAL-TRANSMISSION-SIG', null), + 'transmission_time' => $request->header('PAYPAL-TRANSMISSION-TIME', null), + 'webhook_id' => $webhookId, + 'webhook_event' => $request->all() + ]; + + // Verify webhook + try { + if ($webhookId && $verifyData) { + $event = $this->paypalClient->verifyWebHook($verifyData); + if ($event["verification_status"] !== "SUCCESS") { + // Invalid verification status + http_response_code(400); + exit(); + } + } else { + // Invalid request + http_response_code(400); + exit(); + } + } catch (SignatureVerificationError $e) { + // Invalid signature + http_response_code(400); + exit(); + } + + switch ($request->event_type) { + case "PAYMENT.CAPTURE.COMPLETED": + $this->updatePaymentOrderStatus($request, OrderStatus::PROCESSING, PaymentStatus::SUCCESS); + break; + case "PAYMENT.CAPTURE.PENDING": + $this->updatePaymentOrderStatus($request, OrderStatus::PENDING, PaymentStatus::PENDING); + break; + case "PAYMENT.CAPTURE.CANCELLED": + $this->updatePaymentOrderStatus($request, OrderStatus::PENDING, PaymentStatus::FAILED); + break; + case "PAYMENT.CAPTURE.REVERSED": + $this->updatePaymentOrderStatus($request, OrderStatus::CANCELLED, PaymentStatus::REVERSAL); + break; + } + + // To prevent loop for any case + http_response_code(200); + exit(); + } + + /** + * setIntent + * + * @param array $data + * @return array + */ + public function setIntent($data): array + { + return []; + } + + /** + * retrievePaymentMethod + * + * @param string $method_key + * @return object + */ + public function retrievePaymentMethod($method_key): object + { + return (object) []; + } + + + /** + * Update Payment and Order Status + * + * @param $request + * @param $orderStatus + * @param $paymentStatus + * @return void + */ + public function updatePaymentOrderStatus($request, $orderStatus, $paymentStatus): void + { + $trackingId = $request->resource["invoice_id"]; + $order = Order::where('tracking_number', '=', $trackingId)->first(); + $this->webhookSuccessResponse($order, $orderStatus, $paymentStatus); + } +} diff --git a/packages/marvel/src/Payment/Paystack.php b/packages/marvel/src/Payment/Paystack.php new file mode 100644 index 0000000..3694e97 --- /dev/null +++ b/packages/marvel/src/Payment/Paystack.php @@ -0,0 +1,200 @@ +paystack = new PaystackFacade(config('shop.paystack.secret_key'), config('shop.paystack.public_key')); + } + + public function getIntent($data): array + { + try { + extract($data); + $paymentData = [ + 'email' => $user_email ?? $order_tracking_number . '@order.com', + 'amount' => round($amount, 2) * 100, + 'currency' => $this->currency, + 'metadata' => [ + 'tracking_nunmber' => $order_tracking_number, + ], + 'callback_url' => config("shop.shop_url") . "/orders/{$order_tracking_number}/thank-you", + ]; + + $order = PaystackFacade::getAuthorizationResponse($paymentData); + + return [ + 'order_tracking_number' => $order_tracking_number, + 'is_redirect' => true, + 'payment_id' => $order['data']['reference'], + 'redirect_url' => $order['data']['authorization_url'], + ]; + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + + public function verify($reference): mixed + { + try { + $url = "https://api.paystack.co/transaction/verify/{$reference}"; + + $response = Http::withHeaders([ + 'Authorization' => 'Bearer ' . config('shop.paystack.secret_key'), + ])->get($url); + + $result = json_decode($response, false); + return isset($result->data->status) ? $result->data->status : false; + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * handleWebHooks + * + * @param mixed $request + * @return void + * @throws Throwable + */ + public function handleWebHooks($request): void + { + // Verify webhook + try { + $input = @file_get_contents("php://input"); + if ($_SERVER['HTTP_X_PAYSTACK_SIGNATURE'] !== hash_hmac('sha512', $input, config('shop.paystack.secret_key'))) + exit(); + $event = json_decode($input); + } catch (SignatureVerificationError $e) { + // Invalid signature + http_response_code(400); + exit(); + } + + switch ($event->data->status) { + case "success": + $this->updatePaymentOrderStatus($request, OrderStatus::PROCESSING, PaymentStatus::SUCCESS); + break; + case "pending": + $this->updatePaymentOrderStatus($request, OrderStatus::PENDING, PaymentStatus::PENDING); + break; + case "failed": + $this->updatePaymentOrderStatus($request, OrderStatus::FAILED, PaymentStatus::FAILED); + break; + } + // To prevent loop for any case + http_response_code(200); + exit(); + } + + /** + * Update Payment and Order Status + * + * @param $request + * @param $orderStatus + * @param $paymentStatus + * @return void + */ + public function updatePaymentOrderStatus($request, $orderStatus, $paymentStatus): void + { + $trackingId = $request->data['metadata']['tracking_nunmber']; + $order = Order::where('tracking_number', '=', $trackingId)->first(); + $this->webhookSuccessResponse($order, $orderStatus, $paymentStatus); + } + + + /** + * createCustomer + * + * @param mixed $request + * @return array + */ + public function createCustomer($request): array + { + return []; + } + + /** + * attachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @param object $request + * @return object + */ + public function attachPaymentMethodToCustomer(string $retrieved_payment_method, object $request): object + { + return (object) []; + } + + /** + * detachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @return object + */ + public function detachPaymentMethodToCustomer(string $retrieved_payment_method): object + { + return (object) []; + } + + + public function retrievePaymentIntent($payment_intent_id): object + { + return (object) []; + } + + /** + * confirmPaymentIntent + * + * @param string $payment_intent_id + * @param array $data + * @return object + */ + public function confirmPaymentIntent(string $payment_intent_id, array $data): object + { + return (object) []; + } + + /** + * setIntent + * + * @param array $data + * @return array + */ + public function setIntent(array $data): array + { + return []; + } + + /** + * retrievePaymentMethod + * + * @param string $method_key + * @return object + */ + public function retrievePaymentMethod(string $method_key): object + { + return (object) []; + } +} diff --git a/packages/marvel/src/Payment/Razorpay.php b/packages/marvel/src/Payment/Razorpay.php new file mode 100644 index 0000000..8f59172 --- /dev/null +++ b/packages/marvel/src/Payment/Razorpay.php @@ -0,0 +1,211 @@ +api = new Api(config('shop.razorpay.key_id'), config('shop.razorpay.key_secret')); + } + + /** + * Get payment intent for payment + * + * @param $data + * @return array + * @throws Exception + */ + public function getIntent($data): array + { + try { + extract($data); + $order = $this->api->order->create([ + 'receipt' => $order_tracking_number, + 'amount' => round($amount, 2) * 100, + 'currency' => $this->currency, + ]); + + return [ + 'payment_id' => $order->id, + 'order_tracking_number' => $order->receipt, + 'currency' => $order->currency, + 'amount' => $order->amount, + 'is_redirect' => false, + ]; + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * Verify a payment + * + * @param $id + * @return false|mixed + * @throws Exception + */ + public function verify($id): mixed + { + try { + $order = $this->api->order->fetch($id); + return isset($order->status) ? $order->status : false; + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * handleWebHooks + * + * @param mixed $request + * @return void + * @throws Throwable + */ + public function handleWebHooks($request): void + { + $webhookSecret = config('shop.razorpay.webhook_secret'); + $webhookBody = @file_get_contents('php://input'); + $webhookSignature = $request->header('X-Razorpay-Signature'); + + try { + if ($webhookBody && $webhookSignature && $webhookSecret) { + $this->api->utility->verifyWebhookSignature($webhookBody, $webhookSignature, $webhookSecret); + } else { + // Invalid request + http_response_code(400); + exit(); + } + } catch (SignatureVerificationError $e) { + // Invalid signature + http_response_code(400); + exit(); + } + + $eventStatus = (string) Str::of($request->event)->replace('payment.', '', $request->event); + + switch ($eventStatus) { + case 'dispute.won': + case 'dispute.created': + case 'authorized': + $this->updatePaymentOrderStatus($request, OrderStatus::PENDING, PaymentStatus::PROCESSING); + break; + case 'captured': + $this->updatePaymentOrderStatus($request, OrderStatus::PROCESSING, PaymentStatus::SUCCESS); + break; + case 'failed': + $this->updatePaymentOrderStatus($request, OrderStatus::PENDING, PaymentStatus::FAILED); + } + + // To prevent loop for any case + http_response_code(200); + exit(); + } + + /** + * Update Payment and Order Status + * + * @param $request + * @param $orderStatus + * @param $paymentStatus + * @return void + */ + public function updatePaymentOrderStatus($request, $orderStatus, $paymentStatus): void + { + $payload = $request->payload['payment']['entity']; + $paymentIntent = PaymentIntent::whereJsonContains('payment_intent_info', ['payment_id' => $payload['order_id']])->first(); + $trackingId = $paymentIntent->tracking_number; + $order = Order::where('tracking_number', '=', $trackingId)->first(); + $this->webhookSuccessResponse($order, $orderStatus, $paymentStatus); + } + + /** + * createCustomer + * + * @param mixed $request + * @return array + */ + public function createCustomer($request): array + { + return []; + } + + /** + * attachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @param object $request + * @return object + */ + public function attachPaymentMethodToCustomer(string $retrieved_payment_method, object $request): object + { + return (object) []; + } + + /** + * detachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @return object + */ + public function detachPaymentMethodToCustomer(string $retrieved_payment_method): object + { + return (object) []; + } + + public function retrievePaymentIntent($payment_intent_id): object + { + return (object) []; + } + + /** + * confirmPaymentIntent + * + * @param string $payment_intent_id + * @param array $data + * @return object + */ + public function confirmPaymentIntent(string $payment_intent_id, array $data): object + { + return (object) []; + } + + /** + * setIntent + * + * @param array $data + * @return array + */ + public function setIntent(array $data): array + { + return []; + } + + /** + * retrievePaymentMethod + * + * @param string $method_key + * @return object + */ + public function retrievePaymentMethod(string $method_key): object + { + return (object) []; + } +} diff --git a/packages/marvel/src/Payment/Stripe.php b/packages/marvel/src/Payment/Stripe.php new file mode 100644 index 0000000..1c5cd7e --- /dev/null +++ b/packages/marvel/src/Payment/Stripe.php @@ -0,0 +1,397 @@ +stripe = new StripeClient(config('shop.stripe.api_secret')); + } + + /** + * createCustomer + * + * @param object $request + * @return array + */ + public function createCustomer($request): array + { + $customer = $this->stripe->customers->create([ + 'email' => $request->user()->email, + 'name' => $request->user()->name + ]); + + return [ + 'customer_id' => $customer->id, + 'customer_email' => $customer->email, + ]; + } + + /** + * attachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @param object $request + * @return object + */ + public function attachPaymentMethodToCustomer($retrieved_payment_method, $request): object + { + $customer = $this->createPaymentCustomer($request); + $attachedPaymentMethod = $this->stripe->paymentMethods->attach( + $retrieved_payment_method, + [ + 'customer' => $customer['customer_id'] + ] + ); + + return $attachedPaymentMethod; + } + + /** + * detachPaymentMethodToCustomer + * + * @param string $retrieved_payment_method + * @return object + */ + public function detachPaymentMethodToCustomer($retrieved_payment_method): object + { + $detachedPaymentMethod = $this->stripe->paymentMethods->detach( + $retrieved_payment_method, + [] + ); + + return $detachedPaymentMethod; + } + + /** + * getIntent + * + * @param array $data + * @return array + */ + public function getIntent($data): array + { + + try { + extract($data); + $intent_array = []; + $intent_array = [ + 'amount' => round($amount, 2) * 100, + 'currency' => $this->currency, + 'description' => 'Marvel Payment', + + /** + * If you want selective payment method type then list those method name in the "payment_method_types" array + * and uncomment this "payment_method_types" and comment "automatic_payment_methods" lines + * or you can enabled true "automatic_payment_methods" array. so that stripe can handle everything + */ + + // 'payment_method_types' => ['card','cashapp','alipay','wechat_pay','etc'], + 'automatic_payment_methods' => [ + 'enabled' => true, + ], + 'metadata' => [ + 'order_tracking_number' => $order_tracking_number, + ] + ]; + + if (isset($customer)) { + $intent_array['customer'] = $customer; + } + + $intent = $this->stripe->paymentIntents->create($intent_array); + + return [ + 'client_secret' => $intent->client_secret, + 'payment_id' => $intent->id, + 'is_redirect' => false + ]; + } catch (\Stripe\Exception\CardException $e) { + throw new HttpException(400, INVALID_CARD); + } catch (\Stripe\Exception\RateLimitException $e) { + throw new HttpException(400, TOO_MANY_REQUEST); + } catch (\Stripe\Exception\InvalidRequestException $e) { + throw new HttpException(400, INVALID_REQUEST); + } catch (\Stripe\Exception\InvalidArgumentException $e) { + throw new HttpException(400, INVALID_REQUEST); + } catch (\Stripe\Exception\AuthenticationException $e) { + throw new HttpException(400, AUTHENTICATION_FAILED); + } catch (\Stripe\Exception\ApiConnectionException $e) { + throw new HttpException(400, API_CONNECTION_FAILED); + } catch (\Stripe\Exception\ApiErrorException $e) { + throw new HttpException(400, API_CONNECTION_FAILED); + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * retrievePaymentIntent + * + * @param string $payment_intent_id + * @return object + */ + public function retrievePaymentIntent($payment_intent_id): object + { + try { + $intent_data = $this->stripe->paymentIntents->retrieve( + $payment_intent_id + ); + + // expected payment-intent status + + // succeeded ------------------- Customer completed payment on your checkout page + // requires_action -------------- Customer did not complete the checkout + // requires_payment_method ------ Customer’s payment failed on your checkout page + + return $intent_data; + } catch (\Stripe\Exception\ApiErrorException $e) { + throw new HttpException(400, API_CONNECTION_FAILED); + } catch (\Stripe\Exception\RateLimitException $e) { + throw new HttpException(400, TOO_MANY_REQUEST); + } catch (\Stripe\Exception\InvalidRequestException $e) { + throw new HttpException(400, INVALID_REQUEST); + } catch (\Stripe\Exception\InvalidArgumentException $e) { + throw new HttpException(400, INVALID_REQUEST); + } catch (\Stripe\Exception\AuthenticationException $e) { + throw new HttpException(400, AUTHENTICATION_FAILED); + } catch (\Stripe\Exception\ApiConnectionException $e) { + throw new HttpException(400, API_CONNECTION_FAILED); + } catch (\Stripe\Exception\ApiErrorException $e) { + throw new HttpException(400, API_CONNECTION_FAILED); + } catch (\Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * confirmPaymentIntent + * + * @param string $payment_intent_id + * @param array $data + * @return object + */ + public function confirmPaymentIntent($payment_intent_id, $data): object + { + try { + $intent_data = $this->stripe->paymentIntents->confirm( + $payment_intent_id, + $data + ); + + return $intent_data; + } catch (\Stripe\Exception\ApiErrorException $e) { + throw new HttpException(400, API_CONNECTION_FAILED); + } catch (\Stripe\Exception\RateLimitException $e) { + throw new HttpException(400, TOO_MANY_REQUEST); + } catch (\Stripe\Exception\InvalidRequestException $e) { + throw new HttpException(400, INVALID_REQUEST); + } catch (\Stripe\Exception\InvalidArgumentException $e) { + throw new HttpException(400, INVALID_REQUEST); + } catch (\Stripe\Exception\AuthenticationException $e) { + throw new HttpException(400, AUTHENTICATION_FAILED); + } catch (\Stripe\Exception\ApiConnectionException $e) { + throw new HttpException(400, API_CONNECTION_FAILED); + } catch (\Stripe\Exception\ApiErrorException $e) { + throw new HttpException(400, API_CONNECTION_FAILED); + } catch (\Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * verify + * + * @param $id + * @return bool + * @throws Exception + */ + public function verify($id): bool + { + try { + $payment = $this->stripe->charges->retrieve($id); + + return isset($payment->paid) ? $payment->paid : false; + } catch (\Stripe\Exception\CardException $e) { + throw new HttpException(400, INVALID_CARD); + } catch (\Stripe\Exception\RateLimitException $e) { + throw new HttpException(400, TOO_MANY_REQUEST); + } catch (\Stripe\Exception\InvalidRequestException $e) { + throw new HttpException(400, INVALID_REQUEST); + } catch (\Stripe\Exception\AuthenticationException $e) { + throw new HttpException(400, AUTHENTICATION_FAILED); + } catch (\Stripe\Exception\ApiConnectionException $e) { + throw new HttpException(400, API_CONNECTION_FAILED); + } catch (\Stripe\Exception\ApiErrorException $e) { + throw new HttpException(400, API_CONNECTION_FAILED); + } catch (Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * handleWebHooks + * + * @param object $request + * @return void + */ + public function handleWebHooks($request): void + { + $endpoint_secret = config('shop.stripe.webhook_secret'); + $payload = @file_get_contents('php://input'); + $sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE']; + $event = null; + + try { + $event = \Stripe\Webhook::constructEvent( + $payload, + $sig_header, + $endpoint_secret + ); + } catch (\UnexpectedValueException $e) { + // Invalid payload + http_response_code(400); + exit(); + } catch (\Stripe\Exception\SignatureVerificationException $e) { + // Invalid signature + http_response_code(400); + exit(); + } + + $intent = $this->matchSucceededOrFailed($request); + + if (!$intent) { + http_response_code(200); + exit(); + } + + $webhook_return_message = [ + 'charge_status' => $intent['status'], + 'payment_intent' => $intent['payment_intent'], + 'amount' => $intent['amount'], + 'paid' => $intent['paid'], + 'payment_method' => $intent['payment_method_details']['type'], + 'amount_captured' => $intent['amount_captured'], + 'order_tracking_id' => $intent['metadata']['order_tracking_number'], + ]; + + // send response to check charge status + $this->paymentGatewayWebHookResponse($webhook_return_message); + + http_response_code(200); + exit(); + } + + /** + * paymentGatewayWebHookResponse + * + * @param array $data + * @return void + */ + public function paymentGatewayWebHookResponse($data) + { + $order = Order::where('tracking_number', '=', $data['order_tracking_id'])->firstOrFail(); + + if (isset($data)) { + switch ($data['charge_status']) { + case 'succeeded': + # code... + # Throw email to admin that order is success. + $this->webhookSuccessResponse($order, OrderStatus::PROCESSING, PaymentStatus::SUCCESS); + break; + + case 'pending': + # code... + # Throw email to admin that order is pending. + # Throw email to user that order is pending. + $order->order_status = OrderStatus::PENDING; + $order->payment_status = PaymentStatus::AWAITING_FOR_APPROVAL; + $order->save(); + $this->orderStatusManagementOnPayment($order, OrderStatus::PENDING, PaymentStatus::AWAITING_FOR_APPROVAL); + break; + + case 'failed': + # code... + # Throw email to admin that order is pending. + # Throw email to user that order is failure. + $order->order_status = OrderStatus::PENDING; + $order->payment_status = PaymentStatus::FAILED; + $order->save(); + $this->orderStatusManagementOnPayment($order, OrderStatus::PENDING, PaymentStatus::FAILED); + break; + } + } + } + + /** + * retrievePaymentMethod + * + * @param string $method_key + * @return object + */ + public function retrievePaymentMethod($method_key): object + { + try { + $retrieved_method = $this->stripe->paymentMethods->retrieve( + $method_key, + [] + ); + + return $retrieved_method; + } catch (Exception $e) { + throw $e; + } + } + + /** + * setIntent + * + * @param array $data + * @return array + */ + public function setIntent($data): array + { + try { + $intent = $this->stripe->setupIntents->create($data); + return [ + 'client_secret' => $intent->client_secret, + 'intent_id' => $intent->id, + ]; + } catch (Exception $e) { + throw $e; + } + } + + public function matchSucceededOrFailed($request) + { + if (isset($request?->data['object']['object']) && $request?->data['object']['object'] == 'charge') { + return $request?->data['object']; + } + return false; + } +} diff --git a/packages/marvel/src/Providers/EventServiceProvider.php b/packages/marvel/src/Providers/EventServiceProvider.php new file mode 100644 index 0000000..de1ca6d --- /dev/null +++ b/packages/marvel/src/Providers/EventServiceProvider.php @@ -0,0 +1,172 @@ + [ + DigitalProductNotifyLogsListener::class + ], + FlashSaleProcessed::class => [ + FlashSaleProductProcess::class + ], + Maintenance::class => [ + MaintenanceNotification::class + ], + MessageSent::class => [ + MessageParticipantNotification::class, + SendMessageNotification::class, + StoredMessagedNotifyLogsListener::class + ], + OrderCreated::class => [ + SendOrderCreationNotification::class, + StoredOrderNotifyLogsListener::class + ], + OrderReceived::class => [ + SendOrderReceivedNotification::class + ], + OrderProcessed::class => [ + ProductInventoryDecrement::class, + ], + OrderCancelled::class => [ + ProductInventoryRestore::class, + SendOrderCancelledNotification::class + ], + OrderDelivered::class => [ + SendOrderDeliveredNotification::class + ], + OrderStatusChanged::class => [ + SendOrderStatusChangedNotification::class + ], + OwnershipTransferStatusControl::class => [ + OwnershipTransferStatusControlListener::class + ], + PaymentSuccess::class => [ + SendPaymentSuccessNotification::class + ], + PaymentFailed::class => [ + SendPaymentFailedNotification::class + ], + PaymentMethods::class => [ + CheckAndSetDefaultCard::class + ], + ProductReviewApproved::class => [ + ProductReviewApprovedListener::class, + ], + ProductReviewRejected::class => [ + ProductReviewRejectedListener::class, + ], + ProcessUserData::class => [ + AppDataListener::class + ], + ProcessOwnershipTransition::class => [ + TransferredShopOwnershipNotification::class, + ], + QuestionAnswered::class => [ + SendQuestionAnsweredNotification::class + ], + RefundApproved::class => [ + RatingRemoved::class + ], + ReviewCreated::class => [ + SendReviewNotification::class + ], + RefundRequested::class => [ + SendRefundRequestedNotification::class + ], + RefundUpdate::class => [ + SendRefundUpdateNotification::class + ], + StoreNoticeEvent::class => [ + StoreNoticeListener::class, + StoredStoreNoticeNotifyLogsListener::class + ], + Maintenance::class => [ + MaintenanceNotification::class + ], + CommissionRateUpdateEvent::class => [ + CommissionRateUpdateListener::class + ], + ShopMaintenance::class => [ + ShopMaintenanceListener::class + ] + ]; + + /** + * Register any events for your application. + * + * @return void + */ + public function boot() + { + parent::boot(); + + // + } +} diff --git a/packages/marvel/src/Providers/GraphQLServiceProvider.php b/packages/marvel/src/Providers/GraphQLServiceProvider.php new file mode 100644 index 0000000..7abf201 --- /dev/null +++ b/packages/marvel/src/Providers/GraphQLServiceProvider.php @@ -0,0 +1,30 @@ + File::getRequire(__DIR__ . '/../../config/lighthouse.php'), + ]); + } +} diff --git a/packages/marvel/src/Providers/MarvelBroadcastServiceProvider.php b/packages/marvel/src/Providers/MarvelBroadcastServiceProvider.php new file mode 100644 index 0000000..b182c28 --- /dev/null +++ b/packages/marvel/src/Providers/MarvelBroadcastServiceProvider.php @@ -0,0 +1,26 @@ +loadBroadCastedRoutes(); + } + + public function loadBroadCastedRoutes(): void + { + $this->loadRoutesFrom(__DIR__ . '/../Rest/Channel.php'); + } +} diff --git a/packages/marvel/src/Providers/RestAPIServiceProvider.php b/packages/marvel/src/Providers/RestAPIServiceProvider.php new file mode 100644 index 0000000..db0cf75 --- /dev/null +++ b/packages/marvel/src/Providers/RestAPIServiceProvider.php @@ -0,0 +1,25 @@ +loadRoutes(); + } + + public function loadRoutes(): void + { + $this->loadRoutesFrom(__DIR__ . '/../Rest/Routes.php'); + } +} diff --git a/packages/marvel/src/Providers/WhereConditionsServiceProvider.php b/packages/marvel/src/Providers/WhereConditionsServiceProvider.php new file mode 100644 index 0000000..e578f44 --- /dev/null +++ b/packages/marvel/src/Providers/WhereConditionsServiceProvider.php @@ -0,0 +1,105 @@ +app->bind(Operator::class, SQLOperator::class); + } + + /** + * Bootstrap any application services. + */ + public function boot(Dispatcher $dispatcher): void + { + $dispatcher->listen( + RegisterDirectiveNamespaces::class, + function (RegisterDirectiveNamespaces $registerDirectiveNamespaces): string { + return __NAMESPACE__; + } + ); + + $dispatcher->listen( + ManipulateAST::class, + function (ManipulateAST $manipulateAST): void { + /** @var \Nuwave\Lighthouse\WhereConditions\Operator $operator */ + $operator = $this->app->make(Operator::class); + + $manipulateAST->documentAST + ->setTypeDefinition( + static::createWhereConditionsInputType( + static::DEFAULT_WHERE_CONDITIONS, + 'Dynamic WHERE conditions for queries.', + 'String' + ) + ) + ->setTypeDefinition( + PartialParser::enumTypeDefinition( + $operator->enumDefinition() + ) + ) + ->setTypeDefinition( + PartialParser::scalarTypeDefinition( + /** @lang GraphQL */ + ' + scalar Mixed @scalar(class: "MLL\\\GraphQLScalars\\\MixedScalar") + ' + ) + ); + } + ); + } + + public static function createWhereConditionsInputType(string $name, string $description, string $columnType): InputObjectTypeDefinitionNode + { + /** @var \Nuwave\Lighthouse\WhereConditions\Operator $operator */ + $operator = app(Operator::class); + + $operatorName = PartialParser + ::enumTypeDefinition( + $operator->enumDefinition() + ) + ->name + ->value; + $operatorDefault = $operator->default(); + + return PartialParser::inputObjectTypeDefinition( + /** @lang GraphQL */ + <<id === (int) $id; +// }); + +Broadcast::channel('store_notice.created.{userID}', function ($user, $userID) { + return (int) $user->id === (int) $userID; +}, ['middleware' => ['auth:sanctum']]); + +Broadcast::channel('order.created.{userID}', function ($user, $userID) { + return (int) $user->id === (int) $userID; +}, ['middleware' => ['auth:sanctum']]); + + +Broadcast::channel( + 'message.created.{userID}', + function ($user, $userID) { + return (int) $user->id === (int) $userID; + }, + ['middleware' => ['auth:sanctum']] +); diff --git a/packages/marvel/src/Rest/Routes.php b/packages/marvel/src/Rest/Routes.php new file mode 100644 index 0000000..a7c5b6d --- /dev/null +++ b/packages/marvel/src/Rest/Routes.php @@ -0,0 +1,532 @@ + ['auth:sanctum']]); + +Route::get('/email/verify/{id}/{hash}', [UserController::class, 'verifyEmail'])->name('verification.verify'); + +Route::post('/register', [UserController::class, 'register']); +Route::post('/token', [UserController::class, 'token']); +Route::post('/logout', [UserController::class, 'logout']); +Route::post('/forget-password', [UserController::class, 'forgetPassword']); +Route::post('/verify-forget-password-token', [UserController::class, 'verifyForgetPasswordToken']); +Route::post('/reset-password', [UserController::class, 'resetPassword']); +Route::post('/contact-us', [UserController::class, 'contactAdmin']); +Route::post('/social-login-token', [UserController::class, 'socialLogin']); +Route::post('/send-otp-code', [UserController::class, 'sendOtpCode']); +Route::post('/verify-otp-code', [UserController::class, 'verifyOtpCode']); +Route::post('/otp-login', [UserController::class, 'otpLogin']); +Route::get('top-authors', [AuthorController::class, 'topAuthor']); +Route::get('top-manufacturers', [ManufacturerController::class, 'topManufacturer']); +Route::get('popular-products', [ProductController::class, 'popularProducts']); +Route::get('best-selling-products', [ProductController::class, 'bestSellingProducts']); +Route::get('check-availability', [ProductController::class, 'checkAvailability']); +Route::get("products/calculate-rental-price", [ProductController::class, 'calculateRentalPrice']); +Route::post('import-products', [ProductController::class, 'importProducts']); +Route::post('import-variation-options', [ProductController::class, 'importVariationOptions']); +Route::get('export-products/{shop_id}', [ProductController::class, 'exportProducts']); +Route::get('export-variation-options/{shop_id}', [ProductController::class, 'exportVariableOptions']); +Route::post('generate-description', [ProductController::class, 'generateDescription']); +Route::post('import-attributes', [AttributeController::class, 'importAttributes']); +Route::get('export-attributes/{shop_id}', [AttributeController::class, 'exportAttributes']); +Route::get('download_url/token/{token}', [DownloadController::class, 'downloadFile'])->name('download_url.token'); +Route::get('export-order/token/{token}', [OrderController::class, 'exportOrder'])->name('export_order.token'); +Route::post('subscribe-to-newsletter', [UserController::class, 'subscribeToNewsletter'])->name('subscribeToNewsletter'); +Route::get('download-invoice/token/{token}', [OrderController::class, 'downloadInvoice'])->name('download_invoice.token'); +Route::post('webhooks/razorpay', [WebHookController::class, 'razorpay']); +Route::post('webhooks/stripe', [WebHookController::class, 'stripe']); +Route::post('webhooks/paypal', [WebHookController::class, 'paypal']); +Route::post('webhooks/mollie', [WebHookController::class, 'mollie']); +Route::post('webhooks/paystack', [WebHookController::class, 'paystack']); +Route::post('webhooks/paymongo', [WebHookController::class, 'paymongo']); +Route::post('webhooks/xendit', [WebHookController::class, 'xendit']); +Route::post('webhooks/iyzico', [WebHookController::class, 'iyzico']); +Route::post('webhooks/bkash', [WebHookController::class, 'bkash']); +Route::post('webhooks/flutterwave', [WebHookController::class, 'flutterwave']); + +Route::post('license-key/verify', [UserController::class, 'verifyLicenseKey']); + +Route::get('callback/flutterwave', [WebHookController::class, 'callback'])->name('callback.flutterwave'); + +Route::get('near-by-shop/{lat}/{lng}', [ShopController::class, 'nearByShop']); + +Route::get('store-notices', [StoreNoticeController::class, 'index'])->name('store-notices.index'); + +Route::apiResource('products', ProductController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('types', TypeController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('attachments', AttachmentController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('categories', CategoryController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('delivery-times', DeliveryTimeController::class, [ + 'only' => ['index', 'show'] +]); +Route::apiResource('languages', LanguageController::class, [ + 'only' => ['index', 'show'] +]); +Route::apiResource('tags', TagController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('refund-reasons', RefundReasonController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('resources', ResourceController::class, [ + 'only' => ['index', 'show'] +]); + +Route::get('featured-categories', 'Marvel\Http\Controllers\CategoryController@fetchFeaturedCategories'); + +Route::apiResource('coupons', CouponController::class, [ + 'only' => ['index', 'show'], +]); +Route::post('coupons/verify', [CouponController::class, 'verify']); +Route::apiResource('attributes', AttributeController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('shops', ShopController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('settings', SettingsController::class, [ + 'only' => ['index'], +]); +Route::apiResource('reviews', ReviewController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('questions', QuestionController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('feedbacks', FeedbackController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('authors', AuthorController::class, [ + 'only' => ['index', 'show'], +]); +Route::apiResource('manufacturers', ManufacturerController::class, [ + 'only' => ['index', 'show'], +]); +Route::post('orders/checkout/verify', [CheckoutController::class, 'verify']); +Route::apiResource('orders', OrderController::class, [ + 'only' => ['show', 'store'], +]); + +Route::post('/email/verification-notification', [UserController::class, 'sendVerificationEmail']) + ->middleware(['auth:sanctum', 'throttle:6,1']) + ->name('verification.send'); + +Route::post('orders/payment', [OrderController::class, 'submitPayment']); +Route::post('generate-descriptions', [AiController::class, 'generateDescription']); +Route::get('/payment-intent', [PaymentIntentController::class, 'getPaymentIntent']); + +Route::apiResource('faqs', FaqsController::class, [ + 'only' => ['index', 'show'], +]); + +Route::apiResource('terms-and-conditions', TermsAndConditionsController::class, [ + 'only' => ['index', 'show'], +]); + +Route::apiResource('flash-sale', FlashSaleController::class, [ + 'only' => ['index', 'show'], +]); + +Route::resource('refund-policies', RefundPolicyController::class, [ + 'only' => ['index', 'show'], +]); + + +Route::post('shop-maintenance-event', [ShopController::class, 'shopMaintenanceEvent']); + +/** + * ****************************************** + * Authorized Route for Customers only + * ****************************************** + */ + +Route::group(['middleware' => ['can:' . Permission::CUSTOMER, 'auth:sanctum', 'email.verified']], function () { + Route::post('/update-email', [UserController::class, 'updateUserEmail']); + Route::get('me', [UserController::class, 'me']); + Route::apiResource('orders', OrderController::class, [ + 'only' => ['index'], + ]); + Route::apiResource('reviews', ReviewController::class, [ + 'only' => ['store', 'update'] + ]); + Route::apiResource('questions', QuestionController::class, [ + 'only' => ['store'], + ]); + Route::apiResource('feedbacks', FeedbackController::class, [ + 'only' => ['store'], + ]); + Route::apiResource('abusive_reports', AbusiveReportController::class, [ + 'only' => ['store'], + ]); + Route::apiResource('conversations', ConversationController::class, [ + 'only' => ['index', 'store'], + ]); + Route::get('conversations/{conversation_id}', [ConversationController::class, 'show']); + Route::get('messages/conversations/{conversation_id}', [MessageController::class, 'index']); + Route::post('messages/conversations/{conversation_id}', [MessageController::class, 'store']); + Route::post('messages/seen/{conversation_id}', [MessageController::class, 'seen']); + Route::get('my-questions', [QuestionController::class, 'myQuestions']); + Route::get('my-reports', [AbusiveReportController::class, 'myReports']); + Route::post('wishlists/toggle', [WishlistController::class, 'toggle']); + Route::apiResource('wishlists', WishlistController::class, [ + 'only' => ['index', 'store', 'destroy'], + ]); + Route::get('wishlists/in_wishlist/{product_id}', [WishlistController::class, 'in_wishlist']); + Route::get('my-wishlists', [ProductController::class, 'myWishlists']); + Route::get('orders/tracking-number/{tracking_number}', 'Marvel\Http\Controllers\OrderController@findByTrackingNumber'); + Route::apiResource('attachments', AttachmentController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + + Route::put('users/{id}', [UserController::class, 'update']); + Route::post('/change-password', [UserController::class, 'changePassword']); + Route::post('/update-contact', [UserController::class, 'updateContact']); + Route::apiResource('address', AddressController::class, [ + 'only' => ['destroy'], + ]); + Route::apiResource( + 'refunds', + RefundController::class, + [ + 'only' => ['index', 'store', 'show'], + ] + ); + Route::get('downloads', [DownloadController::class, 'fetchDownloadableFiles']); + Route::post('downloads/digital_file', [DownloadController::class, 'generateDownloadableUrl']); + Route::get('/followed-shops-popular-products', [ShopController::class, 'followedShopsPopularProducts']); + Route::get('/followed-shops', [ShopController::class, 'userFollowedShops']); + Route::get('/follow-shop', [ShopController::class, 'userFollowedShop']); + Route::post('/follow-shop', [ShopController::class, 'handleFollowShop']); + Route::apiResource('cards', PaymentMethodController::class, [ + 'only' => ['index', 'store', 'update', 'destroy'], + ]); + Route::post('/set-default-card', [PaymentMethodController::class, 'setDefaultCard']); + Route::post('/save-payment-method', [PaymentMethodController::class, 'savePaymentMethod']); + // Route::apiResource('faqs', FaqsController::class, [ + // 'only' => ['index', 'show'], + // ]); + Route::apiResource('notify-logs', NotifyLogsController::class, [ + 'only' => ['index', 'show'], + ]); + Route::post('notify-log-seen', [NotifyLogsController::class, 'readNotifyLogs']); + Route::post('notify-log-read-all', [NotifyLogsController::class, 'readAllNotifyLogs']); +}); + +// Todo : Popular product on analytics route +// chawkbazar old code +// Route::get('popular-products', 'Marvel\Http\Controllers\AnalyticsController@popularProducts'); +// Route::get('popular-products', 'Marvel\Http\Controllers\AnalyticsController@popularProducts'); + +// chawkbazar new code +Route::get('popular-products', 'Marvel\Http\Controllers\ProductController@popularProducts'); + +/** + * ****************************************** + * Authorized Route for Staff & Store Owner + * ****************************************** + */ + + +Route::group( + ['middleware' => ['permission:' . Permission::STAFF . '|' . Permission::STORE_OWNER, 'auth:sanctum', 'email.verified']], + function () { + Route::apiResource('products', ProductController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + Route::apiResource('resources', ResourceController::class, [ + 'only' => ['store'] + ]); + Route::apiResource('attributes', AttributeController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + Route::apiResource('attribute-values', AttributeValueController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + Route::apiResource('orders', OrderController::class, [ + 'only' => ['update', 'destroy'], + ]); + + // Route::get('shop-notification/{id}', [ShopNotificationController::class, 'show']); + // Route::put('shop-notification/{id}', [ShopNotificationController::class, 'update']); + // Route::get('popular-products', [AnalyticsController::class, 'popularProducts']); + // Route::get('shops/refunds', 'Marvel\Http\Controllers\ShopController@refunds'); + Route::apiResource('questions', QuestionController::class, [ + 'only' => ['update'], + ]); + Route::apiResource('authors', AuthorController::class, [ + 'only' => ['store'], + ]); + Route::apiResource('manufacturers', ManufacturerController::class, [ + 'only' => ['store'], + ]); + Route::get('store-notices/getStoreNoticeType', [StoreNoticeController::class, 'getStoreNoticeType']); + Route::get('store-notices/getUsersToNotify', [StoreNoticeController::class, 'getUsersToNotify']); + Route::post('store-notices/read/', [StoreNoticeController::class, 'readNotice']); + Route::post('store-notices/read-all', [StoreNoticeController::class, 'readAllNotice']); + Route::apiResource('store-notices', StoreNoticeController::class, [ + 'only' => ['show', 'store', 'update', 'destroy'] + ]); + + Route::get('export-order-url/{shop_id?}', 'Marvel\Http\Controllers\OrderController@exportOrderUrl'); + Route::post('download-invoice-url', 'Marvel\Http\Controllers\OrderController@downloadInvoiceUrl'); + Route::apiResource('faqs', FaqsController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + Route::get('analytics', [AnalyticsController::class, 'analytics']); + Route::get('low-stock-products', [AnalyticsController::class, 'lowStockProducts']); + Route::get('category-wise-product', [AnalyticsController::class, 'categoryWiseProduct']); + Route::get('category-wise-product-sale', [AnalyticsController::class, 'categoryWiseProductSale']); + Route::get('draft-products', [ProductController::class, 'draftedProducts']); + Route::get('products-stock', [ProductController::class, 'productStock']); + Route::get('products-by-flash-sale', [FlashSaleController::class, 'getProductsByFlashSale']); + Route::get('top-rate-product', [AnalyticsController::class, 'topRatedProducts']); + Route::apiResource('coupons', CouponController::class, [ + 'only' => ['update'], + ]); + // Route::get('products-requested-for-flash-sale-by-vendor', [FlashSaleVendorRequestController::class, 'getProductsByFlashSaleVendorRequest']); + Route::get('requested-products-for-flash-sale', [FlashSaleVendorRequestController::class, 'getRequestedProductsForFlashSale']); + Route::apiResource('vendor-requests-for-flash-sale', FlashSaleVendorRequestController::class, [ + 'only' => ['index', 'show', 'store', 'destroy'], + ]); + } +); + + +/** + * ***************************************** + * Authorized Route for Store owner Only + * ***************************************** + */ + +Route::group( + ['middleware' => ['permission:' . Permission::STORE_OWNER, 'auth:sanctum', 'email.verified']], + function () { + Route::apiResource('shops', ShopController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + // Route::get('analytics', [AnalyticsController::class, 'analytics']); + Route::apiResource('withdraws', WithdrawController::class, [ + 'only' => ['store', 'index', 'show'], + ]); + Route::post('staffs', [ShopController::class, 'addStaff']); + Route::delete('staffs/{id}', [ShopController::class, 'deleteStaff']); + Route::get('staffs', [UserController::class, 'staffs']); + Route::get('my-shops', [ShopController::class, 'myShops']); + Route::post('transfer-shop-ownership', [ShopController::class, 'transferShopOwnership']); + + // Route::get('/admin/list', [UserController::class, 'admins']); + // Route::apiResource('notify-logs', NotifyLogsController::class, [ + // 'only' => ['index'], + // ]); + + // Route::post('notify-log-seen', [NotifyLogsController::class, 'readNotifyLogs']); + // Route::post('notify-log-read-all', [NotifyLogsController::class, 'readAllNotifyLogs']); + + // Route::apiResource('faqs', FaqsController::class, [ + // 'only' => ['store', 'update', 'destroy'], + // ]); + + Route::apiResource('flash-sale', FlashSaleController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + + Route::get('product-flash-sale-info', [FlashSaleController::class, 'getFlashSaleInfoByProductID']); + + Route::apiResource('terms-and-conditions', TermsAndConditionsController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + + Route::apiResource('coupons', CouponController::class, [ + 'only' => ['store', 'destroy'], + ]); + + Route::apiResource('terms-and-conditions', TermsAndConditionsController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + Route::get('/vendors/list', [UserController::class, 'vendors']); + // Route::post('products-request-for-flash-sale', [FlashSaleVendorRequestController::class, 'productsRequestForFlashSale']); + + Route::apiResource('ownership-transfer', OwnershipTransferController::class, [ + 'only' => ['index', 'show'], + ]); + } +); + +/** + * ***************************************** + * Authorized Route for Super Admin only + * ***************************************** + */ + +Route::group(['middleware' => ['permission:' . Permission::SUPER_ADMIN, 'auth:sanctum', 'email.verified']], function () { + // Route::get('messages/get-conversations/{shop_id}', [ConversationController::class, 'getConversationByShopId']); + // Route::get('analytics', [AnalyticsController::class, 'analytics']); + Route::apiResource('types', TypeController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + Route::apiResource('withdraws', WithdrawController::class, [ + 'only' => ['update', 'destroy'], + ]); + Route::apiResource('categories', CategoryController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + Route::apiResource('delivery-times', DeliveryTimeController::class, [ + 'only' => ['store', 'update', 'destroy'] + ]); + Route::apiResource('languages', LanguageController::class, [ + 'only' => ['store', 'update', 'destroy'] + ]); + Route::apiResource('tags', TagController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + Route::apiResource('refund-reasons', RefundReasonController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + Route::apiResource('resources', ResourceController::class, [ + 'only' => ['update', 'destroy'] + ]); + // Route::apiResource('coupons', CouponController::class, [ + // 'only' => ['store', 'update', 'destroy'], + // ]); + // Route::apiResource('order-status', OrderStatusController::class, [ + // 'only' => ['store', 'update', 'destroy'], + // ]); + Route::apiResource('reviews', ReviewController::class, [ + 'only' => ['destroy'] + ]); + Route::apiResource('questions', QuestionController::class, [ + 'only' => ['destroy'], + ]); + Route::apiResource('feedbacks', FeedbackController::class, [ + 'only' => ['update', 'destroy'], + ]); + Route::apiResource('abusive_reports', AbusiveReportController::class, [ + 'only' => ['index', 'show', 'update', 'destroy'], + ]); + Route::post('abusive_reports/accept', [AbusiveReportController::class, 'accept']); + Route::post('abusive_reports/reject', [AbusiveReportController::class, 'reject']); + Route::apiResource('settings', SettingsController::class, [ + 'only' => ['store'], + ]); + Route::apiResource('users', UserController::class); + Route::apiResource('authors', AuthorController::class, [ + 'only' => ['update', 'destroy'], + ]); + Route::apiResource('manufacturers', ManufacturerController::class, [ + 'only' => ['update', 'destroy'], + ]); + Route::post('users/block-user', [UserController::class, 'banUser']); + Route::post('users/unblock-user', [UserController::class, 'activeUser']); + Route::apiResource('taxes', TaxController::class); + Route::apiResource('shippings', ShippingController::class); + Route::post('approve-shop', [ShopController::class, 'approveShop']); + Route::post('disapprove-shop', [ShopController::class, 'disApproveShop']); + Route::post('approve-withdraw', [WithdrawController::class, 'approveWithdraw']); + Route::post('add-points', [UserController::class, 'addPoints']); + Route::post('users/make-admin', [UserController::class, 'makeOrRevokeAdmin']); + Route::apiResource( + 'refunds', + RefundController::class, + [ + 'only' => ['destroy', 'update'], + ] + ); + Route::apiResource('notify-logs', NotifyLogsController::class, [ + 'only' => ['destroy'], + ]); + // Route::apiResource('faqs', FaqsController::class, [ + // 'only' => ['store', 'update', 'destroy'], + // ]); + Route::get('new-shops', [ShopController::class, 'newOrInActiveShops']); + Route::post('approve-terms-and-conditions', [TermsAndConditionsController::class, 'approveTerm']); + Route::post('disapprove-terms-and-conditions', [TermsAndConditionsController::class, 'disApproveTerm']); + Route::get('/admin/list', [UserController::class, 'admins']); + + Route::get('/customers/list', [UserController::class, 'customers']); + Route::get('my-staffs', [UserController::class, 'myStaffs']); + Route::get('all-staffs', [UserController::class, 'allStaffs']); + Route::resource('refund-policies', RefundPolicyController::class, [ + 'only' => ['store', 'update', 'destroy'], + ]); + Route::post('approve-coupon', [CouponController::class, 'approveCoupon']); + Route::post('disapprove-coupon', [CouponController::class, 'disApproveCoupon']); + // Route::get('requested-products-for-flash-sale', [FlashSaleVendorRequestController::class, 'getRequestedProductsForFlashSale']); + Route::post('approve-flash-sale-requested-products', [FlashSaleVendorRequestController::class, 'approveFlashSaleProductsRequest']); + Route::post('disapprove-flash-sale-requested-products', [FlashSaleVendorRequestController::class, 'disapproveFlashSaleProductsRequest']); + Route::apiResource('vendor-requests-for-flash-sale', FlashSaleVendorRequestController::class, [ + 'only' => ['update'], + ]); + + Route::apiResource('ownership-transfer', OwnershipTransferController::class, [ + 'only' => ['update', 'destroy'], + ]); +}); + +Route::apiResource('became-seller', BecameSellerController::class); diff --git a/packages/marvel/src/Shop.php b/packages/marvel/src/Shop.php new file mode 100644 index 0000000..92850ef --- /dev/null +++ b/packages/marvel/src/Shop.php @@ -0,0 +1,31 @@ +request = app()->request; + } + + /** + * @param $action string + * @param $data array + * @return array + */ + public function call($action, $data) + { + if (!is_array($data)) { + return []; + } + if (!empty($data) && is_array($data)) { + $this->request->request->add($data); + } + return App::call(config('shop.controllers') . $action); + } +} diff --git a/packages/marvel/src/ShopServiceProvider.php b/packages/marvel/src/ShopServiceProvider.php new file mode 100644 index 0000000..98864f3 --- /dev/null +++ b/packages/marvel/src/ShopServiceProvider.php @@ -0,0 +1,316 @@ + \Spatie\Permission\Middleware\RoleMiddleware::class, + 'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class, + 'email.verified' => EnsureEmailIsVerified::class, + ]; + + + /** + * Perform post-registration booting of services. + * + * @return void + */ + public function boot(TypeRegistry $typeRegistry): void + { + $this->loadServiceProviders(); + $this->loadMiddleware(); + $this->bootConsole(); + $this->registerEnum($typeRegistry); + $this->givePermissionToSuperAdmin(); + $this->loadMigrations(); + $this->loadHelpers(); + Resource::withoutWrapping(); + } + + public function loadMigrations() + { + $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); + // $this->loadFactoriesFrom(__DIR__ . '/../database/factories'); + } + + /** + * If the helper file exists, require it. + */ + public function loadHelpers() + { + if (File::exists(__DIR__ . '/Helpers/helpers.php')) { + require(__DIR__ . '/Helpers/helpers.php'); + } + if (File::exists(__DIR__ . '/Helpers/ResourceHelpers.php')) { + require(__DIR__ . '/Helpers/ResourceHelpers.php'); + } + } + + /** + * Load Service Providers + * + * @return void + */ + public function loadServiceProviders(): void + { + foreach ($this->serviceProviders as $provider) { + App::register($provider); + } + } + + public function givePermissionToSuperAdmin() + { + Gate::before(function ($user, $ability) { + return $user->hasPermissionTo(Permission::SUPER_ADMIN) ? true : null; + }); + } + + public function registerEnum($typeRegistry) + { + foreach ($this->enums as $enum) { + $typeRegistry->register( + new LaravelEnumType($enum) + ); + } + } + + /** + * Perform post-registration booting of services. + * + * @return void + */ + public function bootConsole() + { + // Publishing is only necessary when using the CLI. + if ($this->app->runningInConsole()) { + $this->bootForConsole(); + } + } + + /** + * Register any package services. + * + * @return void + */ + public function register(): void + { + + $this->mergeConfigFrom(__DIR__ . '/../config/shop.php', 'shop'); + + config([ + 'auth' => File::getRequire(__DIR__ . '/../config/auth.php'), + 'cors' => File::getRequire(__DIR__ . '/../config/cors.php'), + 'cache' => File::getRequire(__DIR__ . '/../config/cache.php'), + 'graphql-playground' => File::getRequire(__DIR__ . '/../config/graphql-playground.php'), + 'laravel-omnipay' => File::getRequire(__DIR__ . '/../config/laravel-omnipay.php'), + 'media-library' => File::getRequire(__DIR__ . '/../config/media-library.php'), + 'permission' => File::getRequire(__DIR__ . '/../config/permission.php'), + 'sanctum' => File::getRequire(__DIR__ . '/../config/sanctum.php'), + 'services' => File::getRequire(__DIR__ . '/../config/services.php'), + 'scout' => File::getRequire(__DIR__ . '/../config/scout.php'), + 'sluggable' => File::getRequire(__DIR__ . '/../config/sluggable.php'), + 'constants' => File::getRequire(__DIR__ . '/../config/constants.php'), + 'newsletter' => File::getRequire(__DIR__ . '/../config/newsletter.php'), + 'paystack' => File::getRequire(__DIR__ . '/../config/paystack.php'), + 'graphiql' => File::getRequire(__DIR__ . '/../config/graphiql.php'), + 'sslcommerz' => File::getRequire(__DIR__ . '/../config/sslcommerz.php'), + 'broadcasting' => File::getRequire(__DIR__ . '/../config/broadcasting.php') + ]); + + // Register the service the package provides. + $this->app->singleton('shop', function () { + return new Shop(); + }); + + $this->app->singleton('payment', function ($app) { + $active_payment_gateway = ''; + $settings = Settings::first(); + + if (!empty(request()) && request()->has('payment_gateway') && !in_array(request()['payment_gateway'], [PaymentGatewayType::CASH_ON_DELIVERY, PaymentGatewayType::CASH])) { + $active_payment_gateway = ucfirst(strtolower(request()['payment_gateway'])); + } else { + $active_payment_gateway = $settings->options['defaultPaymentGateway']; + } + + try { + $gateway = 'Marvel\\Payments\\' . ucfirst($active_payment_gateway); + return new Payment($app->make($gateway)); + } catch (\Throwable $th) { + $gateway = 'Marvel\\Payments\\' . ucfirst($settings->options['defaultPaymentGateway']); + return new Payment($app->make($gateway)); + } + }); + + $this->app->singleton('ai', function ($app) { + $active_ai = ''; + $settings = Settings::first(); + + if (!empty(request()) && request()->has('artificial_intelligence')) { + $active_ai = ucfirst(strtolower(request()['artificial_intelligence'])); + } else { + $active_ai = $settings->options['defaultAi']; + } + + $ai = 'Marvel\\Ai\\' . ucfirst($active_ai); + return new Ai($app->make($ai)); + }); + + $this->app->singleton(MarvelVerification::class, function ($app) { + return new MarvelVerification(); + }); + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides(): array + { + return ['shop']; + } + + /** + * Console-specific booting. + * + * @return void + */ + protected function bootForConsole(): void + { + // Publishing the configuration file. + $this->publishes([ + __DIR__ . '/../config//shop.php' => config_path('shop.php'), + ], 'config'); + + $this->commands($this->commandList); + } + + + /** + * Load Middleware from shop + */ + protected function loadMiddleware(): void + { + if (!is_array($this->routeMiddleware) || empty($this->routeMiddleware)) { + return; + } + + foreach ($this->routeMiddleware as $alias => $middleware) { + $this->app->router->aliasMiddleware($alias, $middleware); + } + } +} diff --git a/packages/marvel/src/Traits/CalculatePaymentTrait.php b/packages/marvel/src/Traits/CalculatePaymentTrait.php new file mode 100644 index 0000000..d1d8fb9 --- /dev/null +++ b/packages/marvel/src/Traits/CalculatePaymentTrait.php @@ -0,0 +1,71 @@ +calculateEachItemTotal($variation, $item['order_quantity']); + } else { + $product = Product::findOrFail($item['product_id']); + $subtotal += $this->calculateEachItemTotal($product, $item['order_quantity']); + } + } + return $subtotal; + } catch (\Throwable $th) { + throw new MarvelException(NOT_FOUND); + } + } + + public function calculateDiscount($coupon, $subtotal) + { + if ($coupon->id) { + if ($coupon->type === CouponType::PERCENTAGE_COUPON) { + return $subtotal * ($coupon->amount / 100); + } else if ($coupon->type === CouponType::FIXED_COUPON) { + return $coupon->amount; + } + } else { + return 0; + } + } + + + public function calculateEachItemTotal($item, $quantity) + { + $total = 0; + if ($item->sale_price) { + $total += $item->sale_price * $quantity; + } else { + $total += $item->price * $quantity; + } + return $total; + } + + public function getUserWalletAmount($user) + { + $amount = 0; + $wallet = $user->wallet; + if (isset($wallet->available_points)) { + $amount = $this->walletPointsToCurrency($wallet->available_points); + } + return $amount; + } +} diff --git a/packages/marvel/src/Traits/ENVSetupTrait.php b/packages/marvel/src/Traits/ENVSetupTrait.php new file mode 100644 index 0000000..ee6960c --- /dev/null +++ b/packages/marvel/src/Traits/ENVSetupTrait.php @@ -0,0 +1,47 @@ +error('.env file not found. Please create the .env file in API root directory and try again.'); + return false; + } + } + + public function existingKeyValueInENV($targetKeys, $envContent) + { + $keyValuePairs = []; + + foreach ($targetKeys as $targetKey) { + // Search for the key in the content + preg_match("/^$targetKey=(.*)$/m", $envContent, $matches); + + // Check if the key was found + if (isset($matches[1])) { + $value = $matches[1]; + $keyValuePairs[] = [$targetKey, $value]; + } else { + $keyValuePairs[] = [$targetKey, 'Not found']; + } + } + + // Display the key-value pairs in a table + if (!empty($keyValuePairs)) { + info('Your existing key & value on the .env file right now:'); + table(['Key', 'Value'], $keyValuePairs); + } else { + $this->error('No key-value pairs found in the .env file'); + } + + return $keyValuePairs; + } +} diff --git a/packages/marvel/src/Traits/Excludable.php b/packages/marvel/src/Traits/Excludable.php new file mode 100644 index 0000000..90b95b0 --- /dev/null +++ b/packages/marvel/src/Traits/Excludable.php @@ -0,0 +1,27 @@ +getConnection()->getSchemaBuilder()->getColumnListing($this->getTable()); + } + + /** + * Exclude an array of elements from the result. + * @param $query + * @param $columns + * @return mixed + */ + public function scopeExclude($query, $columns) + { + return $query->select(array_diff($this->getTableColumns(), (array) $columns)); + } +} diff --git a/packages/marvel/src/Traits/Helper.php b/packages/marvel/src/Traits/Helper.php new file mode 100644 index 0000000..0846a14 --- /dev/null +++ b/packages/marvel/src/Traits/Helper.php @@ -0,0 +1,21 @@ +order_status; + $order->order_status = $status; + $new_order_status = $order->order_status; + + if ($prev_order_status !== $new_order_status) { + $payment_gateway_type = isset($order->payment_gateway) ? $order->payment_gateway : PaymentGatewayType::CASH_ON_DELIVERY; + $usedPaymentGateway = !in_array($payment_gateway_type, [PaymentGatewayType::CASH, PaymentGatewayType::CASH_ON_DELIVERY]); + $isPaymentSuccess = $order->payment_status === PaymentStatus::SUCCESS; + if ($usedPaymentGateway) { + if ($isPaymentSuccess) { + $this->manageVendorBalance($order, $new_order_status, $prev_order_status); + $this->orderStatusManagementOnPayment($order, $new_order_status, ''); + } else { + $this->orderStatusManagementOnPayment($order, $new_order_status, $order->payment_status); + } + } else { + $this->manageVendorBalance($order, $new_order_status, $prev_order_status); + $this->orderStatusManagementOnCOD($order, $prev_order_status, $new_order_status); + } + } + $order->save(); + + try { + $children = json_decode($order->children); + } catch (\Throwable $th) { + $children = $order->children; + } + if (is_array($children) && count($children) && $order->order_status === OrderStatusEnum::CANCELLED) { + foreach ($order->children as $child_order) { + $child_order->order_status = $status; + $child_order->save(); + } + } + return $order; + } +} diff --git a/packages/marvel/src/Traits/OrderSmsTrait.php b/packages/marvel/src/Traits/OrderSmsTrait.php new file mode 100644 index 0000000..b767c31 --- /dev/null +++ b/packages/marvel/src/Traits/OrderSmsTrait.php @@ -0,0 +1,149 @@ +language; + App::setLocale($language); + $customerName = $this->getCustomerName($order); + $smsArray = [ + 'order' => $order, + 'language' => $order->language ?? DEFAULT_LANGUAGE, + 'smsEventName' => EventType::ORDER_CANCELLED, + 'adminMessage' => __('sms.order.cancelOrder.admin.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number, 'customer_name' => $customerName]), + 'customerMessage' => __('sms.order.cancelOrder.customer.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number, 'customer_name' => $customerName]), + 'storeOwnerMessage' => __('sms.order.cancelOrder.storeOwner.message'), + ]; + $this->sendSmsOnOrderEvent($smsArray); + } + + public function sendOrderCreationSms(Order $order): void + { + $language = $order->language; + App::setLocale($language); + $smsArray = [ + 'order' => $order, + 'language' => $order->language ?? DEFAULT_LANGUAGE, + 'smsEventName' => EventType::ORDER_CREATED, + 'adminMessage' => __('sms.order.orderCreated.admin.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number]), + 'customerMessage' => __('sms.order.orderCreated.customer.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number]), + 'storeOwnerMessage' => __('sms.order.orderCreated.storeOwner.message'), + ]; + $this->sendSmsOnOrderEvent($smsArray); + } + + public function sendPaymentDoneSuccessfullySms(Order $order): void + { + $language = $order->language; + App::setLocale($language); + $smsArray = [ + 'order' => $order, + 'language' => $order->language ?? DEFAULT_LANGUAGE, + 'smsEventName' => EventType::ORDER_PAYMENT_SUCCESS, + 'adminMessage' => __('sms.order.paymentSuccessOrder.admin.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number]), + 'customerMessage' => __('sms.order.paymentSuccessOrder.customer.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number]), + 'storeOwnerMessage' => __('sms.order.paymentSuccessOrder.storeOwner.message'), + ]; + $this->sendSmsOnOrderEvent($smsArray); + } + + public function sendOrderStatusChangeSms(Order $order): void + { + $language = $order->language; + App::setLocale($language); + $status = ucfirst(str_replace('-', ' ', $order->order_status)); + $smsArray = [ + 'order' => $order, + 'language' => $order->language ?? DEFAULT_LANGUAGE, + 'smsEventName' => EventType::ORDER_STATUS_CHANGED, + 'adminMessage' => __('sms.order.statusChangeOrder.admin.message', [ + 'ORDER_TRACKING_NUMBER' => $order->tracking_number, + 'order_status' => $status + ]), + 'customerMessage' => __('sms.order.statusChangeOrder.customer.message', [ + 'ORDER_TRACKING_NUMBER' => $order->tracking_number, + 'order_status' => $status + ]), + 'storeOwnerMessage' => __('sms.order.statusChangeOrder.storeOwner.message', ['order_status' => $status]), + ]; + $this->sendSmsOnOrderEvent($smsArray, false); + } + + public function sendOrderDeliveredSms($order): void + { + $language = $order->language; + App::setLocale($language); + $smsArray = [ + 'order' => $order, + 'language' => $order->language ?? DEFAULT_LANGUAGE, + 'smsEventName' => EventType::ORDER_DELIVERED, + 'adminMessage' => __('sms.order.deliverOrder.admin.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number]), + 'customerMessage' => __('sms.order.deliverOrder.customer.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number]), + 'storeOwnerMessage' => __('sms.order.deliverOrder.storeOwner.message'), + ]; + $this->sendSmsOnOrderEvent($smsArray, false); + } + + + public function sendPaymentFailedSms($order): void + { + $language = $order->language; + App::setLocale($language); + $smsArray = [ + 'order' => $order, + 'language' => $order->language ?? DEFAULT_LANGUAGE, + 'smsEventName' => EventType::ORDER_PAYMENT_FAILED, + 'adminMessage' => __('sms.order.paymentFailedOrder.admin.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number]), + 'customerMessage' => __('sms.order.paymentFailedOrder.customer.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number]), + 'storeOwnerMessage' => __('sms.order.paymentFailedOrder.storeOwner.message'), + ]; + $this->sendSmsOnOrderEvent($smsArray, false); + } + protected function getCustomerName($order) + { + $customerName = $order->customer; + if (!$customerName) { + $customerName = "Guest Customer"; + } else { + $customerName = $order->customer->name; + } + return $customerName; + } + public function sendRefundRequestedSms($refund): void + { + $order = $refund->order; + $language = $order->language; + App::setLocale($language); + $smsArray = [ + 'order' => $order, + 'language' => $order->language ?? DEFAULT_LANGUAGE, + 'smsEventName' => EventType::ORDER_REFUND, + 'adminMessage' => __('sms.order.refundRequested.admin.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number]), + 'customerMessage' => __('sms.order.refundRequested.customer.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number]), + ]; + $this->sendSmsOnRefund($smsArray); + } + public function sendRefundUpdateSms($refund): void + { + $order = $refund->order; + $language = $order->language; + App::setLocale($language); + $smsArray = [ + 'order' => $order, + 'language' => $order->language ?? DEFAULT_LANGUAGE, + 'smsEventName' => EventType::ORDER_REFUND, + 'adminMessage' => __('sms.order.refundUpdated.admin.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number, ':refund_status' => $refund->status]), + 'customerMessage' => __('sms.order.refundUpdated.customer.message', ['ORDER_TRACKING_NUMBER' => $order->tracking_number, ':refund_status' => $refund->status]), + ]; + $this->sendSmsOnRefund($smsArray); + } +} diff --git a/packages/marvel/src/Traits/OrderStatusManagerWithPaymentTrait.php b/packages/marvel/src/Traits/OrderStatusManagerWithPaymentTrait.php new file mode 100644 index 0000000..6e1f481 --- /dev/null +++ b/packages/marvel/src/Traits/OrderStatusManagerWithPaymentTrait.php @@ -0,0 +1,328 @@ +checkIfChildOrder($order, 'add'); + //check if previous status was completed then we need to deduct the amount from vendor balance + elseif ($prev_order_status === OrderStatus::COMPLETED) $this->checkIfChildOrder($order, 'deduct'); + } + + /** + * checkIfChildOrder + * + * @param mixed $order + * @param mixed $type + * @return void + */ + public function checkIfChildOrder($order, $type) + { + //check if order is child order + if ($order->parent_id) { + $parent_order = Order::find($order->parent_id); + //check if parent order is mark completed then add vendor balance or continue + if ($parent_order->order_status === OrderStatus::COMPLETED) + $this->updateBalanceShop($order, $type); + } else { + //this is a parent order and check if a child order is completed then add vendor balance or continue + $child_orders = $order->children; + if ($child_orders->count() > 0) { + foreach ($child_orders as $child_order) { + if ($child_order->order_status === OrderStatus::COMPLETED) + $this->updateBalanceShop($child_order, $type); + } + } + } + } + + + /** + * updateBalanceShop + * + * @param mixed $order + * @return void + */ + protected function updateBalanceShop($order, $action_type = 'add') + { + $balance = Balance::where('shop_id', '=', $order->shop_id)->first(); + $settings = Settings::getData(); + $isMultiCommissionRate = $settings['options']['isMultiCommissionRate']; + $total_earnings = $balance->total_earnings; + $adminCommissionDefaultRate = $this->getCommissionRate($total_earnings); + $adminCommissionCustomRate = $balance->admin_commission_rate; + if ($isMultiCommissionRate) { + if (!$balance->is_custom_commission) { + $shop_earnings = ($order->total * (100 - $adminCommissionDefaultRate)) / 100; + // $balance->admin_commission_rate = $adminCommissionDefaultRate; + } else { + $shop_earnings = ($order->total * (100 - $adminCommissionCustomRate)) / 100; + } + } else { + $shop_earnings = ($order->total * (100 - $adminCommissionCustomRate)) / 100; + } + + if ($action_type == 'deduct') $shop_earnings = $shop_earnings * -1; + $balance->total_earnings = $balance->total_earnings + $shop_earnings; + + if ($isMultiCommissionRate) { + if (!$balance->is_custom_commission) { + $updateAdminCommissionRate = $this->getCommissionRate($balance->total_earnings); + $balance->admin_commission_rate = $updateAdminCommissionRate; + } + } + + $balance->current_balance = $balance->current_balance + $shop_earnings; + $balance->save(); + if ($isMultiCommissionRate) { + if (!$balance->is_custom_commission) { + if ($adminCommissionDefaultRate != $updateAdminCommissionRate) { + event(new CommissionRateUpdateEvent($order->shop, $balance)); + } + } + } + } + + public function getCommissionRate($total_earnings) + { + $commission = Commission::where('min_balance', '<=', $total_earnings) + ->where(function ($query) use ($total_earnings) { + $query->whereRaw('CAST(max_balance AS UNSIGNED) >= ?', [$total_earnings]) + ->orWhere('max_balance', 'over'); + }) + ->first(); + return $commission->commission ?? 0; + } + + + /** + * orderStatusManagementOnPayment + * + * @param mixed $order + * @param mixed $order_status + * @param mixed $payment_status + * @return void + */ + public function orderStatusManagementOnPayment($order, $order_status, $payment_status) + { + + switch ($payment_status) { + case PaymentStatus::SUCCESS: + event(new PaymentSuccess($order)); + break; + case PaymentStatus::FAILED: + event(new PaymentFailed($order)); + break; + case PaymentStatus::REVERSAL: + event(new PaymentFailed($order)); + break; + case PaymentStatus::PENDING: + # code... + # send notification to user about order is pending. + break; + case PaymentStatus::PROCESSING: + # code... + # send notification to user about order is processing. + break; + + case PaymentStatus::AWAITING_FOR_APPROVAL: + # code... + # send notification to user about order is pending & payment is waiting for approval. + break; + } + $this->fireEventOnOrderStatus($order, $order_status); + } + + /** + * orderStatusManagementOnCOD + * + * @param mixed $order + * @param string $prev_status + * @param string $new_status + * @return void + */ + public function orderStatusManagementOnCOD($order, $prev_status, $new_status) + { + switch ($new_status) { + case OrderStatus::CANCELLED: + # code... + $this->orderStatusManagementOnCancelled($order); + event(new OrderCancelled($order)); + break; + + case OrderStatus::REFUNDED: + # code... + event(new OrderCancelled($order)); + break; + + case OrderStatus::FAILED: + # code... + break; + case OrderStatus::PROCESSING: + # do nothing + # this event already has been fired from OrderRepository + break; + default: + event(new OrderStatusChanged($order)); + break; + } + } + + + public function fireEventOnOrderStatus($order, $currentStatus) + { + switch ($currentStatus) { + case OrderStatus::CANCELLED: + # code... + $this->orderStatusManagementOnCancelled($order); + event(new OrderCancelled($order)); + break; + + case OrderStatus::REFUNDED: + $this->orderStatusManagementOnCancelled($order); + event(new OrderCancelled($order)); + break; + + case OrderStatus::FAILED: + $this->orderStatusManagementOnCancelled($order); + event(new OrderCancelled($order)); + break; + + default: + event(new OrderStatusChanged($order)); + break; + } + } + + /** + * orderAlreadyExists + * + * @param mixed $order + * @param string $tracking_number + * @return bool + */ + public function orderAlreadyExists($tracking_number) + { + try { + $order_exists = false; + $order_exists = Order::where('tracking_number', '=', $tracking_number)->exists(); + if ($order_exists) { + return true; + } + return $order_exists; + } catch (\Exception $e) { + throw $e; + } + } + /** + * orderStatusManagementOnCancelled + * + * @param mixed $order + * @return void + */ + public function orderStatusManagementOnCancelled($order) + { + if ($order->parent_id) { + $parent_order = Order::find($order->parent_id); + } else { + $parent_order = $order; + } + + $tax_amount = $parent_order->sales_tax; + $delivery_fee = $parent_order->delivery_fee; + $currently_paid = $parent_order->paid_total; + $amount = $currently_paid - $tax_amount - $delivery_fee; + $tax_rate = 0; + if ($amount > 0) { + $tax_rate = $tax_amount / $amount; + //for precision + $tax_rate = $tax_rate * 1000000; + } + + // if order is child order + if ($order->parent_id) { + $reducedRevenueAmount = $amount - $order->amount; + $cancelledTaxAmount = ($order->amount * $tax_rate) / 1000000; + $reducedTaxAmount = $parent_order->sales_tax - $cancelledTaxAmount; //for precision + + $parent_order->sales_tax = $reducedTaxAmount; + $parent_order->cancelled_tax += $cancelledTaxAmount; + + $parent_order->paid_total = $reducedRevenueAmount + $reducedTaxAmount + $delivery_fee; + $parent_order->total = $reducedRevenueAmount + $reducedTaxAmount + $delivery_fee; + $parent_order->cancelled_amount = $parent_order->cancelled_amount + $order->amount + ($order->amount * $tax_rate) / 1000000; + $parent_order->save(); + //TODO: give refund to customer if order is pre paid + if ($parent_order->paid_total == 0) { + $parent_order->cancelled_delivery_fee = $parent_order->delivery_fee; + $parent_order->delivery_fee = 0; + $parent_order->sales_tax = 0; + $parent_order->save(); + } + + //add cancel amount to the order + $order->cancelled_amount = $order->total; + $order->paid_total = 0; + $order->total = 0; + $order->save(); + } else { + $childOrders = $parent_order->children; + foreach ($childOrders as $childOrder) { + if ($childOrder->order_status == OrderStatus::CANCELLED) continue; + $childOrder->cancelled_amount = $childOrder->total; + $childOrder->paid_total = 0; + $childOrder->total = 0; + $childOrder->save(); + } + $parent_order->cancelled_amount += $parent_order->paid_total; + $parent_order->cancelled_tax += $parent_order->sales_tax; + $parent_order->cancelled_delivery_fee = $parent_order->delivery_fee; + $parent_order->sales_tax = 0; + $parent_order->delivery_fee = 0; + $parent_order->paid_total = 0; + $parent_order->total = 0; + $parent_order->save(); + //TODO: give refund to customer if order is pre paid + + } + } + + + /** + * The function checks if the order status is one of the final statuses. + * + * @param Order order The parameter "order" is an instance of the Order class. + * + * @return bool a boolean value, indicating whether the order status is final or not. + */ + public function checkOrderStatusIsFinal(Order $order): bool + { + $orderStatuses = [OrderStatus::COMPLETED, OrderStatus::CANCELLED, OrderStatus::REFUNDED]; + return in_array($order->order_status, $orderStatuses); + } +} diff --git a/packages/marvel/src/Traits/PaymentStatusManagerWithOrderTrait.php b/packages/marvel/src/Traits/PaymentStatusManagerWithOrderTrait.php new file mode 100644 index 0000000..3be5622 --- /dev/null +++ b/packages/marvel/src/Traits/PaymentStatusManagerWithOrderTrait.php @@ -0,0 +1,375 @@ +payment_intent)) { + // foreach ($order->payment_intent as $key => $intent) { + // if (strtoupper($settings->options['paymentGateway']) === $order->payment_gateway) { + // $chosen_intent = $intent; + // } + // } + // } + + // for multi-gateway options + if (isset($order->payment_intent)) { + foreach ($order->payment_intent as $key => $intent) { + if (strtoupper($request['payment_gateway']) === $order->payment_gateway) { + $chosen_intent = $intent; + } + } + } + + $intent_secret = isset($chosen_intent->payment_intent_info) ? $chosen_intent->payment_intent_info['client_secret'] : null; + $payment_intent_id = isset($chosen_intent->payment_intent_info) ? $chosen_intent->payment_intent_info['payment_id'] : null; + + if (isset($intent_secret) && isset($payment_intent_id)) { + $retrieved_intent = Payment::retrievePaymentIntent($payment_intent_id); + $retrieved_intent_status = $retrieved_intent->status; + + switch ($retrieved_intent_status) { + case 'succeeded': + $this->paymentSuccess($order); + break; + + case 'requires_action': + $this->paymentProcessing($order); + break; + + case 'requires_payment_method': + $this->paymentFailed($order); + break; + } + } + } catch (Exception $e) { + throw new \Exception(SOMETHING_WENT_WRONG); + } + } + + /** + * Status change for paypal + * + * @throws Exception + */ + public function paypal(Order $order, Request $request, Settings $settings): void + { + try { + $chosen_intent = ''; + + // for multi-gateway options + if (isset($order->payment_intent)) { + foreach ($order->payment_intent as $key => $intent) { + if (strtoupper($request['payment_gateway']) === $order->payment_gateway) { + $chosen_intent = $intent; + } + } + } + + + $paymentId = isset($chosen_intent->payment_intent_info) ? $chosen_intent->payment_intent_info['payment_id'] : null; + if (isset($paymentId)) { + $payment = Payment::verify($paymentId); + if ($payment) { + $paymentStatus = $payment["status"]; + switch (strtolower($paymentStatus)) { + case "completed": + $this->paymentSuccess($order); + break; + case "payer_action_required": + $this->paymentProcessing($order); + break; + } + } + } + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * Status change for razorpay + * + * @throws Exception + */ + public function razorpay(Order $order, Request $request, Settings $settings): void + { + try { + $chosen_intent = ''; + + // for multi-gateway options + if (isset($order->payment_intent)) { + foreach ($order->payment_intent as $key => $intent) { + if (strtoupper($request['payment_gateway']) === $order->payment_gateway) { + $chosen_intent = $intent; + } + } + } + + $paymentId = isset($chosen_intent->payment_intent_info) ? $chosen_intent->payment_intent_info['payment_id'] : null; + if (isset($paymentId)) { + $paymentStatus = Payment::verify($paymentId); + if ($paymentStatus) { + switch (strtolower($paymentStatus)) { + case "paid": + $this->paymentSuccess($order); + break; + case "attempted": + $this->paymentProcessing($order); + break; + case "failed": + $this->paymentFailed($order); + } + } + } + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + + /** + * Status change for mollie + * + * @throws Exception + */ + public function mollie(Order $order, Request $request, Settings $settings): void + { + try { + $chosen_intent = ''; + + // for multi-gateway options + if (isset($order->payment_intent)) { + foreach ($order->payment_intent as $key => $intent) { + if (ucfirst($request['payment_gateway']) === $intent->payment_gateway) { + $chosen_intent = $intent; + } + } + } + + $paymentId = isset($chosen_intent->payment_intent_info) ? $chosen_intent->payment_intent_info['payment_id'] : null; + if (isset($paymentId)) { + $paymentStatus = Payment::verify($paymentId); + if ($paymentStatus) { + switch (strtolower($paymentStatus)) { + case "paid": + $this->paymentSuccess($order); + break; + case "pending": + $this->paymentAwaitingForApproval($order); + break; + case "failed": + $this->paymentFailed($order); + } + } + } + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * Status change for paystack + * + * @throws Exception + */ + public function paystack(Order $order, Request $request, Settings $settings): void + { + try { + $chosen_intent = ''; + + // for multi-gateway options + if (isset($order->payment_intent)) { + foreach ($order->payment_intent as $key => $intent) { + if (strtoupper($request['payment_gateway']) === $order->payment_gateway) { + $chosen_intent = $intent; + } + } + } + + $paymentId = isset($chosen_intent->payment_intent_info) ? $chosen_intent->payment_intent_info['payment_id'] : null; + if (isset($paymentId)) { + $paymentStatus = Payment::verify($paymentId); + if ($paymentStatus) { + switch (strtolower($paymentStatus)) { + case "success": + $this->paymentSuccess($order); + break; + case "failed": + $this->paymentFailed($order); + } + } + } + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + /** + * Status change for iyzico + * + * @throws Exception + */ + public function iyzico(Order $order, Request $request, Settings $settings): void + { + try { + $chosen_intent = ''; + // for multi-gateway options + if (isset($order->payment_intent)) { + foreach ($order->payment_intent as $key => $intent) { + if (strtoupper($request['payment_gateway']) === $order->payment_gateway) { + $chosen_intent = $intent; + } + } + } + + $paymentId = isset($chosen_intent->payment_intent_info) ? $chosen_intent->payment_intent_info['payment_id'] : null; + if (isset($paymentId)) { + $paymentStatus = Payment::verify($paymentId); + if ($paymentStatus) { + switch (strtolower($paymentStatus)) { + case "success": + $this->paymentSuccess($order); + break; + case "failed": + $this->paymentFailed($order); + case "init_threeds": + $this->paymentProcessing($order); + case "callback_threeds": + $this->paymentProcessing($order); + } + } + } + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + + /** + * Status change for flutterwave + * + * @throws Exception + */ + public function flutterwave(Order $order, Request $request, Settings $settings): void + { + try { + $chosen_intent = ''; + // for multi-gateway options + if (isset($order->payment_intent)) { + foreach ($order->payment_intent as $key => $intent) { + if (strtoupper($request['payment_gateway']) === $order->payment_gateway) { + $chosen_intent = $intent; + } + } + } + + $paymentId = isset($chosen_intent->payment_intent_info) ? $chosen_intent->payment_intent_info['payment_id'] : null; + if (isset($paymentId)) { + $paymentStatus = Payment::verify($paymentId); + if ($paymentStatus) { + switch (strtolower($paymentStatus)) { + case "successful": + $this->paymentSuccess($order); + break; + case "failed": + $this->paymentFailed($order); + } + } + } + } catch (Exception $e) { + throw new Exception(SOMETHING_WENT_WRONG_WITH_PAYMENT); + } + } + + /** + * Update DB status after payment success + * + * @param $order + * @return void + */ + protected function paymentSuccess($order): void + { + $order->order_status = OrderStatus::PROCESSING; + $order->payment_status = PaymentStatus::SUCCESS; + $order->save(); + try { + $children = json_decode($order->children); + } catch (\Throwable $th) { + $children = $order->children; + } + if (is_array($children) && count($children)) { + foreach ($order->children as $child_order) { + $child_order->order_status = OrderStatus::PROCESSING; + $child_order->payment_status = PaymentStatus::SUCCESS; + $child_order->save(); + } + } + $this->orderStatusManagementOnPayment($order, $order->order_status, $order->payment_status); + } + + /** + * Update DB status after payment processing + * + * @param $order + * @return void + */ + protected function paymentProcessing($order): void + { + $order->order_status = OrderStatus::PROCESSING; + $order->payment_status = PaymentStatus::PROCESSING; + $order->save(); + $this->orderStatusManagementOnPayment($order, $order->order_status, $order->payment_status); + } + + /** + * paymentAwaitingForApproval + * + * @param mixed $order + * @return void + */ + public function paymentAwaitingForApproval($order): void + { + $order->order_status = OrderStatus::PENDING; + $order->payment_status = PaymentStatus::AWAITING_FOR_APPROVAL; + $order->save(); + $this->orderStatusManagementOnPayment($order, $order->order_status, $order->payment_status); + } + + /** + * Update DB status after payment failed + * + * @param $order + * @return void + */ + protected function paymentFailed($order): void + { + $order->order_status = OrderStatus::FAILED; + $order->payment_status = PaymentStatus::FAILED; + $order->save(); + $this->orderStatusManagementOnPayment($order, $order->order_status, $order->payment_status); + } +} \ No newline at end of file diff --git a/packages/marvel/src/Traits/PaymentTrait.php b/packages/marvel/src/Traits/PaymentTrait.php new file mode 100644 index 0000000..d22714e --- /dev/null +++ b/packages/marvel/src/Traits/PaymentTrait.php @@ -0,0 +1,370 @@ +where('tracking_number', '=', $order_tracking_number) + ->orWhere('order_id', '=', $order_tracking_number); + })->first(); + } + + /** + * processPaymentIntent + * + * @param mixed $request + * @param mixed $settings + * @return object + * @throws Exception + */ + public function processPaymentIntent($request, Settings $settings): object + { + try { + $chosen_payment_gateway = ''; + $is_payment_intent_exists = false; + + $order_tracking_number = $request['tracking_number']; + $requested_payment_gateway = $request['payment_gateway']; + $order = $this->fetchOrderByTrackingNumber($order_tracking_number); + $initial_payment_gateway = $order->payment_gateway; + + if ($requested_payment_gateway !== $initial_payment_gateway) { + $chosen_payment_gateway = ucfirst(strtolower($request['payment_gateway'])); + } else { + if (isset($settings->options['paymentGateway'])) { + foreach ($settings->options['paymentGateway'] as $key => $available_gateway) { + if (strtoupper($available_gateway['name']) === $requested_payment_gateway) { + $chosen_payment_gateway = ucfirst($available_gateway['name']); + } + } + } + } + + if (isset($chosen_payment_gateway) && !empty($chosen_payment_gateway)) { + $is_payment_intent_exists = $this->paymentIntentExists($order_tracking_number, $chosen_payment_gateway); + if (!$is_payment_intent_exists) { + + $newPaymentIntent = $this->savePaymentIntent($order, $chosen_payment_gateway, $request); + + if ($request['recall_gateway'] && isset($newPaymentIntent)) { + $this->deleteOlderPaymentIntent($order_tracking_number, ucfirst(strtolower($order->payment_gateway))); + $this->updateOrderData($initial_payment_gateway, $chosen_payment_gateway, $order); + } + return $newPaymentIntent; + } + } + + return PaymentIntent::where(function ($query) use ($order_tracking_number) { + $query->where('tracking_number', '=', $order_tracking_number) + ->orWhere('order_id', '=', $order_tracking_number); + })->where('payment_gateway', '=', ucfirst($chosen_payment_gateway))->first(); + } catch (\Throwable $e) { + throw $e; + } + } + + + /** + * paymentIntentExists + * + * @param string $order_tracking_number + * @param string $payment_gateway + * @return bool + */ + public function paymentIntentExists(string $order_tracking_number, string $payment_gateway): bool + { + return PaymentIntent::where(function ($query) use ($order_tracking_number) { + $query->where('tracking_number', '=', $order_tracking_number) + ->orWhere('order_id', '=', $order_tracking_number); + })->where('payment_gateway', '=', ucfirst($payment_gateway))->exists(); + } + + /** + * deleteOlderPaymentIntent + * + * @param string $order_tracking_number + * @param string $payment_gateway + * @return object + */ + public function deleteOlderPaymentIntent(string $order_tracking_number, string $payment_gateway) + { + return PaymentIntent::where(function ($query) use ($order_tracking_number) { + $query->where('tracking_number', '=', $order_tracking_number) + ->orWhere('order_id', '=', $order_tracking_number); + })->where('payment_gateway', '=', ucfirst($payment_gateway))->forceDelete(); + } + + + /** + * updateOrderData + * + * @param string $initial_payment_gateway + * @param string $chosen_payment_gateway + * @param object $order + * @return void + */ + public function updateOrderData(string $initial_payment_gateway, string $chosen_payment_gateway, object $order): void + { + $order['altered_payment_gateway'] = $initial_payment_gateway; + $order['payment_gateway'] = strtoupper($chosen_payment_gateway); + $order->save(); + try { + $children = json_decode($order->children); + } catch (\Throwable $th) { + $children = $order->children; + } + if (is_array($children) && count($children)) { + foreach ($order->children as $child_order) { + $child_order->payment_gateway = strtoupper($chosen_payment_gateway); + $child_order->altered_payment_gateway = $initial_payment_gateway; + $child_order->save(); + } + } + } + + + /** + * savePaymentIntent + * + * @param mixed $order + * @param string $payment_gateway + * @param mixed $request + * @return object + */ + public function savePaymentIntent($order, $payment_gateway, $request) + { + return PaymentIntent::create([ + 'order_id' => $order->id, + "tracking_number" => $order->tracking_number, + "payment_gateway" => $payment_gateway, + "payment_intent_info" => $this->createPaymentIntent($order, $request, $payment_gateway), + ]); + } + + + /** + * createPaymentIntent + * + * @param mixed $order + * @param mixed $request + * @param string $payment_gateway + * @return array + * @throws Exception + */ + public function createPaymentIntent(Order $order, Request $request, string $payment_gateway): array + { + $created_intent = [ + "amount" => $order->paid_total - intval($order?->wallet?->amount), + "order_tracking_number" => $order->tracking_number, + ]; + if ($request->user() !== null) { + $created_intent["user_email"] = $order->customer->email; + } + + if ($request->user() !== null && strtoupper($payment_gateway) === PaymentGatewayType::STRIPE) { + $customer = $this->createPaymentCustomer($request); + $created_intent["customer"] = $customer["customer_id"]; + } + if (strtoupper($payment_gateway) === PaymentGatewayType::IYZICO) { + $created_intent["ip"] = $request->ip(); + } + + return Payment::getIntent($created_intent); + } + + + /** + * findByTrackingNumber + * + * @param string $tracking_number + * @return object + */ + public function fetchOrderByTrackingNumber(string $tracking_number): object + { + try { + return Order::where('id', "=", $tracking_number)->orWhere('tracking_number', $tracking_number)->first(); + } catch (\Exception $e) { + throw new HttpException(404, NOT_FOUND); + } + } + + /** + * saveCard + * + * @param mixed $payment_method + * @param mixed $request + * @return PaymentMethod + */ + public function saveCard($payment_method, $request): PaymentMethod + { + // brand & network are equivalent with razorpay & stripe, "network" in marvel DB + // type & funding are equivalent with razorpay & stripe, "type" in marvel DB + + try { + $customers_gateway = PaymentGateway::where('user_id', '=', $request->user()->id)->where('gateway_name', '=', $request->payment_gateway)->first(); + + // if first card, then set as default. + $default = false; + if (is_null(PaymentMethod::first())) { + $default = true; + } else { + $default = $request->default_card; + } + /* Updating the default card to false if the payment gateway is stripe. */ + if ($default) { + PaymentMethod::where([ + "default_card" => true, + "payment_gateway_id" => $customers_gateway->id, + ])->update(['default_card' => false]); + } + + $payment_method = PaymentMethod::create([ + 'method_key' => $payment_method->id, + "payment_gateway_id" => $customers_gateway->id, + "default_card" => $default, + "fingerprint" => $payment_method->card->fingerprint, + "owner_name" => $payment_method->billing_details->name, + "last4" => $payment_method->card->last4, + "expires" => $payment_method->card->exp_month . "/" . $payment_method->card->exp_year, + "network" => $payment_method->card->brand, + "type" => $payment_method->card->funding, + "origin" => $payment_method->card->country, + "verification_check" => $payment_method->card->checks->cvc_check, + ]); + + // run a job to check and set default card + if ($request->default_card) { + event(new PaymentMethods($payment_method)); + } + + return $payment_method; + } catch (\Exception $e) { + throw new MarvelException(SOMETHING_WENT_WRONG); + } + } + + /** + * createPaymentCustomer + * + * @param mixed $request + * @return object + */ + public function createPaymentCustomer($request) + { + try { + $selected_payment_gateway = strtoupper($request->payment_gateway); + + if (!$this->customerAlreadyExists($request->user()->id, $selected_payment_gateway)) { + $customer = Payment::createCustomer($request); + if (in_array($selected_payment_gateway, PaymentGatewayType::getValues())) { + PaymentGateway::create([ + 'user_id' => $request->user()->id, + 'customer_id' => $customer['customer_id'], + 'gateway_name' => $selected_payment_gateway + ]); + } + } else { + $customer = PaymentGateway::where('user_id', '=', $request->user()->id)->where('gateway_name', '=', $selected_payment_gateway)->first(); + } + return $customer; + } catch (\Exception $e) { + throw new HttpException(400, SOMETHING_WENT_WRONG); + } + } + + /** + * customerAlreadyExists + * + * @param string $user_id + * @return boolean + */ + public function customerAlreadyExists($user_id, $selected_payment_gateway) + { + try { + $customer_exists = false; + $customer_exists = PaymentGateway::where('user_id', '=', $user_id)->where('gateway_name', '=', $selected_payment_gateway)->exists(); + if ($customer_exists) { + return true; + } + return $customer_exists; + } catch (\Exception $e) { + throw $e; + } + } + + /** + * paymentMethodAlreadyExists + * + * @param string $fingerprint + * @return bool + */ + public function paymentMethodAlreadyExists($fingerprint) + { + try { + $payment_method_exists = false; + $payment_method_exists = PaymentMethod::where('fingerprint', '=', $fingerprint)->exists(); + if ($payment_method_exists) { + return true; + } + return $payment_method_exists; + } catch (\Exception $e) { + throw $e; + } + } + + /** + * webhookSuccessResponse + * + * @param mixed $order + * @param string $order_status + * @param string $payment_status + * @return void + */ + public function webhookSuccessResponse($order, $order_status, $payment_status) + { + $isFinal = $this->checkOrderStatusIsFinal($order); + if ($isFinal) return; + + $order->order_status = $order_status; + $order->payment_status = $payment_status; + $order->save(); + try { + $children = json_decode($order->children); + } catch (\Throwable $th) { + $children = $order->children; + } + if (is_array($children) && count($children)) { + foreach ($order->children as $child_order) { + $child_order->order_status = $order_status; + $child_order->payment_status = $payment_status; + $child_order->save(); + } + } + $this->orderStatusManagementOnPayment($order, OrderStatus::PROCESSING, $payment_status); + } +} diff --git a/packages/marvel/src/Traits/SmsTrait.php b/packages/marvel/src/Traits/SmsTrait.php new file mode 100644 index 0000000..65feeff --- /dev/null +++ b/packages/marvel/src/Traits/SmsTrait.php @@ -0,0 +1,168 @@ +getOtpGateway(); + $userType = $this->getWhichUserWillGetSms($smsArray['smsEventName'], $smsArray['language']); + if ($userType['customer'] == true) { + $smsGateway->sendSms($order->customer_contact, $smsArray['customerMessage']); + } + + if ($userType['admin'] == true) { + + $adminList = $this->adminList(); + + + foreach ($adminList as $admin) { + $adminProfile = $admin->profile; + if ($adminProfile) $smsGateway->sendSms($adminProfile->contact, $smsArray['adminMessage']); + } + } + } catch (Exception $e) { + //Log::error($e->getMessage()); + } + } + + + /** + * @param $data + * @return array + */ + + public function sendSmsOnOrderEvent($smsArray, $shouldSendToChildOrder = true): void + { + + + try { + $order = $smsArray['order']; + $smsGateway = $this->getOtpGateway(); + $userType = $this->getWhichUserWillGetSms($smsArray['smsEventName'], $smsArray['language']); + + if ($userType['customer'] && $order->parent_id == null) { + $smsGateway->sendSms($order->customer_contact, $smsArray['customerMessage']); + /* $customer = $order->customer; + if ($customer && $customer->profile && $customer->profile->contact) { + $smsGateway->sendSms($customer->profile->contact, $smsArray['customerMessage']); + }*/ + } + if ($userType['admin']) { + + $adminList = $this->adminList(); + + + foreach ($adminList as $admin) { + $adminProfile = $admin->profile; + if ($adminProfile) $smsGateway->sendSms($adminProfile->contact, $smsArray['adminMessage']); + } + } + if ($userType['vendor']) { + $message = $smsArray['storeOwnerMessage']; + if ($order->parent_id == null) { + if (!$shouldSendToChildOrder) { + return; + } + $childOrders = $order->children; + + + foreach ($childOrders as $childOrder) { + $storeOwner = $childOrder->shop->owner; + $shopOwnerProfile = Profile::where('customer_id', $storeOwner->id)->firstOrFail(); + + if ($shopOwnerProfile) + $smsGateway->sendSms($shopOwnerProfile->contact, str_replace(':ORDER_TRACKING_NUMBER', $childOrder->tracking_number, $message)); + } + } else { + $storeOwner = $order->shop->owner; + $storeOwnerProfile = $storeOwner->profile; + if ($storeOwnerProfile && $storeOwnerProfile->contact) + $smsGateway->sendSms($storeOwnerProfile->contact, str_replace(':ORDER_TRACKING_NUMBER', $order->tracking_number, $message)); + } + } + } catch (Exception $e) { + // do nothing + info('This exception info is from SmsTrait sendSmsOnOrderEvent method'); + } + } + + /** + * Get OTP gateway + * + * @return OtpGateway + */ + protected function getOtpGateway() + { + $gateway = config('auth.active_otp_gateway'); + $gateWayClass = "Marvel\\Otp\\Gateways\\" . ucfirst($gateway) . 'Gateway'; + return new OtpGateway(new $gateWayClass()); + } + + /** + * Get which user will get sms + * + * @param string $smsEventName + * @param string $language + * @return mixed + */ + + public function getWhichUserWillGetSms(string $smsEventName, string $language): array + { + return $this->getWhichUserWillGetEventSmsOrEmail($smsEventName, 'smsEvent', $language); + } + + /** + * Get admin List + * @return Collection + */ + public function adminList(): Collection + { + return User::permission(Permission::SUPER_ADMIN)->get(); + } + + public function getWhichUserWillGetEmail($emailEventName, $language): array + { + return $this->getWhichUserWillGetEventSmsOrEmail($emailEventName, 'emailEvent', $language); + } + + public function getWhichUserWillGetEventSmsOrEmail(string $eventName, string $eventType, string $language): array + { + $orderStatusChangeArray = [ + EventType::ORDER_CANCELLED, EventType::ORDER_DELIVERED, EventType::ORDER_CREATED, EventType::ORDER_STATUS_CHANGED + ]; + if (in_array($eventName, $orderStatusChangeArray)) { + $eventName = EventType::ORDER_STATUS_CHANGED; + } + if (in_array($eventName, [EventType::ORDER_PAYMENT_FAILED, EventType::ORDER_PAYMENT_SUCCESS])) { + $eventName = EventType::ORDER_PAYMENT; + } + $userArray = ['customer' => false, 'admin' => false, 'vendor' => false]; + $settings = Settings::getData($language); + if (!isset($settings->options[$eventType])) return $userArray; + $options = $settings->options; + foreach ($userArray as $key => $value) { + if (isset($options[$eventType][$key][$eventName])) { + $userArray[$key] = $options[$eventType][$key][$eventName]; + } + } + //send a test email + + return $userArray; + } +} diff --git a/packages/marvel/src/Traits/StoreNoticeable.php b/packages/marvel/src/Traits/StoreNoticeable.php new file mode 100644 index 0000000..809bc86 --- /dev/null +++ b/packages/marvel/src/Traits/StoreNoticeable.php @@ -0,0 +1,67 @@ +type) { + StoreNoticeType::ALL_VENDOR => User::permission(Permission::STORE_OWNER)->get()->pluck('id'), + StoreNoticeType::ALL_SHOP => $storeNotice->creator->shops->pluck('id'), + StoreNoticeType::SPECIFIC_SHOP => $storeNotice->shops->pluck('id'), + StoreNoticeType::SPECIFIC_VENDOR => $storeNotice->users()->pluck('id'), + }; + $storeNoticeReadArray = Arr::map( + $userIdArr->toArray(), + fn ($uId) => [ + "store_notice_id" => $storeNotice->id, + "user_id" => $uId, + "is_read" => $uId === $storeNotice->created_by + ] + ); + return $storeNotice->read_status()->sync($storeNoticeReadArray); + } + + /** + * This method will attach Users or Shops to StoreNotice + * + * @param mixed $request + * @param StoreNotice $storeNotice + * @return StoreNotice $storeNotice + */ + protected function syncUsersOrShops(Request $request, StoreNotice $storeNotice) + { + switch ($request->type) { + case StoreNoticeType::ALL_VENDOR: + $request->received_by = User::permission(Permission::STORE_OWNER)->pluck('id'); + $storeNotice->users()->sync($request->received_by); + break; + case StoreNoticeType::SPECIFIC_VENDOR: + $storeNotice->users()->sync($request->received_by); + break; + case StoreNoticeType::ALL_SHOP: + $request->received_by = $storeNotice->creator->shops->pluck('id'); + $storeNotice->shops()->sync($request->received_by); + break; + case StoreNoticeType::SPECIFIC_SHOP: + $storeNotice->shops()->sync($request->received_by); + break; + } + return $storeNotice; + } +} diff --git a/packages/marvel/src/Traits/TranslationTrait.php b/packages/marvel/src/Traits/TranslationTrait.php new file mode 100644 index 0000000..4fe4774 --- /dev/null +++ b/packages/marvel/src/Traits/TranslationTrait.php @@ -0,0 +1,93 @@ +table === 'coupons') { + $translatedProducts = $this->where('code', $this->code)->get(); + return $translatedProducts->pluck('language')->toArray(); + } + + $translatedProducts = $this->where('slug', $this->slug)->get(); + return $translatedProducts->pluck('language')->toArray(); + } + + + /** + * getTranslations + * + * @return void + */ + public function getTranslations() + { + try { + $translation = DB::table('translations')->where('item_id', $this->model->id)->where('item_type', get_class($this))->first(); + } catch (\Throwable $th) { + throw new MarvelException(NOT_FOUND); + } + + if ($translation->language_code === DEFAULT_LANGUAGE) { + return DB::table('translations')->where('translation_item_id', $translation->item_id)->where('item_type', get_class($this))->get(); + } + return DB::table('translations')->where('translation_item_id', $translation->translation_item_id)->orWhere('item_id', $translation->translation_item_id)->where('item_type', get_class($this))->get(); + } + + /** + * storeTranslation + * + * @param mixed $translation_item_id + * @param mixed $language_code + * @param mixed $source_language_code + * @return void + */ + public function storeTranslation($translation_item_id, $language_code, $source_language_code = DEFAULT_LANGUAGE) + { + $translation = DB::table('translations')->where('item_id', $this->id)->where('item_type', get_class($this))->first(); + if (!$translation) { + DB::table('translations')->insert([ + 'item_id' => $this->id, + 'item_type' => get_class($this), + 'language_code' => $language_code, + 'source_language_code' => $source_language_code, + 'translation_item_id' => $translation_item_id + ]); + } + } + + /** + * Helper method for generate default translated text for invoice + * + * @param array $translatedText + * @return array + */ + public function formatInvoiceTranslateText($translatedText = []) + { + return [ + 'subtotal' => Arr::has($translatedText, 'subtotal') ? $translatedText['subtotal'] : 'SubTotal', + 'discount' => Arr::has($translatedText, 'discount') ? $translatedText['discount'] : 'Discount', + 'tax' => Arr::has($translatedText, 'tax') ? $translatedText['tax'] : 'Tax', + 'delivery_fee' => Arr::has($translatedText, 'delivery_fee') ? $translatedText['delivery_fee'] : 'Delivery Fee', + 'total' => Arr::has($translatedText, 'total') ? $translatedText['total'] : 'Total', + 'products' => Arr::has($translatedText, 'products') ? $translatedText['products'] : 'Products', + 'quantity' => Arr::has($translatedText, 'quantity') ? $translatedText['quantity'] : 'Qty', + 'invoice_no' => Arr::has($translatedText, 'invoice_no') ? $translatedText['invoice_no'] : 'Invoice No', + 'date' => Arr::has($translatedText, 'date') ? $translatedText['date'] : 'Date', + 'paid_from_wallet' => Arr::has($translatedText, 'paid_from_wallet') ? $translatedText['paid_from_wallet'] : 'Wallet Payment', + 'amount_due' => Arr::has($translatedText, 'amount_due') ? $translatedText['amount_due'] : 'Amount Due', + ]; + } +} diff --git a/packages/marvel/src/Traits/UsersTrait.php b/packages/marvel/src/Traits/UsersTrait.php new file mode 100644 index 0000000..7907f6a --- /dev/null +++ b/packages/marvel/src/Traits/UsersTrait.php @@ -0,0 +1,19 @@ + User::with('profile')->where('is_active', true)->permission(Permission::SUPER_ADMIN)->get() + ); + } +} diff --git a/packages/marvel/src/Traits/WalletsTrait.php b/packages/marvel/src/Traits/WalletsTrait.php new file mode 100644 index 0000000..eb0589b --- /dev/null +++ b/packages/marvel/src/Traits/WalletsTrait.php @@ -0,0 +1,62 @@ +currencyToWalletRatio(); + + $points = $currency * $currencyToWalletRatio; + + return intval($points); + } + + /** + * Converts wallet points to currency + */ + public function walletPointsToCurrency($points) + { + $currencyToWalletRatio = $this->currencyToWalletRatio(); + + $currency = $points / $currencyToWalletRatio; + + return round($currency, 2); + } + + private function currencyToWalletRatio() + { + try { + $settings = Settings::getData(); + $currencyToWalletRatio = $settings['options']['currencyToWalletRatio']; + } catch (\Throwable $th) { + $currencyToWalletRatio = 1; + } + return $currencyToWalletRatio == 0 ? 1 : $currencyToWalletRatio; + } + /** + * Converts wallet points to currency + */ + public function giveSignupPointsToCustomer($customer_id) + { + try { + $settings = Settings::getData(); + $signupPoints = $settings['options']['signupPoints']; + } catch (\Throwable $th) { + $signupPoints = 0; + } + + $wallet = Wallet::firstOrCreate(['customer_id' => $customer_id]); + $wallet->total_points = $wallet->total_points + $signupPoints; + $wallet->available_points = $wallet->available_points + $signupPoints; + $wallet->save(); + } +} diff --git a/packages/marvel/stubs/resources/css/app.css b/packages/marvel/stubs/resources/css/app.css new file mode 100644 index 0000000..e69de29 diff --git a/packages/marvel/stubs/resources/fonts/SolaimanLipi.ttf b/packages/marvel/stubs/resources/fonts/SolaimanLipi.ttf new file mode 100644 index 0000000000000000000000000000000000000000..422e2ccdd7eb47f6d7598b48b225a62d1d33b33e GIT binary patch literal 249656 zcmdqKdq7mzwFkWSK4%^v@*W06gmD}vWI`r5jw2$Xs7NTGgm5V}gdieOe4s%kgv+Ib z5;Vr*BQeGpYpAt^%Qe<(h*jew#u#g?rIc%}wRxC#jIqWVtIRpyZ=W-RfT)=C`~LXQ zv(C(!bM|As_S$Q&y$+#-kU#*DkZDth?vw}e=KXnb z1|fq(3DJBobN-Bl!_Q9oD^itkhKeZ=hfi=Xh5Pw&F_&j}fH&%CmkGg$URKO?Mq zJ-**Jf5sCF*=hP`{5~7^$1IpJe^%a!Mk`^<-X$a?eqmYp;@D%Gz9H>+ z+dbF$L&_gJ#;>qrG=%t&{lK+SllNDp96{VkR}l>*^hNq2S^=n@NeK%Ewush8z5i$Q zXF5V+x*wjDk&{g(5@LBzZG&zzOT~|CkE7pWyrvVMV~8LuCLCvkwctol4vC#4rQ+ix z3P+M|C`r`hl2Y10irA}U9ga+4D9ILEQGWv2f$s&%IYGXF`}1(L<4DDkf+GP(8V-KF z07nLnOx*t=KTt+KFGo2ZC!6%cNGj?w<7m>nLyB;;;qxx>EZL<^Ak*=^1KNLLvt2kqri+iu z9q3CO%FM-4hB}gQcH+p!JrV;Y2wr@p~$s z<2bCx=TNl64`(xuSRBc$mE^HdavbMG^nU~HC3x-%?&rAY^)AO@dbM@knKsS|6S-4)!z5?wYCr7p4l4{Rk z0zM7_FC3>g9N=^#+Fpd;cJ(|^Cd08BIFxV>#yzn(6gqGk^gPh6L-?MA-?#NT9wL#N zhsbX6EM;gD$NLQj_%D^?3%~JpcOR(tGU~0z`6A9*{KoO`r33$b{op)yR-s`%u3tYm zEfy-Yj^%yFZ@GQWd1!ADum2Y3HccpT;`dlQ@8mebIs0~J-~&8I5^r`!c`e|{{py+c zqn}^tiQI|4#)ALe$M>uF{xQCTABh9!!#ED&IL>(#Z8qaRE(cBcT%jB)|JI`3Ex1QH zvs|*m^PQgwt`pR`5uY3To_k*7^u_n|zGv`D9%L;W&+Y>cuJoMiJ!j5G9G_gyz2}0S z-?_}94^hf_sppLEczzq|RL4Dj|PvPe@U zFBMzJU1BqM>1nx6oJm52ukh?orYq)^P1OEqS4zh;xXQk*Q;X-v3p8QL-x<(hEMC0rx8mWAUZeAml$?C<0N z{f9h(cF0xqA6<{4FE$*n5!RK4b200bm$G-{C&YWYp5zB%aw&^+&)4Yjyf4bhMwut% zFEo%=MSL6-hm!JL4GX$3ZuyXk&ndhaBVY55+~q!-o|K> zBD^MlB#y+j7sxD49Qyk-`d39p3s2LBg@pv;zPz0fX}S0&=;Of|D}f#a&e(dnnhi&L zfHSs6e(q*CW8;XuFV5&W`Du26#P`G*YXkl~IAbT}Le@q!ELF}C*T}6LXFdDQ`@nX| z0@}0$bc_WZhoenTfsVnTV*}ds4CuH3^*#kUZUh~l1s$IO9hZZS&w`GDnx80ii~=1S zK*u7`aUSTHhBiG5Iz9zDE(aZ#p-oQ#Uk!M+9_1|u9hZZS&!A29Xj22|@hs@^l-Pvp zTjgijgK`}q*D%(11%s9)Y(1IC8sq}aQt-rhxmIhDmufZgN{&x{Xm`m^YZuAOv@!BC z+I8|8?NIOy?$gWz{afS%oJTe5Kx2MBt)7+7iJ&Xz-52GVno#)}okM;JyuVC)L9W&% z%bRr>@;^1-$aUIhI z+@g6_uF_mYJ5$hx9N?o~ZiFsLSLB&r<8lX?)-}j4=@-bGIR9y0k+<+`kVEJXc_;r( zoB`Yn$9FFCo8-m1WoXMcaxL&ROXrp!*M^`!mwEc&p!pvyeI!w^9JhY?MjyCi6wH2_s~Bom+4c{ z@6&kpBFf}?2fypC;NGWEm*;-X*J$fVd9&7xGh|GWGhEaD4?cfIbP7J9-xRvNfwD%U z9Ip4?kuPfEaL)v^TB?wS1TMIka7aV;>HSS|_KKwg%tF%CoiWfy;k^zNh73 znnZaRef8=VMelBheub{p;H>D+zspTJCO7Ktm0twDYWbn!wlzt#E)Fj%dqtIvKyAW51=pc1sp^M$zAx>4{$IU4Cqh% z0Ru>Ye2oN>K)@gp1Q<+$<*OuwgaC$;P(TAQ0EPknix^25U^p=XMv!p%3K>Eo03*o| zz@a1(Fp3P7zazs)6ks$N1{g!4<;%oGVgQE|6QG$42OL4n@;`}%i~t--EPz%rQocm) zB38gyau?v;Bo@#H_$|4I+zl8+tcz(kS&IG&7?&yysQ2snX^2TUeOfD-|~CX>hn zz!Z`UIGIe8&ygu)65v#l0+>oB15P7T8vo z(@8Gi!{jG``6N&Nggioi3Rpm<13pR~1}r4`^2cNbc?7VC6ada7kIH9BF)0L`MP>k& zkRrgx$V~YoGMf|w!Xf}HB_;BQWUd0|k;m|PKA8=;fXtCUAZ4T!a3PrsxQNV?-zSfg z`GDnQ0pMa%2DpSQl>bhal0|?Oq!mZ)8uFJDbhe{0hf`d0GE?Gz-P$M z<-d>>q#p2D@-*N|(jcECzaYy18_9CORpc4K)ntYIe`F1L7H}PEn&cCth5QQezZKX@w&3&skYCGx zAlt}Rz}Luc0JoE7`8fG4c@=O6X#xCS^51|vNvr%Gd7bn&6_y&1RK1Ozt?SQ`{ zzXjY)b^z`n|11BV>?Jz^-z2XC?jvo0`^g*fQF1_m2gxpcevAB0ewQ2~y8+)OdjJoU zy@2nKH{~Pb2-yetF4+%==j3HW8^Ks_sAi@klzFTnH-Z3kxud+;QuM`Bsng>MgBtm0C$tl2($zK6KA*bbiA9Sgl}gT9V~p0-0j$3rhW zppTubQ0XlXfbZZK9>J;eGROrw&=+1QL%naztOz6lg=*Dd5#2o0t zT=Em>zn?g!S4jRs~FmF4n92rX@yq9r=`$<1R7-nU^xx~9a*8ARWJ`) zi$G#`lUiui1>L{QhaMx)wogGny+A`LypBEoeuvKo={UfW9#<U z!{>KCdwt&adDrK-&mVkF`ke7O>vJ_`u;o4YGx?t%p55$I>{IJg@6+hB)~5wewBd<; zK1Y0xDNp>(=Y5|~WBimSC}v7$<+r~3`*(-Fd+WOc-|hSE&F}Vp_q*@j_^$1{o!{-a z()Hb|-~IZ#E#EbLxcYR5!k70dwG0$+j{W~*pBOltu=AQ6NH2V%jv!Nz#S~Gl1ONfU>1Tx3}z>7iOY&>Y1MSPGb9&1%648Oop6{k z*n(|rk){>*4}z!IVZZ|x1(xo2WsRk2`^RRvG_7Z)uW86x1>%_~Sme2ywUFaz)FC(w zX5}!4m<1e8hjKUsQwRz(2_N3S@6^PT-(+pfl(JsRJn_ZEzh6n;m`+LBOlcA&nzd5d z3hAX4QWo9Lj}>&*3c6Y5m8p90ck=BuR8Wa{S zgc(Bvs8)w=j9qA0TjB!O!Z2%-GXpC!&bF_6Nz4!zrGvb=qlGymj z-^PVALn~V`s(8Z_(%X3^-77lZa8WmHP3@T2;cIBLbK+sMmX=gc%q<+RjV%k_o3m)s zRHL3r%xUmrzB5mCR*x9(*U=Grp`gMw%cj>Cg|IklL~z9HL)4ZVsCU=VbCEAi*d=wj zKM6?6uBuM5U=jdJ@uc>B;5`r;&;sq2iGGbTI>HR0I<0v)+CADe#yDJO)*3>MVUAI1 z!z~VK#$A1H;`cZVj!=j9#(4C6I9=a5o2AvxcyjC9%-R`MWl2IzzH{P&3B!xx1>c6Q zlMTYLZF8p87FKO7&8#b|EK4#MGJ(Y>;6o8J$Lcjz4F%OrbFyk@RO61uM;%G?lg;^# z35zF0AGm5`dm9R>nr3I!7FKVa^FSl6FPy+w)FbgpOOlvDtI(}fZr4PhkM}}T!$(3L z=$kIYYy~kqeN1L!TqCW<(RPaNIz|}{O4oE0gaX+VVws2Qv<6O4ACR~k8^XmchN!7m zKd8x%4=msKb@`OJzP_mqjYg5Nx*1iw3S6ZV9;boP!9h|^z0Lf{$orm*9V~*dv|QS? z))~JbEqBuR9M+nixp=O0Y;&I3H@&%d#n$=0`jpI_FUE_SyEYc4Hn7aOD+*mH(vGpy zCU)f{#7`)-8y<^^9TjS@yT{NM3(_ZL*JnDyK~GAGgf?nc9`S}9da+h`b_zxAa} zEfm8GC7CG4Pc0|J92~+?!~{oh2uB>-xA2|uVSx!J7ItP^V{@cTI*C@)*H={1I+`tg zAw9Qs!~=M?L_Q~`3dgv{paxTrImqNR1v!GmR4H$jlt-IaG4m?vr}Q_g zXtR`u`*%nkbUCas-0yN20?kg4Hi?>doIIIl@UQB;EM3YJlP%c_9t-F>mda`%^}K8+ zOO?V|&Dym}n|I(^1Ioc~7OvA8I`K!Sd_g|RQqdRw44073MbeOkn$D|yG{}?NMSsvG z7&Zr&FfdY3phjzs0p{% z4?L1IW<*fM>!NQhi;TCGJFn)TJ9s7)o+%@q8Oi%&3RWK)W{}4P7}4}0ET*lEv^_v&j4SF zN{WF>aRhr*QJ_gj54TP(XN{whH%}9MhY36Nv^s@Gl{$XEFV_D+)pn_Uk<)i);7PN! zbCOZ&$Y2{@WKs5Y+g!o(SV&?O-DY9?@+$xSir<6eR_Y14LvYVtWRAN=`dIhg(=vO43 zYdV+=jJW9BrS1#yLH;k_j9dj5hH~#rOlkzc)cbCqkMca z4~L|4#n!E|1%>OBOO$K29@<^#+G$xc)O0pAvf|{&HPf4GUjMeTLaZx4KHPk6;eAs6 zw(Pj-`)9nA?O2^C#_up|rBe&mG__Q=eEV$a&Yd*XNS{338ZGY2lJ0MqHgkJ{t2V2& zJ!2T?T;Rba$D~24V}d!@hXw-VL{rBs?LY;hOU zNLmY_<704!r*Bc{+a#2OF}Hi5;sb4xM}woI0hA68pz+?mjdCh_Tm5_tvSJ%j3wCG4E>B}!6_-A#E@)oz z>x&hpp}93I;@G^5jfD*>a*g!#Qo)|oIBv*d7B}I=v0?7bbt!qx55(3_%4^QFa(>E0 z`-4H77*3lI2iV%drCzJ^jJ2FbA)H47D6a4hc-ybEe*R9&>Zq8Hr$*Kt{e+Wd=cTHp zV*R`$*&udiwZQvvyy$7+1$KIa%uO zpSh#J#c|6pza+Fxj0cus+i}gNSZr-vyLEO7`OtB=2Rd|@a!&xKqS*CU8e*qUAK}pH%V>M_E&g2O2}C;m364? z;M$iTVro~6@IhA$>u7A0Hm_QR@=8!%7W6;LqXz2q!9s0TSD0Y!I>pQ@rMy>YI?ZZA zd7Hp@!J6}!&)IRO**Q8{fL4T}!JuVUWY1s@grbS2@t%QS8^8=f=p5U!YiLxcR->)R z9T8p45;K~U%-iU~EXvARQmpNXYNKAei>_ao>9j}cwc7a^Q^!qSl@wKxT1U6rG%ZZX zuPMyTnYYAgNMh0%Zt3#=rAlXX8_}K&%=<7>D1-2IU0^ZCfapPi#xT<;ml4|59Ag!_!(V-!a)10pJ7OfbucH@VKqhd^tRsCkh z)K@m0XvvbUHawPJ$n4`Pru$i=hcIn{U1aV7?}jJI5z2 zw}%CtK2GBbM$^Qug!rQlChATcl+M{~X`QWYFAtB*T{*Mi{ni$?!@jz9%QI8W^&wN| zPfuRtiUN+zFisONmg=B+2{j33KB5j{!ZG)OmyfZ~%gnFy51(G92c={Tur^l6n%#L^ zKQw{XU5Z^Yl#geap{Pm^f@V|(5DKg+qGZOz1t0k+XKG>v9gCL!;iS!vl|SAg4W*0L zrez z%kv+nS5i2l;ZGpqXDFB34?!kaRq8=2goW4I#X(&=g*etMk!DS2vt(}O{H#9HglCkQ z9;`6sDO#}~!rjT<<&^Q>P2tmR*R%phck%MgR;?E$94R1?GFT~Si-u|k-jXmpXj&`n zonWdX2Y0kb#k@uXY1yx*L>#gm%AF@&Tr;mars3k34aHJ|5Zd+eJ70g%Ni*o252J^y zx>&sIXu7#`^EpXswXPMnRJF$bhPSr`xU+it$jwGRjfIUQ&UUi{`vkIozuIJX6|28$ z!~Mtc&`R9T?K<2}S03OzhYR@4EVm1@@i7!%96_G3C<#-;&}hmTjkWCCRlHo9>w0VJ zxTO=pMAtS;^Aon`*VGlBwP^FFHlqyitY(U*JxX(^!w2RgE!?+{eg04PX7<=e?u*RV zeHqhcKX%EzxoZWJ@Z1*Aia)2}?c!LcMeL)lLNu-e^igR8uaDMLNry&~NMU|%fK?e=e*iLqJ?fio&>>(N}{c~;kq2))Yer?6k2F>{{CN_OJIbCW$>5ScUp_ATED^KrfZg09Iz1dQE z{FfJLc1tN+r%tiojbu0uN1ZqLusE9GYHeuB~X1Y;2A<;Ud&l|WJziB3-*b-#(|(}zZ#T&1#^zo=&aDjUK!>Vyp9^j1fer#Z|6q2bYomr z&6&cJ+fOPzI!t3}&bzO7NPF9w4m|sg^eyk*;i=mncP72SDt65FcIkWv#=p&ehd7rEIv)|JE zoUpal_!{eQrWqb$`rO90jJQ`a(BoG|_++L$FF9D9yIRwEd2;U2IYS~`*%{m49y`Qn zFIrRozFFVA-5l4D0!tWt0Uak^0i9toC^`-^1l7VaYS4fv?%+@;ZgptAiVr3kbfIO0 zz~|Ozv3U4(_Wq>o&K%2v(K&SK<%9sg>d1A{MQQ8CT=u$?_6@AzOXturCh7`+c?cfTa-ZqrSjB| zi+NjZ;0Zpr)Ok3_ReNw2nRugx%Llf8R(O=u3lVWk70rxo+9m;1JPzfHR*d>9uv)Z2!FZzv_BqBm?JvCS9)2Ke4!3jJWpMD><1>lM7I15@^KBf=vQ>gB&{q z^KtiQ$LSmNlqx zoOpJMxR)Q^=QTXm5PBL3CkR;zn(0#D4d|uV@=>`Ix2iJB1bQSi~%HT=IDk_vdkaV4zSoPHwkv?Wz-M zuQdv_UBAH0(+X3#T}VSTb)OhY`w7^ALd#28dHM}NiVE3YPXuL9cGcWYNsr` zMCVw=e9_OBNq;w(;6e>gpDT?Fj3}-RWVKOaV$xnrEojfw8${7JBsh@?BjSD@ zF1{ENyf&lye0a2bc@Dd9K=1Dx8NFZ(s~_ewBiv{~pUTiDj7ISL#Q?jGAVo6OxvAA) zR;Gj=%Z2OevX;dsskSm>_mVBAD_^9YEm`p^CqLYp>w0c7#-wB0&pi8ksclp7uI0k^ z*5Xw%DRsUwr;&>D9SVMvF-Eonf2c{di@24llpf+>+`i@RQ9e7ym@gb|jcg6H9!!gQ zWqj6YTdT1%?{Vq7nw&Q)n@?2)CbFaNL^F20pjP_)k>Qj{pB2QOT-i?3HWjZh!2V-c z9d8#fPQuSJ0=0o>IGMUDFb46S^_cGRap>~;itS+$(&ehmHx@UYnJ;y0%ZVMtR;3p< zXE}KPuG&_%1hP+7b<)HQgv_q=1jDMzP~nm z#mOsqmJe4Pr&Bf+H#;UScx3RF{KOZz7=!=eTVR2RGvd07`z6q02lv@JqN%|ORy44{ z9W9NG>*HLpE{A>z6XREOO&7MVXnQ^0pXpb!`HBu?BvDEczCio$!rGRi1);}P%vl{_ zpbNKQlPJfXjl#6$RxGBf%6y{-p9mQ*KNMB;L6}kc^f9x3+hDsk{fVtU+$x}DqprfDGP?_XN%(FU(T&?Z%26yD{tsE%2VdP+}u&-zK)ibRx$qC z2{E2-ISEC`*3|2Nb%(taQjK6xJ!;gup zS;|nmb`dWEZLfeX6;Xy_V{^@GraII}P4u0=Nh@euhqP`h8r$_eJtD1ir?Av5QUPvP zo?U?gTuM7tThs*w>9s|H6Kw=&7|UB`P^KI}iV>>m2HXU})y<_4SlU$fLP%I-Tb{2^ z;_R(g9fMkHO_u5mN9*b_H9s1K-oNmYk+J%Kz==idXq>a_G&{T1>boGl&|SdJ{_imD z<7owMICi`=`2_VVG~xAgXNIviO*WOi6dT`}Yh^7<ROWc$MPoWRMq5@3pee{v~Et$*_CB$ zP7<@EEA@M%mepC88s4U}8Z$QSEqq$~yvVw)S{E)3%Uw2cNujmI+&V+y88yaIUO3_L9bg*(Nir;PD)oRGxjXra=L20WNXbG z%av4i{F=#93QK4?v*H*{-&DMpgfbLWQH)=m^fu@W?SE5|WiyN%hHAm)AO?oi7}g>G#{8KY33$8Qp<8v1!hKsl_;K_kMJWBToJ@s8-M#5N;ay&96a!fnd*)A_9OUv3g?E2vdE z#qm^+KAwhu3p{L62M_L;yKW2Oqj37g^7XNf(>d0bN?XFV%-EK7O_BP>iMc|eTi+NT zvN?ANE97Ni3L%_DS=VhrmbOP~I7p+Z{Qwl-20^tyU;}EM1qX8uwYtyg#=7W~(N=ixPm?WE)EpfI}=+CG`#k`TE|GV5cfI8%c|k{vE{zC}Mt zTGvKHpx4fau;O^DFB`I9aJI2UbauU|l$ne+HKWX4b|UP^I<}$f1@@HtRVb9Mu5}v( z_Pla`9_&Qew%k_7_@zuHg7_+G0OhumF)Wc^3dZ1YPqxyptbR$E|x*Sn&e(#oULScqTH1DB^x7rjN#RbK@gNEaXLt}xv zL{kx#WSg6vkq*<07MoxCu+ej)gVzm@l``vH#zb0v`A3mMRGq6DTiZ-`( zJWJoo(gGgF>bT<25rRYkMgprjJfhWqU*4iz=}P&OqjOf~Qe$qo*c$xo&`Rkt+h!AX zbnOYfAkB@}9yuEJY28kmx$(yVyV^qDpPbzq@7r}yNRF2pq)#6S18rdEiJWdzINzAK zJ2ZffQI_06C?n7Y)x(DCtej&MZRB)#bP=~Qjb>)z>J_-uvh&gx(JbhtDV4Q0d*-6} z?7ZBNdA}H*xo7f}dF4g##s&=b5Bq5AbU*E{mhJtl#ypn2u9q&hrJF>pAt8d{PhgAk z5-bZ^QnQ#CVVckoRK&!TKy60D|2!Et+8TS8bi6R?N$;vP_>e=kX%P zV8#YH%gPr`pI4Dxxp<+)PfV2dElFnP!m*PVO|llbX#IkDNlYI*XG!stLSvX^=KYK2 zEp#T#t5`Vh$B~gGh4iID=A5{2q9uRKq>72dfoJGJF(30Qt|JVX_F*2Utg||?)~ZYz zsc;#KUis3N*QL$05QkHGWE*{wmTi+}vCi3>=13c8$(&8IG54I$*1BWS=j$@ZXLgV} z?tO#gaoOuSCY|j%#^n!drcwsh1v?Q#^)PBTD}Ds?aK5CY3pH9H2HfSqy}BxH_&5z3 zk90b`qvmL9yw$=n36-H>l&cPiZ4{*%zRGCff{UAlw$_D~__BBw!j|Ovg}A6KF}7U) zeoB~OO-aM?xx<3|e79K=7uDH=r-w=&plSbMeZ^a}TADvnOwxHFafde4I6ZLHxrr%y9)%gTATQ z8fa*p9S|6A8$GG1IAeWY)m`qjU72;&vp=wy60#=7T2)*miJ!0n%`T693PaO`g9djp zQ>SKE2mXj4e0zb1&Q7MhDT*y?fr=E!1opqJ1g5yeWUGLHxpyRF=}X zt!g{%?!P27V_x1M_DtcBLE1{~IpcTizAenM1XJ(Db6v~` z2A_TCVPBTvmsf6yt8wTJdaV`D2S(83HFkP4FLbeWx+LzHyYC z61G6kYx%lz2yeI1;8IUVsq56K`5e&pwyQ1pyP}>zQbZAM7pFsIYw(mJirJ#Rv8zEK z?(Os-e!qF#g4oR;+bx0!?m$lL)qS?+jC7ZEHW~AVo|;=_{Ziv8tY$ajvZ>+T9gt# z8h#aueXp@>E$ZfWnv*YVcYxK48&kfT)7!)d;m^~)kK4++QnmL1-8|)J+o%T)5Q!U%$Q#J>Sk2@Y6 z;Un@k>=pO2*&aU~e0{X`GwDPX_tW9GdMQbq4*LabZ`?ztNJ|Dz3)ojyr*8OXWcJIHY2>P4)4a?R$v@Fp-WU`MqH~{5WvsCJh3o>7i3!-VqqN_(l zglh6?#4QEPFE(mQaMuR3FdMpcy`oz~l+^}ssN!Mq(ir|9%)sIA_e@daVViTFz&gSw zbnqExP}A7^PfQ4Fb*5BW{T4<=SB@OSmPB%WDMX%{koj#!l^0D~~Q;UL$?i11mzwRomrC7US-i zcbq2BN2Ff?PrR;!p1R=eyrCvlPMzFG+)GMfgsLLiv-Z}dT{9~*#qKqbStrY_SjzH7 z-Z$HB(AMZ_2qczSxxhyCY18J4?YU+XWATdkhGZ$?`ve=Gv9)MYgagvcaboh|gvUUP zRB*i!4Y(R4TGO)Q+v|h*NKqQ@hcmtZj4~L{FVglsbs%Rk0i~_VCvars_bRt~`_%Wl zP8QSIr{oKYMSQ)y%}RNZiYDu(SjZ@2yt+ip9SqGA2CF7GE@W zNUqJ17@>8U0TP0G*Q=SB7weeijL5Z(E_6js9~(11%xA1AITX_zuG27=(rv&P5}=GC zyd8WxqBGTcLg2s zRiaYz5VrE@JJOZv?6)hMy$^t^-!Lst#{*h6 zHx<1c6r6{E78NhMK&a0k3#wh@MF`H6ug3L=JaK=;SLS-epNOXwaRP2{UIw=mdXyoh zb7AUJM$dNCqaB>@dbUHArJlvO_a1t?_Sa2yJqtRch>_rFOP10fZZGsK$vboF(IWSU zd=}TUpk@#IqF;zYrQ3j;?sW;SXXuK3LzOj3#r03ODM(=0XG2(0&wE37-&gEguGmT4 z_i|p8vBJvIb@eEhyPaT-2%bK!*ypS22z6ZnMoPDC09Keom!h-Wmm0UC%Ypw9nglK6 zjYQ;%a8vEo9n-R>BKn2Ekgz3bQTEUZQ>Cw;N$)F651(SevQW=x7g}?J+5$!p*QvPx z-1GPs^qCGM0*15qfTCa|NulOF@3mRg{DrbA!m7}x^x^zIa3%Myn4G4PyONXsjm~E)t;9<5wOl7u# zq168dCKNsR&GPUdB1{I<6U_P5VRb+#R)l5v6P8wGtbx55hG*0R)rZ%CpMCz0}JYVCetynq&} zU86i^2Z4mT5LhQX5G&LN3)Vc$Y;@Armp(yE84cgRBm0fkPu@Zl;i)5=P6{FG-j)8b zc9F2F>+=`>M*Y_=vbLR~Hd=XV&(^o@KXOvqEj66ly{nb35FW1UXu8nJW_G>uLPyg# zUveFz#0x319)TY98!^O1yPv2bDMeM={lpGwj(FsDVC6$h`z!x7Rn_05{O-1M8H7{f zCT&+muD{|<>Y&$e@RR1KSDsY-a6XJsW?%hd$isI1RgN`W~@Ne5?dNsqup6VT<{rjmqtAfg9&gphKVosDFrAuSn0MWNi4wk65fGPmxnPZy+oa4y#OK-tE)xS)jQ zY(fhiO!0>w z2>ug6jbnoUgvT*G@NbM{QkeY*Ml(rgxn%r+m?p8^6R-9EUO)NR_(P+%wsVgBf!(}L z%kv5?v;Lj5^a%eCC1)En1tyw5q^BLydwf>vrRQFyuQUFQeZA2rgk6etk{?Rr=-w0H zL4KwoIehy2Ly+-GC)3%6Wb6;dTsdaY5a=+`BhR}$^8Dbx5i@XcDmK9n#e{T{PtJcx zzh74Ly{E5Qz0%j|$YAjAi^CLd=?3_r82Iurr{XtoMSA@PJ%kvYB&-ziRZ}GdakyRdxWqjUGG{!3`9`a22HckuW8{#p zeDI|MHF}YUtYUoPz~ke^Js~EK7gNhxV@gHYFMh}PznMsbV97HnAXIRYa){-F2OGE;O> zl;uAygEEanM$-rPPq%wxBa@|cCGNDZf26NVU3HLHy&9$Oe|3n_L*W)9IkI?NO?@v)@HU7>;}Ky`5M@KygkCGd`vn7LP8Zw<`RJH>9V z{OVw9NF6mNd!knx)yUR5C9+k#IzK_NdzH9SjM+S{6n5`GB1^f4U|`Xum-v`_ix5*G zs(VcR9_`?s%z?FoKE_AI+cX5|z*wNRRezkV<9&5(}_J|*n;xWP|U`syHcGT?dOO%*GgMu>M~R!s{&>6AGi zTI20CEqzt-6L}u0RHulr$CX%54bOg-g7zZ-hDQ&&FdQorJnk@3b(0bSszxb5UqN*v zmJWBud&5DM)c`~+(1SigY{Z&}x_ujNbSZ`(@WK8ymKi5_0r<>3`R>f8=%9&_;)EnLnG z!P_=R>(K`S&nhLR3P-wi2w#6jEnJWAo#53V>z7H(nRPaU8dw4RLBH}C zV(3>R_fp&}idb>}-VjMF8M$Qj6HiQ4<$VX`b63cX<=1^K{o%=*lz+YL=h60Iw`jY^ zDSJcl?#rrl^jCp*fDk##E0I-7l zi*Dwl-c2K%6SzgvZc%z1K%?cr)lfnGk_>q9utfq3U+gUdj?t-p1NF}*K5lF zc2VWH)=ZO9bc@}WH;X6Now?Pf0m0L+T}r<|q5gZ;?b5wj{Pq}*zy5podyfc0p47Ei zhi5I8TwjUh@k)KxN7-O^pQUaQi5fVbyz}>so_XrOZ{`+)X8h3kS)BU^Ih|^i(5!A; zl`FUk2VK0Y%z~PW0ek;>&X+z&ORfxT-86(%hDq;l&lN3w7L!977Kcb*Ezu&Z#EZkz z3J!nrZ=C(oUhVs#*mR%eJ&I&cczX0hrnv_imIO=Z7V9u#LZ_Oge9dzBRgH=~tJp;t zFg&b=0L21Cq-XE^5O1-y8P4SV)U+D5DmlGJvWWbuMTY#rdaWUT$dv8CZ2U}L7f5Z){b55*zFv`phQm2|bae_eG+nh+rpUwzy3U6X?~MH{TM9{ww(_;8RyE z#D3!hu*%|Dc;U0V+h?(mexz7yx5#BdpNB`DAty2Rh(ce-DEl^*x_ivP85F8#-&1h%OVwuF+PWPQ z1T2L&-LC)IuFg)k@2z^zX`s?S4|VgXqwczI(Ro(Y$)a!F?>yAJ=vKY<(!L%%&uM=f zp0^;uq|xOV0NYopZiHJUaVe&bx8GKDo7(sD;C)W}+w#8Jh}*IMQPlx|O94Q1#b_n) zOHlL4ARdJ0lYw1vvy3tjJC1=ic9X<1w8^ss-*18$YVq`0;QMzpeE&J$r+puKJ&>K+ zJgW-df9xD(HQ#2}HvRf|QEYtB5^>Q0_HQ#w$HqyKncF!Z{(l{>!uK&P0UpAY*fa+Z zEq1D-i@L*_=QMOWl)bv%AZET7^ipl@`o^OdYYN_Yyy-}tbeuYn&tzN9m}l>w*_vg4 zZjvTp-Ze*M^NANfrU@GgH`Azj8{HjSi+}Nt`3cQM%c=G;JNl}|OgWS|B~ajcFq*(; zTRkF_j=FmVU9C_IJFhQpx#c)8&lk&rL3#7t@9a3Yyu5u##4ZYDEneN_;xV>* z^oTC+ZEA&HPiLe{^cou1PV`J{qcpKE! za*N&n-o9twNIyk?_Mo4H+4uFNO(Leuie0YyQg`1O{V@L?SmuJJTly`(QrdvrQLyXy zes&Yr0j3@{7vH|aO)dm&yG$NRa-LMox=GfkP^&#Es)lW3%-)sXBQaHebs4NXEjNea zmsCH%ko-u^RD~Q3Qh^u+`)&-Gh}wGiYGLBJu%!&l<3bCRjYB+I9RGXT9f}iD=iT_A zQ_=9quTNyOhCdt@RWU@XEjET{Iw#qqu+2f|Z(*V~^-=73`FnNxTUFaWuaAvnalcd3 zI%w(pjkzmM)|N#Mt*Uc4a)Lxdet5_OFcIr2g=YZj#pajupda?)?Ycf=32STI{~!*&$G%`gs}Nlthq6jqkDbtU)XH#jmYzM# zlx+}M5X{Y4!{ai>+qoeNS#hAudZkPrV|%kw`BD~a+vu>VCcnt|#PN+TLu7P8ikfgL zJ}o{rH%zCLU1+h7k4wnt&OwFu6%o2Ymwg@2N>Pmmj&*t{Qq7HPN)7_d2OS083Up&W z68k9KM*ffEn13UQA!asllxN7(VhrGUK^l-s2s!JSl{`SX=T%EG6h1(nQ_-%-E!MO= z@(;Q7YzOU`@U&T#+9SR4o_a*~hUBNbYjB~?cS0-xxhdpU*1}^R8A^hlDmT~=x|>^W+3F3 zKjJ>;K1+8?sUEq+(uz0*zFN=wRruUpiQ-T)z$!te;02xrR*86Kc()H>ak#%*HkG?w zt$X-7mxpb zDXt@f1GN}53ZisQ7xo(!(MP3M1bx@IEnD^p$yZ*wDruWp(&CrPS(o}8-GS!@;W?Lq zYkl=8TSG$&#uA}mPTd^0h1HhSl`!rb#|Waafp$JhP2GE%6c4;NBd@g8OUUbadDUQd zZ!C&uJzC8S*Iz6O<+N;pYIogzs_do&K2boiI1@jR29_{l|-Q2y&%KcRj z+Fx(!b?)KiHM(~TY92YBi%rR7cVl}s-8|J_vr|3Q^cx;i9{xM? z>up4$I!?C$)pw>S^XthByXh!a>^v6dvV@KlN{zldJsF_sF?a3`i@rOxVNbMh*=WT2 zJ8vr}NP8*t9^p?s%bpr`Dtsbc9cEFpCVKJ$dRbAhUAx?!LQ$ymW(f3R3TXH2dvaj( z82H{hzIHsIom#m_6f&UwPV{T~ic-GaNGyWXJNMrVza-s7_$Md#XuyJB$6YtEp1@ zL)q-vW$#hKHc7tC>)#aj9;cOb>xmU1?DdV!QbelYuH#cg^FuwD=Ox!aBgTT8N?beyy zIe7<^-JPyg$b9=8?=07|KW-%k;;rDdV9Y8#V{osGp`5MyWDTY9ypkJohkES<^b>Z1 zH-EkAwHatXyA6o}cDLK6zkQFd=6S3E#O=9vdvc^Iz6m}!_3E>(+vITe?Yq9)-sqD# zRkby^aqFdXy+UXEozU6i+8-FH_jw#Kx9@uQaxCnZBG7vqJetM4Aur7y|z z)yi%ly2oZw*4M==;B6O4M34E}HnhQ=zA=C^+xL5GfE1(f5dTU5?%1>l(W8&DUD6_r>dDymPc~@(4il9VHz01j*D5IPEZU?Mdm%yD$(fcGLVT z!*#BB&u#|167;6;#8BQM+FLTX&cm_?+ZJsf)ELMb9FxXPs<#D~j2@baY+r*NW^-6_ z*z^m<{uU9`Oa_h~frA?Lw5XB4x+6o9Rt zihWi*FEnPwH^l=om$^p3&v)|#(Lez=6!794<=rvpy-rInMcI8<@y@3tq}1C&N*qyq z*HuikaiY|$y?OTNo|LaQnIGu4&*GrLtIc#;|5>G{^yGu4LSrC;VYyCF<*Xk1jLX^g z)n}?g|DGyssz>MEnNp*zp2@0Lubqcp<8pQb+HaT1+cOm0VM1@|lt-xyII%Zf$mhNA zzt|vW{5>vK@+8%Q3R?d58C;K&hAMvVk>p9gKjA9kVig*JEyaC^Wzs2c73J0xY*A0E zJuiTfBGlz+?~7nOLm_{sa64PAEx}xpM~nyYpT5l>$?!Y_1-y&$~w8+SRZcK5pxgfF3Z zbA+gKeYCmf?79CQ&^LNdn%Qq}px^b0JeEiLdAred+VOe2h4h)VBllsyB-! z_D|H0Z<^iBv!@07(~X$JId8G2<(4hHkq4xl8}^SYdFT2;6FqsWec?TG*6@s&{faub zSQT6Q#`j%GW4X_Q#d7+k;JpIVoPiJD;C zZ>!EP)d$8xYR^_4Oe1%a7G~*d7`xhMHbmcJJBcTyPjp57~nG}3@ zLg-#m6W9CQ6MRK)N~xW%Loy$IzRs`A99Lb$SU+e(dl>h%>B^LKyb#U>o_Ru#7mx|_ zJ>zsnKQAIvm+}5}s_zTQ7|+6^Y0+@oy=S>SUS`26J!biyUN5y!&F*W}eO_*%v=tf? zIevJ|LBRF4^3^f^rZbkMmPdcl{n9c|#DTfjtIN=5buSoio5J}@pEdn%38Nc5jhu3m z7hiayu=;!Zg}^mD+MA{1BvMxs)TZ)K9}|wAnTecy2UgFwtkJ6Oz0k1A#Fp;$p6<7; zDU#XajcY7NaU*uWcda|OQ8Jtj&5%EJy{OmoJ>SGZPpJMH@B29T7DEN^YW>+aJdZB) zeB&Fd$9l8(rEgSOb4DD$Quprup6yvT6R`cPyW-`1y;^X*^L1K1-=xLmokhwA z*?O@U-de=VgcyTZrh`=(?h+rIcM7`gSJCN`RyTY77_X>7u9ESJ8 zggKN`5YI%#zq@XG2mN+bq>fR6QbF+1MLa+UX$NU()L^}!6$C11!(JN|sl|sLzx!!= z{yt*lJ#nFiyF(*bt?$Gir3{)poa!|?acDq5NPO3y#zgw+{S3nrq6TyqP(YY_ux79P zQ(Zcwmiy4hI7Xo}P`1#>$h@I}?TpY0JG~b(LS(r{FPUosg_{<;oTa;hV~5?xgptF> zMQikQ+SJq|dE=eof}iiO$ieZ!v4#hd?uv4SkMZ@@2J7OYtiyZ;X~S)LT|(sWi3@Tb z%p6-fDJUvH(9IljSHMUgoo0mTX95Em1yU{t3Tfg_*qj#S4QKuy?W-<84a0l+v^swp zqBJWAGtg*epc4ew=zEzuDRqn*!-fxg=$_)~IhME|<;=~Dy$fSO)Kf?PE2;FJr$)~T z9l!ZyDSya_Fh3S?_o#?zrlhn8yu&*Bo}$u)W2T#v{^RbFgrV`_Mtj$9w-nx&K7<+; z-BVz(>c#{jf+!ld0qp;L)E3u;JEwvC(V- zN0_>BW(XDhDH^UDu4E!tdIN0xGh7ppQ_S0Zyi0dX2p&={fDnA1J&d7KF1EyA3BBu{ zIsb9Djf#37pAq3X4?XtagN6Q50)+J>co$_ zLE?Rmq9>AOSQDGe3{l3gfC#6cPfH3L9zHnIQF^ys7wNv=JjD`m&#*vWzu^1sxo=3k zB}~gFeRzlC)AIA$A>tM8XP`lLEf~mOF#kX7y$N(9*L5~X)PllVKmoO3s{&9cEQNhx z5g-VH1owSy_QEDbbvK(Wn(9ST@9dW3*5;PwmSovhY)O_ES&r=3O5#c4#CBrmcM>~J zVrLRN`RydmdTeJIXE}*&iQwEknK?7bIWy;Ej!v_?Ndh48?z`_U-~H}=3B(hJ zPdgumK7mf5+@&9TWBs=sZ9fjpV;JnUz(f)efh6;^gXLR2b{PEDnp@55UiIW)aJ3=U z6(wn%S+V$8y>~Nx_++L9reUV%3<82=ET#7q7NNE{zz2*o}kM!wHYBU=@aSPfmSkpAex$uOnH1R%i&n1 z@1qBQfG2l%-&p5;)Mv;)=sFMURDN=yutv02H1Og-uuwFmS;p~1cLiQXmW2qDU|{-B z=O@9BB(ur?qagG}x%UbPqRN{)f~cQJFW&u=f>_aS3*wo3-Vg+tR>u!ruX7v?7enDi zo6YHWz57c0`xh`AcRTA$+V_7ZCr?Vuy&8Sw=m*#FQBCvs%)tcRaPh!F1D$!S{ddH-D5>iPd?Dj#x)Fs= z2ePu*kF^FzUzMO#gpL&wlL1qM$$}tJK_@E_Z(``N9zAaY)iGKFDzFm@+%^(L9Rnat zyt@LAH?gu{+$)5=QFx-t0_G89J%4gy63-ld>q`FEt;}cQNB-=_^nF_Dfy2+lmkX<_ zT0eIWQ%ia6PO*@c=zvqJH^%vbsMsADDPwPxQiLUyX+LraSADfq*gmd|hPS2~tk0~> zJ=e=ff)nPUbByYxdntTiR{6v?9~f;Vi`b{G61&xq;0T@B-Vuu@R%d)#eM|fJM^3`s zdo?$c6d`w1X%A(wW$Yy_kPypak4GTQBgJ~o=HT`8s8+UxJa(%)72hRrs^|*@Xd4ET z(=$4q$`^PsV)w&+OSsyqxWhi&MHOR>u_N*>$o}g7JIEwu>v|GoA29=kl>#ZlgeeI# z3r$>y$(>-+2o`KDcsV3Jgm=QTZlCBTcta26+drxt2=Y@V6421x=Zi_%yo65mcZrn25JIWp2Z?)K|RuTpEbuM$*q zr80bcWiwxFh>|3a(ovU3OKx0{7GUL!!esTJyK$R(qL98!v01hw987_Fp{Lmx7)g%J&XgidnAW9?hl`&m z-9M}FuUzxQ4vQI^kKraf-nyq8UQM4W_ndkzp)$C|Ez;DIBy)rz~=XWKuX*#?V;9_~6)n*ch zOqX^OqDPfHopTV+YsEk*DPTU@TN+6TI6;!MT`b>SodAmteyb}+zCIbWWURwcehdsj4QORRS^yqdc z7%YTrQUY#%$zet$11CbpXb5g345WVBB7qHrtLS_^^KU!q^Ec)V&47ma$@_`~-< zpFDDOJ-xLW9#Xtkj4shZuHuZb1L~4k5XU5r$M7*;wF-ThCY_t`F z_>Nlb9?ZtXRwZMh&3g}BAzal8MM4nCMA_wqoqO+k^^qf9FJZ>Gpd6$aH_1eU`sBv+ zKg?|0*;A`ll}aOj3HIm{r^<9q9!@m8(Ux4l+$fx??W`YUlhxS#r<$*xJ9<_w4qTeP z8SV|eagruavOkx%M#W4m;#Xb%m;);BqScPud6zB39hhCfao9@?X3YGX z*#~vfm97(LHxpo-I&Or?cl-%*&PH^b$C_|jE#1rJ12(r64z+`cdSb3y58Rmg{dYKHBIy+a4ysV-*m(Ok`izeei{VVr*P# zVxTl}6oDYwAuUD&2EkezRsP%N9Aa<7A4Bqh{Dl$H8ot@E^dMK`dOQ@-={&Mllo{*_ zvQQF+!?ik_nVp@D@OZ}Nun-n!mDEG_bWyW8Ik{S-`SFM@0qGL6N{POtTg>sAd*I%p z=)ou#<0YRTZjN72lT&I-)G#jUJ?Zd-e1<#niL4n<@Mp^N(kN!MPM`4P`$quq1BjTyH8)8 zda$*l_)CGZGTl^)ajVEVFo&u-!p?HVQ9WMW80!g?8z9TA{r3=`CyA~N$Q)6?feyP1 zf5ZQEH*xU804o_*8jMT1i9vn^d^;D)9pEno_d+1EVx&4iaL-}gMj`=r*)Z=MLp>xR+hC!xIDA^ww0@~tnQ9_7c#x>fvn4K zhSS2*5vIR1)9uHdQ;pR8^Z6nKG1XwGK;=t=DIPo#PJ2jI5eMVjt(leC^=4U5GUBnp zmZnE}n~k)Q+Hw4TmI9B@(=BCfnxcq;lPySPmi7>4r8XXyR$dq{G{ zgf9{vo9LBQssyl=(`}|Hd+gio@89A4A|{AMp7gYm(YVKL`sk$>65}Z+O`QMK3CQ7I zzgFECpZ3_yW_LnVTIKU2%SY)#xKYz}-&Ux*RP;rCE{x{54g7+aq8L5^ll0`J5p#sn#l!hK9|QUSOYGft*5U>U@Yaa_BXjhlSgFpogYy2Vo|c-;|voR zS-xKx3D=h7CMur64AM05>%;H=U&HemQHBYO zt672FLmLMlkjS7h+3*dh6C<(1?saSiiqKJ?6g&xkWM^!=V5Mm>AMz?5D!?|X&B#n< zZK0BRgv*DN^6}MWIpXa}=!u=7aBM^$J@&XnN|{=9Y}n4atddLh>e)k4SGh7gT;$dz zvBKf8WU--pM3*@8(BuQe7iz_eUM17e59d_5rzWMwCmQ`Fx5Wyweux{+H@E-QBxN_J zE9V-UliNk!t8fR`A?l2lEJIUC#S1XBmGWk`^c3f%M8-A1C!}@SQISN|l}Y4=laCB5 zM!nh8b*?K-evrD>^**H6a49a*G2{FivV&!VIP!42q7j}!9@B}>03-n8icY;DTZoJ? zr0V^UqaXqfdH@N~Whgcc5C<}+9r+n&0u|qHXF`Tsi+9HXbdcdE!a0D7DEuB2k8tFR z+c#4I%37|+#}#>8>%F&k{1{gX9^9OpX>v7Xa`I4owP#}d@cjbma-|%8W*{GD1j;oc zXIYgAxT1bfCN${}hdreVw_tNd)i4{*`Sf}fWBT4R@YvMd&qnc(>{(kQ%)-f)b5}n* z^gO|*2jVfQw`AM;=Sv^SCHpwhivQi|2j4!jEb4)|-MARDo6Rw`xWf%)KW^$WSrebs zPuF)3F3JTjKeZTOxiqKIyv2ce>^^#GvFswvW*a2~Zd0rTO(a3P9JkiE9a>T+UAk!Es}6KDgm z{R{gaB7Yq)i@vUT*g?)15C%pDE~Yk6FJz(7#bD@<(y>`6qC92v$DQ$pf@1uL1OnParr&pDK0f4Ls}~16zqy4F7le0E0Dig)bpwtpCiPSkpspxbPAdPS~Bk!K6AY&iSL{SOiQ zUqSq_?4By8qy> z-1(KQBkPSj}(PLI2jqTMmFFr?2-wTAsEW|Rak z=6dopAP@;9naob+2TCcuMekWD*3+$Y7qn9Fcp}E}svc=rd1q0D0E=>L%nUX?^^}nJ z4?WzQgZUv^4g1tk= z&V?lqj_}3^0XTLD&NIwbxdb7)Nx}v6EpX(l;i-EB{2$JWn3ZvlZ7Oxh3b4u zOxz7AcT}DlzNH_WhWjpfRau%(32Zsr$kntvd(*2+BivFj?vII_-GNP#c01);&>*z_ z(ZB9s-<)MViOkpvBMKA*&FZ$pM)7?o{AmVE{ymHD&#%vmaRy8w1R(N4X>qlc5d9Do z^K(JHa(M8usS7F7@@RxD2fQ|$1;xetH}>C4{CCjvuyGSB;HbuqLp6*PEDUCJ zfi|a1NH&lYN*I82Jt${~52V*%ql`_*e;ccp)l;$L-I^MGZ8w(!o7?^$;CzcMA&Po`oPjgp+Q@)m#;?q z10J$p)L5Ha;YJ5`cd3|DVw=8Plw|@j?+s7Crp?DyGvn}zL0V8Iq4^QT{NDY~!`*Yg z+I1AHF^VqGr44}ClgI|5EdytTlse(Ukw1gu3;c;Z*(1YNBghEF`w&^6952DazLuJu zQ;e=sGu#*~9*_=XoQc}n$xrLW-U~Y$v0^6Z6$W|9+K?s}j~2(quPh!LWBHXGSC|pY zQc{iJgZU%<(Znxoh9n5o;|IGNgMHPY)pqZRdluahEt{FnDUIWb9B#Mmai@>gbd8mq zR(&+p%!wxL-6ziA6xDaQ$PThvMhuF5+3a1-yzftAX|p=5H~7`z{$1=-B4Kv8QcO7lkdhQn^DfYh z$GSX30(2v8%=Sfi4-y>gHTn;ZIton@l8c-;baI2a0~g=`!PJ*?(nq-9(U15Rh_iqJE}q^;f&1L@>H!~E)Ruf!mE5XxlQDI|@;t&g-T3ni!PM*jtCoe}r?(=` z>5cWfw0lPGJtjKhKCV#g3%&j9TuF!YQxFSNK}n&ggoAc_`ZF_2y-9H_H(?YQKzH{) zMSht47VuO?kjKgs$X*#|4mJR#H3(#FAW1QBLU9J*C;$izbOJ1w5rYu_OJB?**6TBR z&X$h0&Y#_>zBDixm&-dnwLjl;Uc$c(Rw`f2)FIzdt#Vkl?e5J%SoF?;q3#iGMsEi5 zUa-zzs^6W~W}3;p&-I=bhqFstbrJhrE#vou`{lrKA-=nJ)66lM>M)Tj&4x2BoW!x+ zJ<#T*WKK*lEggzQMx52Px&IzYC%)hH_O4%s*^P!B?wF9g2^Iy)l?SjMzMVign_*kv zyC`LL;fCXZf6!z>aNcmkJb?}*g<>@$BSauGyast{INmS-%{at72lHNkY~ed$IXn_F zQ7n~!+g|f^s$L4G2rpB3p|Ugl;?CP0R5=(@H7z7WoKepZ?{)HC3m=KQ zWnrTs`Yt-9$)1J&?ohvywh1(C2{UoAw{Lc6X&ImsZNzDJSPw%IQq<=pJt>OGQoyT7 zMMh(blbVgA#WcGxGD@UB-9LTq7vbVuS!|}vvY6d#*LUJk!1inoJ5-k;uLs1o8Q<<* zT$)>N6zi2techvpqj9TEUBcD8N(&)~^5blEfN~PyOkOI+IIJ!o&`-b56Pb>t12%~c zIoT*5X#c%bkSg3*vbc~rt&d#E-O>g)wa9p`ODRPx27I1qLH3p7q8qo_s(Likz+uuQ z$5d7i4f$T)0FDRPo10yW#8Il$^%h{Mb*PLGY3Mx&FhwyZf|WX(i);y)8I%GUHr%k& zMh)mEfb84F9kl-(ly_tTK_*BI(0-SNJ>Hl14@?}$_t@2XB}Z@vb(%HL_J}r@RE+eU z(F?VHPRjaXV%TQAwTZul3D%ajCi;!)&GWh^%+qGG#Y+N!Es>5&rZIZp`u&3^l=!r0 zr5-s3Xx*3O2*l%yeN*#fEHRKA?uD}UO78)EZDAtTJSvB6mXNC`H{|JK*oSwEvc`sS zD-Ii~S(;uD3%id^()sOX4%G)@$#zk)2~UJxI0%s=6r z4TFoK9wZ_|P6!|Y-8a-91+;Nglj$}dHVz6rfWkV!?PN?9P+0&#Y%ul^_IJQ&urcsz z6b)l*N^fA?Q%+m6e~$^fASaL;a@r-)Mivlc=iH*idq6CeJwdfV)~sX7gg2i@W_I?Iw1W>i+`5Y^xgDPpGJak=)jz{}drB}2IPG>xDd{UdvXa};_WzSObM5AvxFgg}2 zi@Pk?wL^z-=gCv~tvf%vSWRjHYsIf;!=wkMHu$I{R9duwB7#0Z7c1mC z_`W4%ZA-?ojo|0U&I~DEC+UMi3+Plw_=a@=tp!;o4AkTHHXv7-H#IQi$*?=}2huH( z563(uHt9~q;^!OhUis-=Ryj0m_q)7f9a~PF25mVDPHV8A55+gvBXe?Pei;Vh^EWhyRDo}8W z{+Jpla80Yrg=Yh1&e_U9`S!KwP0W8Q%+%FTe~)Ijxy)pBYEe7cbVzb307Za!R39o; zF5L6{6Q5J86y>8Td3i>=GJN=Yypq>q(nPVClQK+s7tZ;ET_fa!upcQ0+#^EKpGlErbG-fy==wFrK_ZUb}Hq&)u=n z2(2Aljn~-B{Cb4D2rPi{>ei7_KF!W7PR+H#lbW4#gdI>shAbv&^LvDpC*SDLXxgw8 z@{meCe!90>o4Q)kLjtk8ySw-F?(qYoMS)6s!%X(rv;8?!Qa(N=J@WNuH{={$4_YaY zy^yfUY#r*?ew&LD4yj@gH{)h=|6F|)p#GSWT+EM@^teV^JuAb;T&`r^c@n54^^0?LfF$Dwv>#4NM$U7fw2;p~(e3AyrZ$hC^?nUrT9hhE=Rm zsXr3QpXrw)$M1NoueUTK=`)m=6i%jR!en?>xI@6N!*U@Gd=G(Qa>PxIFh<}96$C(D zU@|M*SdZM|?NFOapzMYC_Uq9K+`e?=r9W&m1S`A`%;n+_CjDL)j$5Mr(O6yZ=coK? zg?Z`PCE}aJ?%t0QPlWMu@`ycvvTYN16bPf5cy}3RAe%xY z592TrPyS1|LLXdetVxI8@zmF<*=#+kM_HSHur`%lfOp@kLp|Q_J>C#q;a^z)r+E_jifQAYXvQAh7J|@Je7oigAP>OoYVHSQ!ct5lV#q za0WLC|4<&H_;jBqI(z!CZ3M^Y#N7h}*|13F=kM+>bID9)a%kiAU%5g&c|TZ)uD)1l zck=1$adql2ceLph&2(_yVpXE+mBw9@8phaD-6x+Buv=j0u&#;yCrOQbFWBU1PTb`z;F;as7fLNGF{hseSYl+rX0M zC9mjkopcs7L0!n)_wmK228%O6H}F(47OAPEM)tl%@tQh4{1%Ot7|kE`cs&l7V*cQ3 zt{vt-MguojV zhCCLfI>rFm{v2ctO+-=26X22#CA78qiIL{V*s`)Sypss`O*z!kkd_?G__E!_dM2E4 z+74@(EGbepvo}_WZk3Z1R#ZF*PRNO;8t*%F>*AH|T6uZcKOApfB3}Zp8&nS*S*=&z zVfM3QrF%#4Sr?8GPJcj{UOS#0Ius3fOLF3nOsOPovH1P9f=W3^`t`odh}tiPD(tLQ z{K~mAE1K-49Ga58o#)-ye;aWI)^AK$fIJTeXJ!yOU_C?!S4Nnm5yl$HHU9XZUkU{Z zsnL>)(=;_cop}D4_x{0&3$K6o5^>+9_J>-J4WC<$Psig8b>6^@UvnPmua&jFR4HhI z;-AN9|Fg~2Q(9sPK$P$B^~6vea9ANP&xvEe1qJ_ev+E!kf%k-W9f8Q)@IR>Jh772Y zWT7_*8iwSK0wDwYh5zA(ROE|(90ozaohssck(A$kS^lE7RGJb9Jm9~|D^aACXav}{vD7>#+Wb~ z>Ez;_Y=lGg-8>H330ZkbKvf;2hA5ob#VAa4yo`h) z8v%qOuoejT0Ka~B{Olm^X!a`*TGvwb%(w2$bKK_g{O;~+U#NSPqQuDVsyCAJ z(=Id4`h`|&G-$Ee9JXTXj6-mRJN>pG=Xa6QfIZH@8X^#=0?uXFWEUn-$d?z}6jTB+eR%<8m=Ky9zKiF80tG16 z`hM42@!6Th$~eZxR8g_<7_j|mS8sNC%1;M#t!yNy+PrqFD_S1p#St|feD=Z*XUA$O zfy!)egaZ7izE+X*O2&ox>Ru^^j?NBl&tJXN8zki~u}>@MN$JxPZU66pnl96Nii8in!eW;q{HPBY8cO z&&TWem>Va}Hgj}^_~cIeT043(H6d>fhKQ{dS0<=3_ik*423tn`B&yfO)ya`Qf%QYZ z^y@3jcN7Jh#3)}TVaJ>X zt_8y;pvn*wpuyzB4jSPbY#iRx;TJ+_1WTZ#tK)THjd}d`@?eF4{G!a!NWKWqB}~-i zG%JTB&&NytqGY3~xGN?!0{nuL*5KGnvi=sJciEGHJ|%9;*W-RyB7B-mU2UJ<`}+}h zgmyZJB2*B)0bX#SvLOF9jBU=xEZ&I!9|v(95Ed*PSkGr>ov}dE=D@>aw(h083F*a34cJdWsF$gI34eMqO9MSxqt4l zmE+lUttXv~398N%H7{pNm33dtm2I-tU`o~}+>pJblB;X9C)M44;To}gdGFU)i=TZwJ9EXC^WR@R97wE4zHUZkOw&*Zr7c$A>H%`7RfKXFD1lDvV7>0P z(zaS}M3u98G;9$o^zLp$u*0MuWwWxX1GaT?d~B2(p6c!SB0pxp0La=vA_!zXCIOV32r4Xez$_yx zdBZJZL{?tZxAkLvt-c4?n=ED%}czmVY8}Z@4kO>C!5Fu_wz==VOe@`xVkJs zdLPdw$0mLyBP9Y_;uT&fADiv_w25DvtlMFE^Bne%UKEF8`7%H$J3yZ z0-bNwi#@7G)`K>}Lc|076vS_XDIboJjtu4SPwN+y#1g=iU|;sqd*1^e@i;^rz&G?# zP|L^z`wkX{3P=Vz0Tu%m-9!N;5ML2b(2PtF3{(cl9|4$&6_+bG?qNNAzE)fakEqF+ z{uDtKOSY(}_r~Y!&{~N%Di{V`R`uFsm1p<%#oj_BNKio4&wC|&@1L#K#2mm&jGC3E zM2QQh`TklpVRl07kSA#Az<73KKvta$Ueu=!XM0U=19~Y?hzXCALG=sM-Y56gx_-Os zKvypWDkvy7HU=sVkb~hU^2-~M9t-{*C0-rxj@oz70(t;<;HhVWfqvDCphzp1b{dkh~WbfYKujKwluj$&i7! zKR+~mTGyYrVcN=`X#cG|l{l4&Rj57paCI^ko|`feSHAE?rWlzI2IEDvk0tt;&9^=l?Ul$u)_I5+O2B7uVk|H5FXU!BaQZxyEuP|7}jIC%X3ekKfKO&cNaY2 zg4HUzQo-10!~oCZWgumEr4KEX&>>g@xE~9M;{wo5swTGJvzMW;9QAVh@^vh zppVnIatW9SikNjV7AlujMhZOs3hPhS8zxRH~6D2EqrT zYZygpbVE7^dTK&dLgdX6Qe_-V^KU`x69MjMyElBj^poz$Mii|!Iw2RL6J;2bf~WYvig7K%66~p zjy^j0Q08cB_~D^fPf9_zCsQc-gmf%mcG*0U(O59$60O!k*i-24=GPCOe|qk6E~X>< z3bMLvK0@t4&*Vjr6*ypUE~v7e!_zoq;K(g@v<0Nl3F6?;l)*KlAjJf|Pvn2{M3E;S z`ORI^P{?bM`i@N=RYR*OUv({hI2+I*Hn-pyWjVSyG%Q?O$n^Er4<%^pJ=cC1L8mYj zW}ttS<~ye_KuS*50;ezl;tX+c3d@P2S~;QY_OU!Vh5hYYS8)z8qxNnP5A22u(V&Zg z;+fs5g(tVCM!B3zuqK^eb1)-g&|l;5Mb00d->v><4=vz=?Te;~{W}2z0fbX6nW4(sF|5MU7jsC}__8(n2(hK0fJWBS1&0Or-M0$a0*-a8~HDoe4 z!$l!E8uco4ujSB= zG8!2wj`JOQ(7!86rg8Ev_i@2GnL^qK{-aN{l$=D;huBV#-`96xUjqm ze&0%Q*>RKi$lA!4KAqfn@Pk5uZSAJ&9y(ZPssqv3!5L|GS@f+P4IVU|-`)Mu>U=8R zuhk_R#l}k^Zw$%mX8Tpb1G1`tv_MuUFGtJAIyEqaW*c!VLK={nfj`K8!{LHV?=~R{ zeX9dYARG+q2*%W)JpryZyi|-jlcnAa1W{_Osq_RjXs~g(>Dkpeu1{-%KMBcEXxf8b zK)DiQCKZAwye}Rp%_mc z*s3^#E{jA)ip^NII)&YY<-V`%bJAX5t7xLAI$6rAl*2+8^4A;tj}u2=%`(IX(CH4A z!-z9cvIA%k`n*$EL)_NR!cb!j+HWsPc`%oeDWPZ;ecbl)K&y>qbu4 zXizb9y1O6jWg>3uF)QdioDnl%&z&$1lz?Mldv8k$RDp(PH-K@1UV}7%GYkDF*GI31 zZ=si=LI}Lh%>R!U!uNGUp&-Ns*`ebmpg;wE0@N!LPh^j0;<$Np#Sw=H&_R<9HIUK5 zkakD|q^+)1EjAaE3pQ%yx^IB07ayBYz+GM1;&g|{>Yy;pR!*Kzk`AZjC<@TcN};SMz%z}-b^dM<-W zgL-vg>z#3oaZzE?OL<1Tqd|?LR7R^{e!bcvXY1iHMak3QD0|OnQfOYwt8-CD(0l0< z8tD<}V9J>SzVmp!=p3Mu5zXO%zJ_6Gfv|2ZYV)P(MLQLGei_Ks3m+V<9M2}Un@S~+ zciMuUNnb{Ggqqrf=8TaTFwP> zU%+;t#NF7#pWF-h7ASy`Y?xLKjFZa~jwJNhP%aXS0~0l5bz>xyq}&b~BNeZzlVl*E zSIYSc<j-@^)5qCk$NB{ z1HD44gd=L`>5p{|tuoOmm>5q%=ht`&df>JsKreFuZQK^bzf;Pe5QL$e!jGTE{$I!o ze|$-y1q?qpY6GgH-R2;1o?-GDC<;i-=|U3YqtUHJhah^aR)|8uUi-Y^d|D!*{hYNz zKI6gM^++*Dvax2fQ5nE(o~Er)e0p|8Cn+(kB`9~^Hl0|n7biF?R8*jyv6wI0I-(zG z6)~IrtS2YhtKd~l1jK#L--EJ1tpx!Z@e!;(KIlh z!b;RCRs1SN=4=w5v)C{P-6M`+=Hl{QwHaB7`!7!L7U#%Y_0+NwT`o4lNvAE*@0LV& zN>ZAE0HeySpy+3}`n;q~Kb=*fK0d0Y!x5`BoDn#`75SI03tcf{glGb;jiw;M9vB`J z?Lx;ofV@M{L<1^{fMJw8c3MK=`zVk#^$-KxPd)#sKY92rD)7Y9A5)jJvsbjZ`fe$b zSuK`MRPHX+Xq(lSiAn>?<2T2aY^HBQ)cv`afBV487caTo(#hG8r|04?4y-8^j#MJU z>(_ImVz}Df9rUo52A)8r^{!voe;57;DWEK!1SLa7H&7q=fZC_w&kTNCoP89a1B%s9yKCk zWTHE64Eh-16C*f689qFpB%lq$LD<8o?V-6xCeQ!OB`BJloxaSlZV#<1vq19K-~Ziv zTwy-$26e950uHB8=!wqVBrT#y_mu`#6KlQqj%nwl-{$N#+$PH7snV3v6El4Pun4Id zNCIQhL`mfto8Y{@vekcQv{!UGNYZ(OM_pcdXJAjlx4go?l*on>uY!A{NgDaOntB2MCug_XysT8} z9WTv2w=}rGK^ysYZf9V7CT;57{_6HeUM*?|+(jD5Cv zSITESM5m=tg{hT`*&0MX^9P529T*P)EI>c%m+`+O+Ffbjq91~VqFzB1Yu%1G;V>Yp z2EYsKo6)ReL}LIw2s|Phpye1FjLPKbm1cxTA~Xqc-Oy?~Ckp?|cQoF!miyR)JGeP_ zmF0B|(Oe>(9BA5pxy1LH?B zLCMVD)Mu-e2a0FToK)Z5s!@cGTmQA^E__+gB3_9|FKud5?cZ$(b3E2PPNKhC1RQc^0fp6iU=DjjiuUGgMx!AiEnfT zyEL$DaEOf~z>sh%07LZ{94Cqa#NNQ(;|BUDn^fW|6;BQZa!jE8Om+QkpZWDio_h2q z-aFX-*J^dLb><9h)B8=kbS&b6RL9plZ2CoVeBrLjlP3JulaB`X?k%*i-yMJJTjTWM z!_C7GL1OS;kllHS_#4QTkWL~UG)PyVWe|M;PrY+eI}AJqPAg&spzbkfqci*+8hAh% zJORW}fe(10w_~V~ts*$Qed+y9(Q2cxAI!%s5#P+%GY<}K$kfE-DxL{O zn!TfJG#`4P{S79@3O+L#a`fcgk~=spPEwIvsQp?g?Q~#3S~iQ`_Ii&0I$H|L1sGEW zI@#F&Q(~5k8LLMGp(dD8!%-S=J~A@GPjt$o{edbjD)FMm2!mp7G$+Ga(RZQG85EeM z1hQj@XMgL}8z~GL?rkx)W?j~5<%HZ@poKA|Um9{@;lAZ^Q@?TNCUarr{q2{&ds4?K zj*jOnzM$WZ;)+Gn)+;BqUZ?5ii|^R|doAqZymqn1*C^UDJ2Tq|V*Mp8UJV5X)_eNT zADi_B&fW89HMP)l4u!BThoW-d%V4n`c-jq06G63;-s=!1+A zm?C7JK+YzIs5c#|O2i;{nY>_gZ=Xr{uR~bT*}S~`e0(Z-o2>E=7l@}Xwg2sMYiHQL z*M2Urnw)?qDH89;#ydb21c(>pSUs#FhyXah#S1aaUy`P1TLs3{w)fth(k z8n{HvwC@a9VthKPZe|>sjnZ3vRwX8pG)y}?*C7u?eIcL@upvlXfj3Z|3{<>`H&9F> z+Q5(g8Ty#GWF!#PY`TpUBC0LSOC+01dp`v=c!NLSrdePQh!xPS*8bn({{Ve#c93rz zOJHgb?-4v+{4noj{lbSrJ4- z_=n_vkkx}Fh&)o7ifcJBF(mW5h_=%5ITKc@M^^?8E8hVFfph(vmV^+>ep&rqQc z;&>=sm0^0!SlLfup{K^qEF6%sRtN1&ORdsxenIm-X7Xk;R*Sh9%Gm5a!A1J7Zynq! ziXro@_T^Gi@(RAm+{z^OkwCtc@Zjd?krv!-X`I17206WoW?CBO$kS8Ca5F|Vp7_`E zS3f&b+5OFpuUs1${9k|SS<}%kx39E+{X^{^Zo}&~fkXds(g*jEbg41aeWXM=L{$KE z3-yj5wwz(HZvQyboXOv)&y7s1Hd~v^vwyO-PAxt=Jg~wPt6w9ORCGmauoiKON1Y?Cz><_;Tg`6l9 zL6IoD2@wAqZ^JMZXv%Xm2NQnaA=sGCBE7`-{g^?{Y3 z)h8;A`StPbD=Ta5f4y@9Ba_XkTHyHT6Q;j50oxR0Rqb+_hQZFep=t-71*qY56RSkK znTn!+7%2N1cJ%m+i};&U2VegUE%C(f;jy(x(d#N*Hhd6#HZY95@YE8#5_G8}RupRg zyPwoC|3;VwegJ;@l~MXt_Mt;_z#WA?i3W@aVnuEdITsHnl_JpmVAo*?K@4O zZyx{Zw@>~(_QKrU-d|wSrRk4fn7Mds@~JME3hL;ZB0ffx;OA0c2VGFR>`Wr4tjWK%bn0JrS{Dvo{OBLM{-}L^cj$8aEBUS5 zm3xoCL>$0|-<%Hs*l-@;GvrbswL)zZmil*-0dPRYQ8^?IsU*NRojeK_Z$!EThdXE2>`_k7kFc$LZFY#$cAy%s$O)}^ zIWsenu?pi$^GOl)|L3dF|DRb~8t{y;t_=Rw{+!urhNg%Asm;HyIPsLa1cTIm+~z;G zj@ta)KE+d{Jo+=}9RB~huYdnq*VFh1AhtW#^$3_8V`>nM8~I({)**YMC=O*95Z0l+ zNg(75fos4*f+2XIs}TG_kbN8a07{+i}l}Vs3ayGQo@B`zYQ)KPit#&G-jG zPMPECtr2M07t6tBtEQEcG_+C<2Dl{U-Z3s#f)P*TzCMbw0Aa)2{w5Q0Y7T)P9#>-l z+~HHooX_;Ndasmc__*YOc9MW6GrTx)`KP9qXNOCd4{VFc@SL7b7a5YotmdeHos}Z) zYNXVl-Swes4KCu;TVueHyupN${CH)W<*g1@bQEU?tqCpRWqEZVcemZ`b*g+f_6%XS zDG?`cw_{j{i?bmZQ)uYcV_ly#co!P#_3%P@5V$!ckGgMNh^XFy6O6WbR6vC9;6?{o zlSEtcFN7p3xM;|#5hVZ65Rxhz(e0c zX9YcoNH=iq0B=L|6kzcpq!kb-R6;h6rGd#H{Lb(mh>c_VRxDiQGk}Ryil-Z;>4Z}e ztH4x&fWxZ6dFuydIuaVSv!cic{h|nN-vqRcDUHm*b+1 zjzC{(`|CS6f08&U7ug^Top3QbK66QOW+PQCnTYuyrxp2VDBlYi81!e@OE57jI(z-- zv12#fj@gaj6Y^LFntYv%HJSrru3O4Rids>eV3Pdy_H8|SvoGHW1K#Y*f3q(i5!n&Y zh`g<#6mRzBgSA9BC;DqtWKax=grsylr6DK8o4K9s!T%_b27CBsU;dkY`Tv#s^7GgZ z9w%9&kJbngpx$OoB7`Ub)#^Iwp@Fl(AuxCt1|*J73ifx_v1a7#$n!uXV0{Ugf^m(r z7xkSv2kUsgzf6(UnbTTcpO`;iN#JYI`--CW03G&Z^p+zS+{W;w@*Mmd-dK92wS11Z z#={7qkprH{{NdkdgzbEPGjGNUN{_X&FR7+zV{lw4z)x4gfXQRWyAM|9!x0Sm<0s-3RRG(LW~G$U6J z+;QJ*UjrHhb0TZA!4Nh{Y&fZ~o(PI2=1&qSC*f>wE^LKqS?*@cDZ9;I^cDwCs6BRJ zSTDE6L$^>K@n+xqn|<&9HTvG4!0yN23;3JRH3@2q0#_qoMKx0t<>G*%Q3x&NA^C?J z4U8T&Gy@X)F5q&Ch@cpSU{qu5V0Tc^!u}lk+0D63`wRouVEN4<@$gE^=`rufWASx@ z*YsdW*L)X39FV_!asN}N@poNXXCroKfx?|sQp}EOVZ2Gj*|acu7ZsvH>@uJM4atUM zKWj-TtI=A<2RHkaL%Sh@aF{8Npy%b?U6_O#EXurOgK^z0Hjeng26p;pKm7mu{qWfS zhUqc<70@Fb@#~>sID)zjfI46XCXSIiA|*09;&}l9>$k69KuU8vy)@D$C`u!|77^Fb z#bkgzaWCTEIP-ch{u?eS#;C%qMw4c&5o~F*Lq`N^Vi2yqiWLHbF_~7^^uF>6-0uZ_ zBbD((C4X;E(X;5F2{xp7lDSb2(ENVzVEdB5N;WHXy6y|u?8K31%4%y&H5>CHT(03y zON_1$XnZ9X${xwxkrgFt&r(m2=0ffRm52p~Ynb?oUG(0B!_q}!FXL|`K5I8 z3mLYbm2EI+R!GSn{rt}9xmz%YPzB(#+3yN5o^o%$nAK_#qXTznW-IOt=EA|8r*8*wKbEme_V1NNIzyO#9`!ZOEScru~kRZ4~ z+&57qwNj$BSeEU`S}j|aD0yGvq;c#dj@|5T)0`|#)6=HS-kdD$O`0ZcPEXRNZIU+K zPJ2%8xjnaOYKzc${{bb-TkNDtpWf&8Ath16;Q;)<@BhB<|CaYncpmd-D;PkH0WB`3 z=Cnf8=`!~DN2o8Dzlrx>>0lONg+UX600Fw!i?ME^WY9qTzYkiq2~DcvT+WgffjB7` zfc%5R4d!otCdBy|lvG=lOh2F=og>SsSSh$QASRtj&@;1iSaeqcp;jsrX}|lR`S;!t z2qoKp+(^WlYNC?yO6GfWsqw+Gw^j@~(F5mVo#hA0tF3Lxio+W8HljS=aItx&)*3H# z-`Uo3wc6RR-^&PmNFp}tKjzk7I=B8Gvrhjp>-7KgS*L%;{dsg(jSj%}5}wR47_cjt zKAqM>va~2RkmwI?lD(!VBA=OsmC~qWY4TJ)W>Pv$$`m!txGzNnXmn&c2FGcdk zeA$_{i}`~2ZCx4D-Soocr@Abr<;(B7d>MSkK4z7<9dl% z_3f99>-1xnpTeBleRxjI{5D+Qv3dRP$@MNzn`17R58(RF%g-3ksa<{x?ti%L17;_= zf7j;y3VA-}7+vO%n%|D=yQ$9edyVHGYg;VuH16Nixu03S{MhE}wwb$d|LU`y_xW+- zb>G=`vA3Cj4%hegb*|rLJm-yg-8IWMaD89r`P3bougjZ<*?Vz)ZS(pMFTWkne?8XW zjPbfRbY9n-H|{6TIb>Ylzj^;#jrDQk`X4g);W-EXsPq2cfS;o;-`l?PDkkO)oeaZu zM8%{r;`=i}#-xw7-}J$s89e5t=-*++u`7% z#Px5Oe*tTJcvD9nGVVW$>;K)j|EA6B?=|k9!t>wG^x^&^n=)K5?uQJS4;%O2y!rfZ z8Q1T_^?-5xmd)#bU|fGaboo2R^;$h!Q|DJLGgLuxbnBU%&HXYl1&P|)I>tf!|9LM$Jo3Fdq(B;=-ul%F=Y5ZO% zHlOoB5UjH5A`oq|}e`{R7ck}u0xw=>Ww{iWx&HF!O z+)viWW?a92^L0PJ`96(x!~1+<^Ll69$U0*^as4fu&%t#P2VTC1B4=}gU5UgO0c}R* zoq(Go5oWX~rEy+I{;QWp2A&LaBcPQtID?oTjtO>m*oC$dyU=~tK|SrYRQ*ZY&8a3> zIV9`t?GIg`K7MdjDlC~N0vdP>ZocnG?#_jn65-_N&iP>txF`;8XYHbiKffopeX?qO zX8nRmHsaIgZ0-MXxnTNy7eGVk5&`})`l*Z)5Fkrs(q}_b2Mri^%#Trm{9ogsMkwhA zcOJcab!SjlvNo$*aMNb%DcQlq_-w2`dUSEL+0dnxd_X+f{vQE(I2-mmC=LJ<)>xp# z@oIi1lG$J07Vhim4s$+-3jo?S8)jI;rn9?&k>F`>Yx_*Q(N8F1wNQZ|o#DVh5NNzX zqw#*@OS#O6r+5GP8zOq^sGc63+disfh4!)S-FH9z!6T8>r5{nf(NNDc5A+}Mi<&lW zV)k}D$=*!*A5C$S-2S=tA5&jC%Iu{afOUWAkG6pwmMt7V=8*yJQ(Wj8=NiNe0qOIpB(Pi`h5Y)kr>kIieRyMz4eMxt>y(j z9J%#lTOOW#Aa(HAor8@~B?9OT=+)ZgzomW|T$so3ACgiGjoWJL-_ z&uA);mDp@7n-xph5a>ulBWmBlZFQICbW)6&wE*Y_Bm|G9Vwl&h^lxD>Z7yZK9-Ml^ zEML$xf%Z5{@jy$}g`RjhI|4#bK%t#A-?FrP;2S5`(*2&PWDTO^mjefKzfMKq5_7&>vGuG^Q3vp1`D|BnD;=7iNkjy{&1EYz%0X%OwwcF2 z%?@sV*Z3PJKJ%9w$+OJo&Td2s^U)_8tEsxTY)X#A9%yVKjDpGGi6PT(yYu=vy(n-` z3O?W&FsxryH1qlb3rG5N}WM|CfWonc>2t*i;jt;<}(XUu|76W z-NQ~52fZxwomq;KDxzd}kiCi8ALhpHv3$4d!(E^4tUt+DV(g2U#w(Qo^d^y+9N_C1 z?F+Q%;z+A~r$>ooWPrX1sXdK2_#Zwn1c-Urjk>#m6JorUs^&7F+jdl+yKAp z4YDj{vDhSgVrbgua(iOFu(qFJQ+oRLsWMnyE}$ISLZgbKs9h$y@o6E+&u)lxSxAFJq=%+E=?$%39UzpwbROY7Hvejs|+9rGKY^c?D z;WyWml-NqRFrWL(g^j&~!6St->|qRb8UVFhX;4qW&HbX#Z)kTbPp!Cn+=l^j=Km6BfoyESWZ zaQ?|y&LvvB>t7d?DOCcdc~!{z%4ha3Alpk{zN7tJ%K_}mVN7Gc0T<#j3-k_jtf6uQ zBS$u6$7YpafytgE&1@tu+3D86-@Q2s^l+U`Om^;z3F3&S!&6wn@VnTPQB3x}h!^fr z%jvVfOKs^@IE+CKmxZbWq@*6;S=dEE5V)AjVzToB5CJq_I_XJ|?Aqjq8$MR-IXk=I zWzy{-rFm*>&#rjiRL0iA7|qDq9TYuod8LwMd=RZb1ps*TdV|Ae$JZ$!mPn7m(h_+RJP7D z+2-sg&%7KTooH9A7L%FUP#gxlyF(22Ht36fyD)qW5nW7;4ih3e8W_+$mKz|K0n8Je z!fpi)cPC_k_K`+w!#?&I{K!ba8MYBPS{c1B)!C}X>5+h%!MtK`A@VU!kw&*60Hcw? z16LE_aw5S-9NQQjIpj;1i8*vH9ZcDhk*WTJjYd<8iMiHrw8u5#l!C76$W*1zlZloN zR4+~rpQ*gb#D|o!MK50Z`!km1yEgz{rL=bRi0N1>tYml*q~)m~=j11A^)Vrv9#G2V z_6OUqFQ>tSF!Oo9j!yx_=hu%tQc7C{&M{uD7X(+VnV8XL?1^O38DiN=HPWB$Uko;t zFQ+FSbaGxw5X$T8Ws65Bx6V`scg)Q*R*46%*no@k>XGn(7W8ktPM|zWu1bHQ{ncR5 zCOY`v*?*Y2BNjL8;2rI+Fki*m?j5@W2IBtbV-9&6oU zHjKXtB_d(Alw<@_a89K3ioa>U?(_<^!U05v{CqP!H=mo_TN^!;j%rTbBxJeVLi#1l zhktU{#+!aTXQJtAp$P9Zy_g>H(u1j@G~VCqDA&r>5y~~Yq^}HwB0(i3j1MFREPB81 z#k7b&mQ3-vZPbU8S;@rXZ;_nJq_{3qK6I4wwPp2EqW4 z{uZbi+`Q2N*3n}`N~DMeDEX+_h|K|@gjl$jIE$Zr&4BrDs9 zrOJ9O5JR1svxz94x%q&fcGyaOY;ajj6$+VLBCS)btEnvIM`ah#;Ut)nh%@H#ds(j{ z#60rL5LEubT^mpRcro4eVgUh%{1f|Y`G{SN7c5#V>~ylFTF@;EY%=8ZJAHsQP4Nj| z2*7&0BbMG-&C~`5MU~<_VJ!jBqO8?y=B%EqRspNsOF1royfEKsKJa2O5(-R$>HT}) z<@^yMg#QAogHR0OGZWiE_6Uj4Au3X2f=Q9c*S#f+(P99y5Mn|gH>%U**C`$_fI~uv zx9QM3fdpa4MYutLfQ?W9S`qEIlT8$VQXN4_2sJHcMo>?{Kj~M6$(v zecgnW(B(q-bIwJd-;kD+Lb*^^>u z&YW%qq`W*ix95RW14LCoM8EIBXYM&~vXy@E@VT|fKyWEiRiwQ;^HuO@3O1W3h}w*l zj72;sl(9Z*Nc82DKm}Z>4!31UO4`MMw=k>{g8O9Q#z0j$H|q|78|ym~(6(6MPtjH@ z?G++|J34LpM+2rGy7I{7b<3|oSAM1I*T`gU2O6uJjOSg68DKV1{U&5(Mzshy*2eya zH%p`Y6SGqIWC4BuLb@`dWQKSF{s*WGo{kcz^wS4l_oTV9tnmGt`x}6S$d_$S= zjDI+B!;(5MRIAs@t*s|gUYVm9-Yf2-eml!^RtAq3lljUX&dO?9KHQ`F=mrpcy?$IHYiq4-by|6mwb?-E9RUl`Oj%Aq@oY{DkmwjI?X&|5+NTv!=Vkqp6iJCz zm&yjjc-a&5^Uyg8f$XJ^Fb6qcQD_Ja~vkL!5Tm&EZ_|A5r;w$ zMd(B}-rmlXaJ6E&f8z@)S|hLMV7>PtaL9KoyWnTXh$NAV)sb8r!Oa9%_0ORQog|tMBw-#HGJRg*4=cPA} zzhnD~7OiA_5@vQwEyUnL)G5&=FQCFg;h0upr*i$ZWsk#K1zP6%rBTy&aJaVxwQbXP zv~n?c}IfSFU&FasGOPY;gPy8g(d~SpaFi@(OQH+hc!%AnuDfqHi zly{LE(@cxdva50@IE4wzG06Siu6K6*QYYeig(w#8w-=rEMpp&#yZHLGZan$5?P~fp z>`(KI9#w3>Ha<2}Wl8iqKbM-xX1U!I19R2W#knt6tiy(aGr*jo~p_d-GbKaYkBAnR&Bh_+Y7K~9-`5%1`m;(F(ZKA! z$b1ntXA3xxF#1O#K16!Ng%ei;3xkB6;n9ucL);*uMOx2D3E^9a)L}hC zcmV&<`6QtLNfsHQTgSuGro38zV1C#4tPa+j_BNNw2S1?I@3})Sl+I3Xh!>e}-nH>I zT3LVKSMFRGZzwG5;8T->Ntt1Q{q8LVTT9V9^ONy=mu9ChxSUo)V*vmz<^|5im^n!b z=EWs#DW3NVw@k+L(1kZLK>l=b$(YyuJBjr2NJ#YN&=9t zgyT8!7}(1lw1c6%LUq6s%ddd+$hsmf@V!YnlZ^9mGmVTc>lRdZ!|Vh zPp{hBqg6tOGD%TN>G7sba)R9>sj!ay^P|I_MoumTwmdkH6*awgI@}1FzfqWNSsX0= zAjwSt6LrG;apwET_7I3blEXxgWjE2YYrqUh!<)+lGy~Gjdo7#+(P$h<$k^^?lnRYD z1VyS+gyW>6yd@+oWP&9Q{C^dI<0uRvhrTJ*7rvhH10owW(D{+)?#)oY%jV*NtjlI` z6vxET^1wn%$sILYSD2Xu7b~CVP38lv0-$b25QY z2=tW7;p2NA&qv48k*q_+k&#(u?2c%;aMz!|G32T7qMBcDxBNMtvp5P9zR{lgVoS-W zIg1mJ|IJFKDTlGqfEF$}fmIHyKJ|4D&MGwyhq`%vK3{ikdsk`S5^_l3nXgry(ZynJ zMGICGCBn-=-VuycYmVr)%F=48C+cCjQaZHKS6WfeoId!eQ{V+azj2VI!Ta~PY2T># zk3!S>O}*RPev~Y);ymEsBJ`%4cB)cW2I7u9T4Rw9?NZy9m_LOKPl74?orrO-$cdzx zu84z3>I!yP$9j<61-b(w791KNE0h=eWWpIq4wi&k55%>gA2Ops)9AD%J`$D;fOR~;I_eeO0uEn}O0Fr<08v%h#;VlU=nrgr zX85m7^+sq~Q}u@SyxeY+w%JYVLtC2V)<|l&-WT5DiU_9XN^6TsTDXdjv9x*xA0xds zU`eY@zhJ(5+qvwgo-_pFv71fwdV3-mv!&TgNega!`rxg>vhvlfQmiy$`npH4*@5zB zx%AIUzdA?{Z}-F$7xgvm(TB$GYVL~*ip*XW-r$Xi)?+T49F9cNB|Z|*`5T<7VAEj_ z_L;v5`C&&gC?L?_6E|95kw@wrF0jrhid_97+d}aeCo&Dx$cP}X46|bEf_ar~(aVp5F0$10a^kpbBdwrJOWc!<*Y9U!=WG_dp zKl^Co`0M;C4sm70D~I7>th~PvEona0={JEJ=Xb8xqW{LFJE(LhO~5sXzVn8@zrS-f zBYOJcY`8ISWu!7hk}yHZ+wlJ+tNNm3I4Z8!OCrP!Vmo;0HzCO*Wqh1ywKk$iidVxS znN;7rHp(2nniFTUnSxLAAt&BPS&f|dh~iRnU+%Bg3_g4!M zJB$yb#gP@a7Ha`e5h5!tg}o?fr(AKdKN+{8p*^*$lBtdiY$nB3CGAWj6y{v^Y=-K+ zUSbV)_R{YWKZL#11`j3n(k-Z$V!qCp*q{kDfDYVK;_R=h#p+B7z?aeVXNHo_@T8K_ zDzRG|fA*x=dR-TtdEH#qmGlisC8aji-F|9c$>}NZg3bJR;pg{QET-38=hgfnvq4R2 z5sP2Un?+G;0MV7;+MWV;;`h6rAbSQ$3sQ6=1B|2+4S&(GP%>c%BF>ws4pRnO%M14g zyvYjys(w0OVZN20;R0!!+cpj!M4J$CZJTROJ+S-c97Y@&+X^zGltjCOYA!!fKDz&5 ze|RM?Ir?%64Yu~l8;Rp6j*Ia=rM|VLWPy2Qj>l%;Id%YYh!fL^pobX(Cj#eI#fcG+i@c3_9h-DUe8c`?!Y2fi z-upd6nzoouSpxqK&?|I#dB%r?UMp9AmbM7meeMD148_{eFO^fEMn*C59)L%TLj}Jd{ zCOV;(O3QOY9D_xT{K{eT|2(?^=*)GptUQ)AknT}ry;|fSiY*ih(~;f2gaBw_w{NU+ z&J(L9{V!7F>c}f7vMrLbKfkiYY-eFFQtQv{5VkVhE3T~&z}ikMLRU$BVx2h&T|M4) zz6-zysKy(CCb1?ZDh`VZZaSi7MumxdlQ`fK1xiFCO<^c4ISP<3$Z5bxbKpFOB8H5) zPS)_&Xa*nw6Yj|neMVqPjveF=pque@qV+gfn3sZV%My^hl4W^i%bxb{@?odr*2VpD zw=d>#aXbGeX6~yG`n!dQE$(R*VqpMt4`_|-SUv#2FD@6Fo%QE3dH*x--SO3v%LA=U zficU)RxUd41FbgO6b1oGDbKYoUSMvzcVqeRzWWO^p^0e98q@R<5J&qpjp79J`dDQq zX$Dz2wK92-3&|{bgC;vx;7{ zyKKy-kLdeLTXsoILzC;(xG5A#q-IlfS4^;33j^%>`o?Fp;<6WHCrZ*$q<`4Z5!p~& z77;N{0YonExcm$3o00!`2vx%`LoS9?ep>W8(WnigPK>oSdI(*lW=!NN7!@K4VeTeG zW5h&5WTZDUgOUhNgIBQbjKN71p*F!AkrlxAiTT+?kM9LIF#TKC6ZXzj5sx7qC1e%O zF}8$k$y{qoFe^+lyxGg&e(_&os1T))bs66A>4O!Dp3b!V#h1e5?dg;E>}wt*37K1` z4o|e7y#kikja&}LdkI$F9}P5sl_zGdVC9W(n?Co{+{(h1^11D|D7on3^H_PR{|2vt zl~*3Rf|bYXt%(j+UPhi`EsXuu(k+hl=Q3(GTbS9*-8A`x=^;gAUJS9PPEs#S>X<@s zd5Hv|_Be_s*&VNgG83mmYRqo{IrERY&KXrkNj5;$ki3B~i6vwS5-{QBMjL=Q3>Ia= z7ws||xw8^YFvf{{ffADNf$Y;^K(wJFlqQViXc0xlk!*aUd6BO68rztZ7)kMwXaxN} zr`hU>`TH#vG}$`DjJU0)jk#!wv&qZOh{vfb%~1Z!!oR@g1&JFGqJv5&g8qp zqDO=9=NC+EYdZDIMr3jmLP?C{!Bx>@g! zmFLPIdid$e-hDUJxP{z=+j$fc$=bo_;_J?>zE)}$~@yl zlC#zw<1^h(-i&_T3zwf{>sa@lu%GYi`ovGaQ;BElWHw8*>3RS33htgXi(DHkAZB>U zj-{_|(LOL-qLaQ?&0HsBO15>^m+3|=b!6b4sqv9zYFGQ_-fpMFx&7&$BC7qa2V!%j z!qt$$?NbMpjk`c#G8`K-oMS9*VJi8T?$+Bsb!B@_rCexSb@+$e!ga#3q%J-esozWD z5vP^jPQBBb1YL4sHfQ=Rw=L9Cn<)G@5x1bv`Ncc5Xj;D( z{L=0boW8KhZN!1*%kRDXHug#A#y-S>?|>b@GQDPGR!b()MNBOcHRK;`($|hjnvxl8 zKEs%ke?+)i6qXVFzf=i`ormv*7bk3%BzJoSsT3XJ7R$M6oC~;|VV5=?DY^SGHoR5# zMx=o&z@;Otx>n1$5N(eJBmkHC3eN+VB87MbxHPtFZV7w616+Fi9`@|T_VJA`zrWuZ zc7q)q?G%<08=Eg}JnE6>wnj$#0A(6L5JjL&g9%UU%%F{-9YLX0pXKe5O7>m<*wF%U zd@AK;7$8jBI3&mY`msn~AdL_6er34oeQ~phe(}1UN1>$r|nLwQ8q6Ff!f}f|X z7Q<{O-1S&_6XMjD*n~K}k6LG5uRC**U^Tc3`hs$|H?VJn`mhJ>)SKew(puIB%+uk* zZ5}JQ(-?t~vSZDGaQ)*92k28?B+#cA8WBr6hk*_Rsh9uh@-MOXK=uTC_J5kJCeKfA z8D0Yd?eklmWJL%9Ez@bdMBujhVVH0jahP}1wUOAxH?Cv9iAogBNYaomp6@rI-4Z7u zVk+12ngqt!p0XCrMr_Dr_lT~D#l;4u4)dS3cd2%PiG};J-TV(^@7UtPIGWx_6z7mW zEXK9@;B_)xKP?Qe{YxCffVI&hD`DWGqV1-T|F`VBF<-vF%VSAlAM|0O3eP*j-hOrAuhSK$)gp2+rFQh_(Mq`192AC?-ssSHBQOFqVVjM;aMqH#(4JD_ zw(63Eu>wyNdKj&WhuNf0WH$bvb`u10X#v(EYnb@(%VH46Ih2a(vb3eJF%yZgcBd!hIc3!~ zN?%^b6xModQ&OlT(H(vq^+q=>e@JOp{7If zsbpP^qTUNuJtfECU&tAufsJ97t)*~rX(D>Q*`?WrmoeJQ{n#H=b>C?E1A{jGE0z0$uEON`Y0x$HCj!m= z2?IUa;v(qLQih;Mo6Z9V#nW%&xK{*8W*XhTaK41rRFCKe6SL`HyT>N5HizUSkkjaw z#MqV}$Sa_%9r_Tjb`Q4SUF580q>fjn!^EGMFVDfBYz0Qz>$-lS>kqsB8kIfB5Ss?s zA##qxPGS(_4Ph?ONC}Ao!5cxJ06D#rp)vfkIf#TXo`@WAJrc1b*r$z>9$W~zQ8&Ls z6sA`u$2+Rhm+CkRvRUyHm;iOr7FI_93cwa}T7Xgzlr{>m-Mu))chXmc5QP-w;be>h z0)CF9te|iro=a4#S|N2Tybbic0^o&0=c{i-s_g_3eJ-yp>A|E!_79Iw z#wu>PXgTY&i`hoA*zNOzT^kUR9!AjIf<7DzdXv7zi5Alc%~iKgEI#|6oU(J6?x(^L zmr_%cteq;^MUKjzKeI)M@^0Ci6?mCBaOaxl@>n9FcvVu{|GY4gnaq~A<&Wv(=ZcSM zBVwv7cyd$ms4|>$mGf=8W*Hi)ID$bhVPTQajxV~yF_V+~+nn3Bn9pP+huv<|aL*JH@PC2amxs=$gmWo+)F59e$ zny;jcJ1i1kTivr|B)JvQZ;BGkPA+X9ZhuMA9HC5iV3z14!A%)Ae*}5CH;_s*5#~?a zr~&D}ify7hF5tBpqZip5^G8Ah5mq2=97DNU@!l`)C2br$C%7musiKX83zSl5G3?3p7=^94*BD^Hy?zyIW=*TEpU?ofs@8hq-e zL4to#Pfj=&I zS8r0vCS$G`>0(Edhg%gIufMVK%EoEx;lUcq#*o3N*aepQ+9XUc=SKK$efV2dkxedt3-+oTAlyyikf` zf||BigR18>iNLbHuI64v1pC*Q+ZUPii{)^skET3ciz3jhEsg!fz?Xm9@a1~f&v$*O z>q}k#4RU$)Rw%S?T-ysJ|2ql*fby}q8>^*zzqq=yQLONs+l}35UklO3ZalU);>C8% zDTN&Asya?R^Y1lg_%%-U;Ie04V?A5mN0g$Y2!vHF)go;W-of5YPVk|9X`{Kev zHL9kDlmnh{$j@6d{S)ctVQtq)E$uIO{h*3Mb2|Y~uqW`+?rmr%&{pctU(TKi@ybn(dyH z#U%!FjcA{ur%=CADqMecZz|foG7A_4g`s`!Z7#Lg$aJ^zvQMm+=Eo+UIQ)0oTK`h$ z?$K@DIm*?@H@wLJhK9Z9Y?L3mRU1rC^`e{=W&s4@$Of(9TcZ^rn)EBasI^oH#5@t_ z@V@Phc)@1pn)Rh)x$VV0cB<8Y@?1XN{(0v6(4|jz{8}d%q)3l1Q3&Idf-fj?3Ly{} zFX-_d#vO#jxzDIo;chZM3wieuUKvuXB&uT|jXbY49Zf7zy?xLJz&Vgi6UinQ^CGK))ym zoP<4QyVq&;L`umsM;`}G4Z_QgKLh>%8?h$=lx#`CIN+w@OyG0hj1!bSZnojTNo9ZveihGOu+*U1eq!|qjMML#iUa)qj z$J_LI=3mZkEX=!B=2q2`pq)NFQEV+b>{R>bop!s8#GFpb2|2Uz0C88_Gg82&H*_&r zNhsN5)D^WDQ711Xg~q-AxV~d~y|55vC|{};Ta#CJ91^%4tUPJAD+OhuxTa^tLp`3f z$LXypTlMDJE!wH^(+3qt8h|t9!SEYTY^~_fDp~274MkLz%{X|sXDC0vJdjl;i_`1t zxv{=5W{W+UJ0^>_z2U^Zq5d~5ScsjWFF&&J`xXYeaSV~qZxa1*k^CYKj*u|f`zYDF z%;aE8>RKimt&&g(qbHS&_Y)ir2$X=JU@)aqq{3jG1yLyWa=j4d>54X)s4`G^jb-@=RhC@^uabM1Y=}HS9|6*Xex-xmo z?kFeoJG2^iuzjd8q7Pv|C)-PFhsPS(O!R4wu#1ro%-t}tc;i1D%p6ArO;dNxjl{To ztvZKEuWlb+*X;}x9Q}G@`=QFbfBoWn`}PAkHpYiiQJY%3sZw;hETSGQt$xowqQ}2} z{=wmNU}V6@2kdsKyco4IPM)T+r#52m$l&Em07&v=S}-+(^c-*t!O51BRCcCA77NeDl^sv#*H(9?$C7R> zlU~7uTg~gG;mKLYSXqg*Qa~rd zKmy)fVG^v?zI?RcOwTs+&4FEtld+mPOQ;%j&kTlg5nmy&CKb07_BRTT{N~q7kDic6 zXXX>Zn$jmQTSjk?dK6nmPSBhp&1JU44%~L40+_^q5+Xbw@sB${7_E55h@| zW~rZXuz|Ad%f>sRAhY666Nx+@$y$zi)oEq2vbwfqyg9Pa$NgKzAHQ<;*?;(PArZs0 zKlc;IC*MWX+pnPlI8Z~>`|F5$(Rjxk*NbX6YM%Tz2}^!#fYkmaDfKPtM?Y!c(mn|= z48+84*jUh25WPI!UNYhsf)DqM5zD{@!BSj{5CByv2tI!7gc{^Yji|1 z7J?ddZ773o*;fu_h_b)7SjI3##MzmTzAR4N_ctR3Z+0_ca65YwmOW_t0NR2B!AgFl z?*-Ayk<5O zNFz8garPI4CpGUY#wUfo`fCkPVj-18C`7(p{N*<@-(pT-n(vV=kPMp)UqE62WX_E! z6>>n945t^?ClgdK1DTCD858NOL6f@SoZut`83|(&Na&s1IBq4F?)aO``=ja37~4SO zE(u7;9F_5SydGRn2Wy9TDhAOBId(B0ojv=yW4XBQ?>48W`2OftZL0ak$N%O-AF);z z4(j)MeQ8_Rm#&24?)jiV7pC@>BO|Hha;o1K%J6rH>5)J)y?r5A63el20drB_HD_@y z)FU6*?+ml{nYsD>k)c|Q<6fg*VgPZ)`s_GcpmW zNmaX3>03B8cScJ+yrVEpy}H1Eh>X9z`S_0WSfgmuN_p)XIn{&>k9pc(i}!fP8RH?v_jGq1qx9 z%V>(r%2FmP&+~C!rmDm_-|=+?vIF4^Xw3yU`<3-el8gG8MnzZwa75Ry7sb*H}`tuJ02 z(;dm1b{-6Z8<)?fVyx0wt4_@i99`KyvqR5vlH*4y8_)U$PdrshSUfyJFprfj)ET?Y z!f|{eTL@!bDI{(?pBYqUOSPo3Xt980*O5?MHh;+-bhgH(+LutGX;xFYa*9&`cWC!X zL60&Rt7m$r)6+GnJ0_m9W~Md%3l2_-`R!&;2=$JxrOQe5*!@G-N4vfcD?nOl43;t| zS%-!K?b<{ePzobaAo-rrU2KGzL?JdK&`yV43BxKz*eFZTq25eqtCP}qhvD5Qh>@{6 z^i`5Db5p0T1fe(!;lp@A62%(lUGZvZ7B7b9kavg^Pr7#qhg@hk30q-hpm^kQ#%TxT zJ!6iOnTa<7`GnKK)3MO#v`+-`iem98t{WE5%}Wv6?o6sAmAj)%AeV^nQ57gqk|6h~ zTi&0lX_=Ip_gGtlpJ z2PRv3dEmrt5B6s&86m_=b84?IJuwEbAV)uDw^=ja?JSCD28`#McDI#tr$tV!swRKB zTXgxkvgQ@bTX)SQg`Vfi>7}e^(_$xHK&)hDxpESl*AVn(Nzy>0#_?3zP?OB-;I{K z7#rluk{7*(UFR;p(-L7UK$7`l*H^o~4IMNj-|3(*CNhbQGOD_rbMCO2&{v@yh*WHm z!yv>JR05MX&sfHOkXm{5ffbrNKe=r8$WRBkI*Qgo~rokE>suhCZu4aNz&(@fBZ z5;2~ULFJd+fjvPJ#7eUy8@V^V&qfaJz#TPy2r#x#dglMivvxD6G_YueNH~KAHJ0TY z)>x*;zxbB&uF-1I$x>8Y%$jz!zdyL9jGf*(-d9nl|8uFPEEh;zOE98;-+Uk2FuF)k zt%Kmmv6d)^;q^Ap)kbInZ6dn3nbKu}yl)sS(iQ;y!*SZMHgxA$Ou`zTCjOBaJ17nM ze$dI#$-)s8+PqFwtV$9+q&h%X`wV|BiB;KjOa?xeTSfPvX7_Rc5Cue^&&CBr(cum8 ziBw4`2pWfZU7N+04e5wTfd)6f_oh=f)$*l!JW%4@gWc|!ur1SUEhXl(x5hG7IBR~i zP)MZOP$o;yoljD!V7-&eZzEpHfZt{{`?GCO^e)o^5#-l*xt;eXmPb(a>o^SpU| z<6}KpD`y7Dbj&I`LyhQJKulZAqBpF$GT9iQN?A)#9Pitn1T&5&v9JF^p*XGvt9`@M z5j8r~ub<1e#K>B#Puv?xC3&H-C0vy4!Jx>5WLER!kQ{7Ld)N6yEac`q9I%6V*E|58 zbJcJyBWI92&X*M2N>Mg$b#Chz30)z>JKA3|A7U$AZ|~|#$p&&D4L5|yr z)C7jdEUb|Or3v(nacmHQu@E&AH4Afg}>CkfgufM;gXSXk!Gl1k{f0BQvvV zrx_K}r3e@v8V<=o8Vmu|XZqNVY~B}3mV$Acez4p#&;%iZKZ(98?gz8<``w{|rJJXl zzJMjM_%7WOm7S=Adl@kR+vh-#IsX+k)oue)5<*4S1(KedO>n^QWl9agJuYg<>ka~%DJnKWVCu8+1@=`5Y_Gs&uz7mZq zQe|myc9BVDMzUiAG$rg9*gkct8rZOA_s#=gz%E98K6uPY6#DV&X3JW$H#8jyvFI43 zF5lihX8w8hFHwC*&lb~>lt98wIB>)O5D#{W5pEiWn>g)F?q4i62?~g~uq%*zic&`N zma*fmFbNZxAYt`mgo5_q3~2}>K?5EFR6(3+Iy;@xO&^8G1T|R<#iYpi_+)X^9dov( z0wEhGsQqGJ&w;dv>AH=NZKJl+LU(^g_4*=1kMD|C_U~?*e(m0NDA5Q``203IYYEV_ znXUFmS1O-9zb&&o*AhFDK_1v!CX(3+$xtRwx<6%`+#=R9b0xvy3%ToMtx&WlL^&lW z{&0?_Fby5iOl6NZpJF&PbcA;#rV>M`sRArwuzFxlo6Bq43m2odKx^sFyDF)1b)c}G zj+S;UJ#lWDURPHNALv<0y)Rl4R#`X8ZtTjerBh}a=!j9T*r&E8fk51?q%)Q5aBq+Z zilXkz9=Pe|(vbt7T?+O1w4kjPxXL_i#>hoh(MArCeMen>qN~UHG32VY0(lC3-#8ay z2M`Nt)Fd#NL5dM15+iL_h82XNgaIX?oRQ}4Z~rl<)_vY_Kq>Zgpm0^B!$~j5&z4f8eUk zBfxA%=@4-XaX3J;z&dqy2-eInWzco3C-&Nv^(Oh1&XUIk5+)B55cW+G;(6EZC=w14 zD~CT<%^Y>2vu8@dnAL4ppeYm_6X~PNL7lZiDd;O;%1;`g-;)j(U;*rCpYw zz;2J~%H&9-;#0CrJ9w7acmC2wX?u4|kzz?t#g}#Gk~G7V`=iU1&z)Ps1{#rye#5e% zZIPI^;I7m2EkE{$D;3F^5Gg@-o=^tf@k#aJ8$X%tIXNP9D+?q0)g9F|FXeip(a8*Y zj`*T4wGhm^Iz-Z@IH1#$^~gjzs=B>;a9F+Rz`olt=DYFEYj#O?vNa_}ta)eH3v)K4 z2dAPzD;a(;qc`kfYmWH=wEwMLA22!z0QEu^6w6PiAq@5!Oc}%IWQesxP>>-*3|M;_ zhK)$dkP9G6Zutf~zHINnrb*V!w85giUh5^Rk$>kG^ ziO?4(Gja?kkGO(cgM0uxdyLE|+wzHP&@HacCd4z*fOLIJtx{hvn{i_j^KNF{Vm?**x z4^MGSL67dwXT!d*gXUy0l8C7pp97GHn3oY(YGI#uJBAwdo7GP0ONT;!B#I53eVKUktjVb*LsrxTsv zmEts6`_4qG;R8{^#UYZs3NzHMZB6~i zd~|F7up{8vr8P_=tRC)FhDTQWeWk$t@knXp%;DWS*a%o^5pS$IV%8bI=zy_vtzA!;0XyujZtij08o2|I((@(?DZtY##Whf^ASE27y%iM?Q1)yCt4_=yZRXoKy+f+iic5;Gt~VL zZS)kX8U zOAinOVp(d!fZWaUhhab_3U`)gC!IcR`66}WYcL>~-cZX8DnVKIM9$Rl#!Juks9vr6*8TOjTnFWM7-P2 zFd0uSn*!p60aGQR0Rb>o(OM`0#ES_7rmAt`X2xKjVtedcvaMV=B1;E*D)0T102-b?4eYI3q6TX2$*+056=T#~+Ic zjZ}E3PqT9_3saw6(ry|?HmMR+7;ieEZ>iMoIQ6cd`+{n>x|kF|X{Fp=xDwiNWX&-@|i?e4A{iRKcg2F(RFQSbFqP8oA-FsM*p`am-U zJR&)hFUM{j{IduCHL7^)x%OW^$rr29Todz@A6YB%-fkYSAWiW{v?fTas1wERTRZ8s2Lp@L-BJ+wu%XN%8o^@)MatsV=yY{phU zwDPWp_X4Y{;!mbw4kdJI6|V6@hbolDvd9kp8<+) zz|wFyWMml~EcmH-FUxm(O*8-MrN@5HBmeVG`1sFbt*=2JhH_qkA4bFMCi<{oWDO9& z8fJ8us9DGD6VD9q-Za(FOR#y!A$d9C^GP+C)G0eo|5~4Kxcry#_lO0EyC;t}8l~`s zgt(eD{)bZ&Ij+g(C)BW>snw6{J@Lr?)o?waVQCTo#=J}B88tA{*mC;mR~q8SqA6aQL*>^^WSwh^l6nPiRX79G$sWb2A|aI&?(_@bFFy*JK^uL2Eby ztWL&Z_1LI#`&dvK&W1oP1lUfmH5MfFf6F6a|67dcm3+XXxSYto+tRT>#6-nhEZ5jq zy6_AC<;DmBW54!gb|5+ zJXN;3UKB!v7Kd$!AiU_8jYU-;dSqh@rC7f=)^Iqzk)WoU9h#K(a51=9^q1Vb@u0z9 zdZ_CNL6jo-z7EcgA!ImG20?blK=;6gG$MBL57Yo$fkwuI)DTHc8u>r6ZAm&72WG>Y zZqmuSIusD3s%hjnWcu%O>61_G{(f~*^n~~ATut};@{4P6@lG&fP1TR=nUK1D^GmZ^ zTd^6z<93V;dhN9Uvb{_VHku_r`?6!Ka3brfl@kWaOc5J+(ht#_G_xTvq8 zR24+lth_6w5Udc3WoT<-RbZ*4nq4Z5SM;>T*gQMN4$g0#SwEx=sqCe{wfyt?`g7w^ z-8ajIfTK3-V5S=GA&t_Ez1%` zU$HGaO&lL_lejtR+*i{hM|YF9X}6nAyJ_~{Z8rUTY`Q(RX}jBOnr_;}lE8hw0ja}Q zVmWoYi4vOqAHLf^+;kQl`6r>bOinO9@(_&>d^KQn zJ}N0>$U6&s1Sks5ABn?8&nDUl*r`u9JiMhRU>8e?ix0ddY)whowtu+rlBXzu*s(k@h zH1Fx^?GhufX_}a+w_+IvCQUIvf7PNXIQ1BDXd2G^hb7MDazxPl@LI}4VUzaC*Uz%W z_TMLc{koW{SBn+60vFqU(H%~OdG?-KJ`R-_hSOX@&sFcG(y8XbzWRJ$iC8by;bps51GB^u#9ccfNC7PjuUq)(N#R!A>SOz(L@b1-+W z{OI?eWjsEsMsv3B(J^B_dF}Vu-PoUFo0hRRuUWn~e~UD12z~pFOLTFz_~vc_6?)|p zXW2PsGfby$ScJOw&0XZ$ilHmE!u*eoHT;+Jt`h%s45;8A#r*dR|Dyg;m%g{|{bX7@ zwzh@&5c?;ao5knSejD=b^(+q5 zL-LCoQGvj=$nZ#zLGVCaMH5&BDV_c=HV-HJ-QhP6hQgZAT3n~Xq)8+1U0*q-BTCv>dmbqG5sb*!0<|<-P&+5LMPqixL!FarQaxfY{ zeA~swKzRlR)|{O2-_bP_V`H=a+x*s*OL<`yaT-{6`|pf>cnef65u-^5uoI-;%*Dp| zA|XE+GwlE2Ixhc^O|Z%h?M+$GqnsyTCY*W!fwpgLlP8$Ln7T1Z8i7r3s1|zjR_~Ql zrhYqgzdQ4v7OOG;iQX#oLeC%`Kmx)<`~mQw`GFnN!0z$4c=+&@i0%M6hvfY?I0VS# zjHNL^KfHRR$iPaa3H5|MbLsZ_@zLo+pDm35j-wm{%c~Bl$KmC_d|;8qw3;`t6jR`a z0WOc^t?pKX-4Tc8yW0Wd=18r!JAT-$I9^yf!=6OLIn#QeRjohQ+&ep0FRHB*OE!Cu zbu$nD%rD%h_wC;uYz;QHfB5idv^ptI6_a~arMKvt?)w#JUXU<2N506ieE+e^k?>M?e$heo=iHF$VKXv(id$u$Ve2H{D zERvNMT&RaUauz^T!006W2EA!YTLJ0BDrui zIFk)n<($W{W9hL%QqAuf7D9S}*C(PXuWE^a>C4f2pHg4&9?!R0d?s|p^tRR2_V0~W zL3^9v422#-9qIyNcoeesd!K3bD^^$ji;z6k}D z`E5zN>`QvNuuxmvy*=XSC!i*KX6<2ChMov8bQVhn z(-)c~MR=!;UIk854~~~%WI054$Y6fbc<(iql57REjZw>W&Lssm#i)sq>}glc7YQc{ z)kB*f;Aqod4n>aEueK(DX-lexCX;wX%BUmGrZbQ18?SpZ}-HBPF~JhL*~=jd{mDs2pz+ z)(cYdU_h@ApNvTJ;6&k)LER0A5TZRkZs!N4=fMIYSCJxDk&2qcj@8^*Gkf;G4d+To zpy8ard0m5&?2I_9BJmP%gQRWFbN33q=vB>ZSuG^E>Vvxpj}>+zy{bI=QDFPK`My}Z)eYg1%rGEjQq z7k2eOFNe9xd~htI?yg;==2tE~W*SvmISbs6#yg+kiM2b}C47ec#O=uoax55!w%n`PskITA3|pBw}<1QvXXaG zj2#3kF|`Yv?*4&EvqQFQDIWR2M=FO)=Nw*NBVBsw^d$%6FsxTb>qk=4sSN+Y$=PK| zKMV0kMu8-r#7}Bs=s@WiDhxi)iCiY9b6(yY@HNd5LIj}KKDV~T?7$k{vFRQ-G@{ld z#idbT5&#n)oBUsd6rAWdcMb<98Vq{qf%o>LdwPv^qlj~+@yy_B!^W|O_NZ}N(A4fM zrs4KIM8ix1Yj3Qo36F5foQkaHqtZ?h1W&kaW)IIQ`DE{=teo|Unilie{7 zi0t?e7t>`-F@POd%WU_Kl=hr*c?$KzpL*xR19k>J+oE*Gd*B2!ee4_4>~~IGd0YEk zp)9ZH{ZrefT1#P_uWA-}iVEQ*{GrrRif0ue9jTst-=*5@ z-bBvHEetn?>Idf=k@u9k>|9XEU;g=gP1E9W&gZ;;uf)0eQ|A}wQnILs7zCE?!xZ`Q z`%IsDtXh$&%YpY8+9q;iHPy7sk`M0*@MgScdHEHQN6Q}L&XBt3E>+BoPWpwUkmc{}vy16}g^>_RIO=yKMni zMU&$Zw}mEs5Sz#|XoC!;3!7(GwhGdE8$|LMZ4lPQg&elB$K2)q%@3qhs}Qd1L*8sw zm)veb8j@ofG-Vw9!J_J8-FNlByh2^73A0Sh9`?c5K9m6vBlkx7NibzLJ-7BYZV~If z0}6%@cDR!S7Bp6r1Wh%KXo(vRK1uS(2y2M0l=V0dd!S zb~vag;X-zE+2!k!#AIqZt;MSRZgFrhoJ$ts;dnuP-~+d|u=H;|*#6MylVhj$BO0cZ z(K(oyUr8A2ToW=Z^3D=T>0z1 z+q(Bd@YEgf`0SW>a6kR@t*kJ$(*7HNJvCZ~?gZ2VwqwScdY7@>1DxoPd``dUK{(^f z)AZ){Mc@9TdS)JV($bo2ob}^Gr}Ng_r!W;~MB6uT+Tr;ozUs7Jh<5>cz1GR+;avfH zLUi(P@U9q3rJbpeJ{5UGhy05x|Hky-tB?3Mh=0XZt0|uNR~S}PfmpNSUlBB{rfQn6 z7%sHLH*&gP`A6yiv-sM>ZCYDe`#AG0#M;LYX?-x}27eK?D2_HpgV)o9&KnQ<2q7aD zDHY{D$$!alH_$@pBpUM+=}tR`R8dA_f()7(EH-2vq{pX{o(4-Q5{x?f$$Ssf|8jG* zHVv+(P}Q1u7eeX9R7I+%54E6(=eB#S^GZE>w6Z6?d}yGdH;cvUzI-k|P*mX`6wQ>v z)`*y8()D?{%foiLBVniN(~9Y^m5L5*>ppVmV~%5Xi^gf;%U2#|zW>(t=lf+xtdgnv zldx(q?f%wkI^l#$FZApd3ZdG?v164NPbzOcD7%B+i2bfazuYH^gUOS%X$Vl%XO;?* zH(m%&<+essu)m`0iD<3nbWyf^m(raIV2)6hb+w+Gtc04&T54olzUlO=Jiwk9u1U?o z0Z+glQ2Yy6=C!3O|CRX@toftlbtCA?tt_0jzHs21AY>58#Yh#TsF|E|GlGXf@EJ6v ziPkcFyp60ByJQd+p+o=~P8dO*xW(0ay8YRH*&eMIW3H}DARUsDy7tzk1W)hjEqvu3 z&z<*bL(d=Ib$Ido`7Pgm>z3KnnCye7STwBngjyq6oYz=?SHQv9O?l7wzkwxu7s{f7h zCEYQ;QL!t8%4Y14ag?KsQDoD$%12T=iy!`0b4Wx6hG)_(?m{)=#+XYyG^X{-q2g31 zRS`ZKRvqaB5CAoYvenpNB5iXRC-b%g-Fk_;(!J08pDtiX2bGsn3r&6Skr!8YK2}ZV zh6jh#m4#!^S1ZHKr>$X9ron)w`+)w*|EX6jsR9)l61(EQcoh{^bw_`+mD6fAlQ9@h ztsP%8vp+(;x^>eoq_EnLHH*WY+(-y8WMdpBa;rN)pE2WPWVFa?(d%FZB)I4gzG(KJ zh4FVq(G1^juNy{i$Wdj%DBdD^!ff$$H9U#g6MJprAbY3p9v;reWVX2d?!k(f$yK+E z?&U6jiTQ5(KPySOC)}l>RRNo~i}jPouU2rx=FRFfDmXpp4@H{KuWH)#UTOcZS2jB% z+c@;5Z>tO*+oDr~J=1f?(-BjfqAs7MyrN;?hWrt=&wH@fyEiRiw~aEiQp5FeQKC_; z05?esxIJXcz2pm|>q8{VL}d>hB|OSV&Jp1Z#+MPnI)xu;ZGc2Wo@w?yS3cCLO2uY> zj`z?O4}`g+@jk_oa|zr?g`>t?MOUpDZH^RcXFm8d2V1s*RIZwk>jGopI9k?+Qu3a+ z9-W(kE|{oD>Xq>e>uyz*jLbCecP=6ovQ=QuT(fBxmK%q{E@s;U^QstM|-mE!22 z&vN;Pwc#^`-l|phJLvZvoiF9px)KZuP9PhC<_eUA+|u#KbzX@Cq+HE}0`a#@PmC`* zf>sUeO>!UZTw67N2Iu6#8*mNdV;jH*!6Q4!2Kl%I+Q1rgkd5`bLUUy45Y}&YPe|9{ zdd!1jKW3cu? zt^S=LS9k*ux$+^y1uo(e_;AIk`hC^-Rb<2$g6OdUjRX<~GP3h?hdNg-Ik#h1_VZtE z6&&e26&WP+*NKXd5Gp$cqOClfY)uE(VG||XvjLmjZLIBb`_Gt9;`|-NLX%5I%IIrX zjAY+9amMRtl#NCqxeni9NsG*Nzrje%jcn%Xoy51}2i?snx;H+1dco18XkK6T$(BY5 z?`v^xd9Z>}uD;Zmip%yJE6mrskCU(bJ zTCT;qywQl_`AjKTR;(^gb0?+2AV1Dp>}K5-fU{?AE@J08rz@1{i4MmySA%saThcd= z*cmfK@*0V>wOCa!O<`_N?lZ5RYrp-``R-J+mjY<@5X0KKZutg#7HM zzjD7~;bMTuZ!K@~7Q2gH=jFFkj}l=IzUu7)FoVx~z`yzD5uk}vwfjg(@jpwf> zkT_7$-C82Hu~MW?BRQFi66mYqpLDlZg;X#Me9-J3x@~|j{d2NgkHg`7LyIn`wItWc zZ(nXYj)@^_pV67A6#K9IgAh(RCC=!~C`r5hr_Ox2kn5IrP-+hKyXa2p`+g+cmbTqA zPNpia33y(6uOEeK_omlXwF`rd=$IJwmaPI^A0Gh(#gh_?LY7OPrtQFkWvFtZX`4imQFir9QWi zrV9>>+aqB9$zg@yqsaVJ*#U)I*>2>@iv&AnH+qu*;LzZGLzyy3y{=~36>t&Bk878O zo$mA`4=j$34GwMXW`C*-`tt49r{jzX{lTMR*wQ)p)k6QDU*C}oaltp9SKpAKujU=j z&4cP+nZ^*)4ISF6eaNNuSB<#zUYug%1tTCj#>Viv8P#$McINBjn8s8K!Qt^rk(Ua8 zCqV8~#cSqbdJRzwdcBCoOUB?^ND}ZyLzJKXY(Ro)N)gP&NFo`M1Mcu<{X*~U+Xwin z-)wir``lKG%~=+j$F|iV>l!Q1gm>~TKj$>pa+nV2>rPu~F<&h84G6N;>f|Cyy;QYi zgS;HDy`jit3v_EW>fKVpEV(Z~r^}vnJcKzZi1>QsbWYmeHy6t|yVcFPsm(z-?<=ZK zL$QmdT*4g1go+iE6Onv++E!O2EtD6yyfZ2+^d<7i)DT8@iNd7pz4frvX!Ln}BZeeUpnsW5lt;UY9j zU#FH@y8NYc%sU@qCW1N)0ggR-H2c78OjaNdw0mX{ON{yR-PKhSzp^j0Yjef&^2!Ck zjh8kxlI4{x&#k7kt$W1-Lnx~F@OFz;O&qK??=*_4Y|kAp_^D^mai%cm^$PQ4_M7N8 z6E-BR(6GuNr4yqPTpn^%h&t;^8pO#DiWnO>k)a_*k~>mI;oM`S(dfRL(pXKv(cu5C z|5}GLf-68u41p+JQQ)Ou5(h{U5!t1`M}_M}h3fMU>DA`4*WFjfWAE8oN*#c*%30Ap zmv)v?@mylmu7xLeKbTNY%tP9;KV6X}i!T`&-jWYI7I*z~rfzB~_q z;Go+^alA*41X`u)W6;Sp6&iPqRxZ}=9_ibho8S|^jMvW2g(vi-tYT&5Mk`q>9rF02TO|?Cdm)UKQc;cfXqM6sT{$@7&?Yg zIoVSa5F~>1704@#rh-8QARW+7(+hS82A79Hi`OVrI{m^8w18u*G%+U^trEvIqN!4? z99G~(X0>@??;QyRU~pLsKs_U)>poq~#?!qF#}CSL`61b@>PgAsRh&`cO>PS~9AQ4= z^eF8Ezi`}cvq_3qcDU|vcI$p^E_dIj=bs%Z&7f_r_;VIzNX?Fax_yz8bZvUymP z9!z+=9*5Pu>!oTA`o>C;&4RSy;EI)q+wZodf`O11wj~<&X&@Q1aQ1|@tCFq`4*25~ zymj?NA(XK&jMZ&VM@$ds6Iv@~6Wfa;r>v?hbtV0Fdq50z3zd<#s5^TH^gEm7+?1)u zbUf^6B%+-22>Z%EGSBeth!RipU17vde@-qd=qF6UD?87AcGDbU&bdv`KoNilU36A{ zomfSVz8T?$T#fbUbJGnml2G_ofL(>VQ-NP&nmi_yKw7p)lsGREB+?opu?$U1@?Vrz z+)cNR{yuG&JX|c(o_+jIzg<*(vXdJqt3`($w({Y;xLQwtdR8}0kkr#3Btjz-LJ2? zgL1&d^Zxc=>t1gePB4C(+2iEO6=5Lj%tm9nv+3#fWMb0wJ8<{iQ;Fe5?D3E6G!;sY zLd-9&yz-BSs9!5r99iquxv zt3l(A9l=iBO82OG+%s~f=qRxgu9-X zXyiUOAM1J}5sN%3h>-@)do5nAo}oe-jLxnNbrG}po=G1(wK3FXcxr=_v+frE1R3fQ z9X0h0uK5*=cE9$hGml(yEl;sA#RivnOpmc<$-$Nb^=R6d?lRh%4TnRLFge6|9IV?5 z=1a=-?l->tXKuFiIN!}p^W2@#VtRhl$ML=sFFRu{3(tlT`4M|a*hfU^=u?u1g#e=l zBt@jnITLJoiK5%p=bY#xbe@YS19w-J{Mt1gCj`2}PZn}Q!C|~#op=?cMK9B9cgR0R zPzhY8MC0ySxo_~QU{k57`GxjFE5}1tI*<~)%rn-i?w>iF?r~T59y+zH-qfGDojyiE z)M@U{j;K>+`}AnY6EkF;L|P27hOE=zI1yJkydmp!sh+70!E4K{#zHUwQe~B=|AB$d z5-hZDCbU#roSRBwaNwGVlj**0-O0Gxcg!D+Ih9ydplID6==K*M+8Tj%ovf< z(4QtlkEjlbTYxASR}W7+l4p`Nkon+Fjg5MRh?$v)E}GH2MIVbaugDa!fhz-%$F6J` z-IH$>=)bt_{f*3UK2WU4HAPOjy4>7e9b5xC$XVHVVS093B<=Q?Yx+_x_tJ0nFHSc^ zKSgW~XL*{E)!Dh4zOV;+WAWDJcr%ypKH7X~?=xps?(C~BjLTaRUs*CA-GAwHs_WqF zmhs_FczV9b6liR8}_gq#GR7C1 z>41}VnBDnp&B^I4U~b7CeQ(v{H>Yyr0SAOPAg^HcOZwF5{(y>BB0ddAtiH6lldLP#P{MtPGUfhk3l2`p|HblCnWXVu`;FZ8$5L5}{ zu2r!A4E;df)I}P$m+g!9LI5Ju^5)wI%3;QaejFgjtS>DBY zBAT~~am2y`7@&;TA?vaRS_Kkme?dOhd}+@!51c#RUs)Inj-`gqvL88j>C@@11KX#@ zhYmh9ww#VNwmP)(sGb?g1@b+mdM=i8+V<+XJS#(Q*_*5;j#e@pb>TEjBNbP~55NGD z_;wHH0b_^o`6ZWxeohDumNqIHQwvd_7o9QDR|@xz%e_6i)sOaUDzz;G(_5P*9@X_p z&Et+##96(x`_%fb>1x-?N?0SiR_)(kIXy=Gp$l`*&S1ztP0q`nM95o?ruRfSjpZ$t zV6eYi;~Xr1>HDOfe`M`L>?Q2$qei`I1Rf$Q3dKevr6#xw+2D?f4BjQujUhjg7T~!; zUNTIBlAD2MC@vU&(a1dvjt;hun3zRPm|MmRM>Hc4+05zAHex3^QrR*+2F*dmZzoez zxQKpw&~4*`caH1Z7rK&^>*vqSz?~Fy%V$6YdLM`VGGAlwlkxh9mW-Ax`Xl#2y-fJlhb`C550JfjX6@tb zLG0DgrfKpvkvhjiHwVZuzab z^4IH8xW_ms50{^bCw&|n3^%&;qSIq@x?!&_yc>YD=q<MXCzNh+ITm_xPx)~9=p(7mY+niN_?dsWd_lV? zRYEhBb3 za^=Ect66RhYeW6Lk(LW}^Y-+6k2EzQHf!n!;ITOrv!TflRFZ#pn-nV! zo4$dmH@nlznJ@nnD5VX0Xs0J8yQr_9;~iG^O9wCLas3F0wWs_MMM)KTC7un`ZK_Of zwFZQlzO>--cRxYiKnCYvm9xS}Hnl0gslJKG3;9(V*b-7jqnBl{>rlrMGBVkA7PvAU zFbH%;Ig2Krp>2WEOESOv)L+rVAth3ka>KRAqB=3J_r=mVf3UXo&e?^h7a#fMzr8Ya z#w=fX?_-aA<>l6sUX>F^7wUcUXPL|AU%9fk*;k#6Km*Dw{k|7o`u!tkE`Q?% z=96dtlBUm&lGR9WO>0eUPVNoe<%w1`3`z+cBNB!zyj(lV6Jy)XPeHftn(~CjjpS6a z+AVg;=W*Kq^vM2WdU^*&cW-x3Sn0n6rE9bf2C=^w-6l^!$(JI&e#}YShvS{Pnouur z&0mFG8Q4b!FE50p)}dG&iH#{UsC*G%oM2Y~9u29V*Q^<7W?sKwS-+%+8Lv&UaP^p0 zs#QXYWV6|xE5E<31r@xs^#j z!uTuFw-9#YHwJ4QMX`c;0z~4CXw1BGoh_X7xyE&b3L=*>JqWgN{usDYuVM?2LoVea zD(jrz-V?m#h<&B!)e)bOB}%qZSMI$&l(+xJCcAKu<6+4xp~z;;ILJY{I+QMMo;`dcexXTu3Psb{});*Uqx8vje$&MKC+e9+tOCKDQ=! z&*(dKwYAtE>51p{rk2zyP6dOKc9(gPnhExm{Sk|evU&pUWG2(+k<1~r+gbGS)p7XK z=P7ffmaBI&JZ}kl+%c~lzdX(StugyXtv%8Hp3z_1Mb-}wCZgk2X)goR0e_9;?pL)L zq7>l*cM@{ZMT6T)qoOiKc{=zggOZ3A;zlqfF%^a!WKHScjz@E9CcZa}qZ&}7PMec; z@DN^zRf8(WPB=@0Ev4_oxR$XvG4!BsQ3^tTYrMF_mvCA9Sw(C0Z{aK3-oNY(=@8fa z=1Tj!XRiGFkMzTC(;ehQx4Fp0X4>Bi`DQ1IdWmuf5LGC+G=X*5qLf9B)%oh&up4k& zrXH%DaD*L0o=l$*a07Y8v;a9 zfgoq=0*NXqct`>qC(DJR5{~TnV>>~dOtl;T_jH|A44zQ`AL@AK%|P$ZQ=t7csL|7P9lTV(k3>p;Oo6 z^v!sbvmc=^3CF2>38WUc8u&h6)8}c-kwwS6Y5CVJT27xjZc%uBLDHLwmHE2M6;UR6 zsboO%dFp11-6_S9!r{)oPF09p5JjPp{@zf~ z6H$v-ZwWS`Xu7s5)Kj_PnMF#}t4iPEnMeS(#=%tJ*=5VS&Rsg6$u5%G?^9y1zPx!^ zi#AdIRa$zcm6HqAQa!8Yc*`C=Q=nwl$xeQUM?wqNbb$?Vp_^AXmJ4e?3fN3N^}(?+594%V5NDBU+s z&!X0&ox!lUec$ctwO%Z>SK$&A&$7YVaThAR%Z=Q))(q5jl#O5Sl#K}LS_YmV(QvHg z(?Vb2w32qJB+w>0?9vxReGvUO><|3f)^;$*5rg}|k6rA%j3$Zf5Ftt!g1GEr8l;4y+T2aF4lc@Y>3j7CF* z8hA-B0Xz^Ij1DsT!lVvI465|@kl67(l@!+1tZSS2NeQIoJen201AU#)`{-y6sJ#%sb zW)O-zQ#n4|guKmAG3vx|9dx=*q!|CVSHw7aEM$oPhbl{z%OY zLWV6C4X}^xhkjKhWp$eE4PREC*Q1n*9)U3{ zXesspPxkeRwav`8aprduK94CbT&Lv*{16$3i!u)IhL+pwKAM>Aef5*ce7pTu@kl9M ztR3F9{1C?4Yk?H+jl){@q-0|wPCeQ`vi#0L__{9SgW@ecn}6K?yVpFL%*rdj8WalkCotL|A@^X?`@z`3@%wyf=pfq%v z+z3OE3pp6LXX^vdMwQkfIT^xtBt&r6QVqg%DEkp9NLXgrIB3)WkZ9A@BJe=bt(Zh8nqkZeTTQbTGmV>VV@pmwD7H1c~k#7_hI{Ah(;Ufu$O{t{cf43*3 z%jemn?LRhoHF%NawMzRAvW%FqA-M-e=c=?LJXU0WxcbT`>)Y@e2xdcUONI(RjmA8` zp|!=Kkhj^Diapiu*?dFp!TZceJ~Cs?fyjFL@yO+)P|;G7gUl$BkgO7_g!YRF^A4qG zv-l@Qjrj7pwRbV^M0~jjztj!XmE;u2V2wM!0lFF~#ZN+AQS#w?u7R#VLptUK*F|z8 zMZT8Xknq)!CpJY>TlCFM>NEKIHC#^IkL&vB|0-E%bNnk5yn*k`8s01CR%; zyC#rLB@HUXOrtD_l8!RI4WcCL)hxYUcwhh#*gC$IgiRxnz3x6U2obcABCIE77$P(S zaYrHs7(b5g3^^)f3XZ;;bC@l~I7az1k=CA->MT?+axSYq;$$h0+2b0Q1lDF%rv34O z$o?ntx9=M*X7u=IS3DU)q3YMgBJu%=vpIbBNW|%NVH(kz58OR}Lq5lIw8hE@QqXZV zr{jdMRFeZFi3>=2`#{16)J$;Jj1-R2(aOqP{;pmV;=JUvTJ3O{jN#F4Hb*9=BRWUd zz;P>jN4j|q%*?v!-_Df+E{+QNi`@-0yMn693t&yxqCU-m7-i`n3rZGCc zZozwGlBx{D{N)>Uhcfnlt(%=@UV%R;USr~afL$aotg)q}6G`^dPtX)RxTGaRDgi?Y z9T&HWTMB5F^hfc_QMS{UE}&V1J;$GbZ-H2j$)Iu&ZW=iO2EIV*g)VYn;9*Zlg;6Sn z%773C7@7dxai*Hf#62#rE9R5rfWwzAxn#xPsL#*2xYIJ1&@xl1XoIu7&AYAS_4n&Z zMNaUmCk7!(;4J0EVyWg0OK6oU4jpdeA*4^b+tw<~!+d6JbKPpG7bg;PeMeMuErVkN z!+Ng&*C_Y=!m(Z3hq|~xu^yb%SX;`Q?`C^Bj-bzF*t zoC&s`8$Qy9XpvB;lIn<-oQ{y@wJEV^e`WiLRUpg4_+o(PL{BW8H(lzBr<`bn!M7n5 z&(uO`?>$vF%W7%N6pt1>FuQG?^Qx{drPJyIL$Zg0E$(YP08%a9We&Udbbd`v?V0RHFA?8B5mLM+^Vs6J; zD1lAJBn$S(*dEcivPSQLkPEOyq*Fx{jSL(f>K6dtL7^Awx42#66 zIh=J)Fz4DcoKv<3VYw$%)Gf~s4P{)Cn#+0|flwmsh{YhEYGbbq)RemsQ7~5lE;ocn|EH2K; zDZ|pIg8OK{8dnop>v~|7yJaJ?)`pG1n%`HrEq{~9>JIfP5D+rn$wxM&%rV?KGTR~e zVWu%e+ONj=*ERfuO5w7sUq{dcaCK;c5e$ewd(kCeeR`%eZ>CR2q&@UvGqSDV3A=ytwtnt-}Xm9H1CEgHE5->T#khjg0ID&pzlO7c;7F+)F^oUByFHTuVvW;Y-IQhL!W8r($VxiK0m8xS|Sej54c=QHlrAi6bI@0FPB4wHM8I#6p=cXsYo z1?fwuzpvz(bATcgNqAflSO3`M7W@0JWu98htmy*F-i)@s1V(BH4Sy}$-R8C~*8^dz zo!ytn*ldGahMU`DT&4g?Q)-BTJ^659U*TW@T&2GGzK~N2yLVO+cmSOyvw3gh{LM(H zrnP&4ncH!G(US6^hWM zK9kZ9Zkrk#{-n2}E{`v#I*h3?Jw1{O76@Z1nkS5@d~Sm=6+cE8Qzg{{f=E$5I{4nb z&pa^0GD!${{j}jSQ`qdWIatEu8im@#@RfHkKcF`VQ|~YbeG}!=9UT4jIa3CbJ}5`3 zJ_AbMOfd?g?8$*(*k;2XcLL^MXOD9L7dv|#xh`OaoSjtE*kgaiE_-WihkXYg7qG{t z*SgF{vA4&FO91X5fzU`l<0^vIsrnH&$^4svnzexGq&ik{KAhLVtZd zdn5tTgaAW+;*9yo+20w~`@+P4!PXJ5heCy4_OYBhtor}~3&mV4##7dc+ZK;w@M-FP zKZs4^i9ID0@(!AnjFs-m$PMTlX$h$BG#T=0~?5OcjFiKt1a2 zn%lB8S3fkKzMAh1#kZQ~FZ}}~1mBxdAc+Pn^5UAzZo)b)ZMtjIi4F8@-67^DFWh=9 z)>*lAPR(o9j`TYO`l>|?Y*!icATf!NGF_$kosB>F8M10!-5aYGOT?BstJXc1kW=Nr zLe6Q&y4^7%S1LNMHbNgw^-$z?x<4m3**U6Az}kWx3IBaS9;V=vcVMTQ);lqYqBQ zDONWY4w8^RXL1Bh6DZzc8>(EPj2Hhy4ev;iAz8B?fNQiUGlSTs(hA~2^y1aZ>St$+IwTc42+b);cLWkoEF+uCjiA`V3 zD)&U>Y}8YGVELZeXTgp2Fr@F@*M2*^z031{*l~MePS|T#eMc-w(Q0Fv z6`RcrhxY{h1H#+I&8iMZk(|6gR)UL3is(&YF#yZRVIdwxtnu@}jsWk++JX zn9#++zT>?qdO!T?I9VN9%9^bpn60$q7?+6j`K93kcV&kX$C8Oq=!>LDKv)pNDcW7Wk$L zQ;ni0BNZAUSAO!zMwR2@dbi*71?-pwJ7zV<@B$83bHO|7U|uLf&O_S8LZlOPnM2Z~~HJnySTD3?uGn0Sow@@iM3{r-XtHJ4Rc zn2KN<`WrDHl5-L6(bRI z`YnFqfN@QQZLA+dP{eg_c4oe3f|6sJtlA_Hk{LJOU)V7nL^0;GtlPfv8B(L)~6Jdv+jYNkqLFpPCXSb6${a;e|{r?F(2~XUq}vH&fwa zU)94N6(#C?u3p!a?y-vI;n?cr+jlojJ54dAD#}`1q^Olk0TwJda*r;qS!3$7vA3}(J+dgSb{4Cks5jR4;ksP&4FK69cc<-^n_ zdQvVu{bsGYDf)_w*uW&Ktkb*l%G33G?h2?@xWHU(Oa)=Cq5D*)l_~}o8gJ5i|MKN? z6!Cv)Zk+dCI-6|q6NK_O>tRhKat)f?S=BlMti{@ zFxQ<9(qC|r5jEatapZVv^-aDIxdfEkjC}Gj?*HIEbQ>;7gT%RrV1~x9hTn?@0)eRw z_b~GE_VhMMv?)+fUZ`mZDD+Pmo=6|}hVbM!|9N7*AnreOWqQT5>psr!b1O~ls4W>N zo4s1?(77(bX0b5t2*PXoeQTQ@r4gR0law#H5uRAyHIQG}8ss77XoM#(P_b*_>CBI2 zCrEh89bbBFaAGE7lIgj&xvPU01hM{+T z_EKn>winOi!Z4{QX3`O$L@w_UjR2)X4|zR6Wr7G$UglbWTG|h`+iSy9=Uv!o+>_62 z2Hkb+b4Equi9%GwG>y$CVwz@*Ow-u>=xL<2ZE26sWhd=jn!5i@zI6f9i17vmjJ-Yv z2H|?&zEgP^k|qD#=jPgDPy5j|BWy>W_hMKlP@sJoTbPSE_tcY)S>W`a1`U zPH&gXZDXFzy|lxWezO;nS~WStrY(wsu4ET0`SeZf+Vt9o%qLKf3_)4=2pA^hg%?RD zq~lcuqbkw}MUREx_-MM}ZC{7-J6V+Ra~+h|0Of%*b_yEQHKZG0N_CbKm(Xx|szI&< z?-{YfA|p&Fd{Ee+a_M1)gXb>(Vytg6y}1$KIEJ@rQ`MZr3HEeYuWsHR%O!og=BJ0Z z`=@G8Xp`}nkAuWp`wv&mpFDeI&)(+abJLk2zt?J)1WmwL`$5co? z`=bu`R}@ilL=&E80-5reh`QCoS$vugV;F?L@budI+26+8$>vQDL51PnSbdm=BTt1o zB$>V;B?~=7`X{8~!}8;63U3W$;0@@Z!zV$RK}odHRY8Gh^i}W#iDV;40!-*|P|d}k z=`wV;Ni)q5;K$x#(i!C>_-&*yAar;rlArzU2ktoWV#ebt$5Nj9)ZS98DlZIv_~6n# z?g~zziqAcPikAn8-8EV;-J2@YvHyMEHx=EkV}K@<}z!G54Zo^rMObf zoV-;%UK2#~%${1ISTMa!h`6F2k*1|&&cE!73yVPfkI7|OXZ(6SR*cJ-NAp@eLNqmy z30r6(GVV?Oo8y~#1u_&57AK_I;An#W`P-BUeSbeg_77anP5YQ}PT%yi;4A)Hk{uhE zIm&nw$p8qs89N1_2wf0TRjgO|hF?mDn}7>MY8Q;J8#fKOyn!PUohDF0$(=$9fkL08 z*c9o%kYj+oB)t~6eqf)08$k1><3LV;1XQ9ClOMAXEdDjtt;+#Br+Z1&gTn!*5OSxh zDS9yPH)EPNC$}HHpXVlKwuko@%CxyYSJ$-(+8p)_xVplv$=*9kiAXk?kOWA|TPS>k zw;0~W#qvIJ7?LUq%lBpS?SFTMHtzs^i?-W1Z9@G<-{I2s&BKbBadQ@z$5QvQW}5bh z`o!VM?Jwr48Ti$uZM>B=QE|C{-<8|E@fH%w2jT;A&iZakPR~htGC=Q|=b>!q;b>-M zx;I~x3-VC9{q@^s`m6$zmy>YBNmZt8oKV;)M4f$^qFr{X0l`hN4iE24$i6HL*KCO$ zp|U(|H9Itm?9LBHlmnY{iIo~xSKJO8=GZJQh_wSSDwwU|U|KBak``aW>KAev@A2Vm z!6g-PXE7MZB_j}qm04x)Ih#`6?)I5)cL{-LTZ=g@4l(3j-pg}}oGZJb>jWRXwI48_ z3^TZR6ozcU96 zXoq~a!3QRt8bd2TN$`Wl^i`31t6s$1i&|^+ZU=$1nmxri&!Fl zUqWtf8EmDS+uiysGI;ijP`RE7na5hTzPFdoQs3qe|Fa# zd>AJ82m(OnJ06!DzA)x0$Co_$VwYQ^+P~5)Wh!;Ag-fWVN`EuT%qH5O)y~YNYmh)@ zR>HZre0r>BtU5oJ-HQR#aEwo9yd1^3ICpQ?!0KdJnJ|ZaEmh4OKB%Y8t>j*qzH`g4 z+UpmG4oZ4?IJffP^DFK7iQ+DOcBRt21fRQk9=2CmL|egetQWQwT`LcVMs2icnJ%NH>N^Ag^?QSh&CH=JV)zECH+nl_k|fP;;vk5DHO zIC&Zy2DT8^A9s)3YC_P?c0#Q2Uw&sm!l*|yuf+hToOY$zOkONVzZmv1=Pt?pCzRe`LrnL1uAABLcln1p#L3iH zvp=GytFZyha{!=oM4f(T{oXqdq;i(k)t}kmPxd5?A&z0{8FxIZCqo%rZ%5{H6-j~r zO<4XVJ%=1(5IwFT^tiSF89s$~>~WlQyfm=pF^)EgeVsV=8ucd9`68$OI=LqxI#B(9 zi6aSe1V_Mu?hJF_9CKRAMd2rmYyv0z#$*C|A(EdmFXqFdb@!|guv)BJ2it$NO8@e7 z&-tx$&yRFZD=tBix~$=0RUiA*8E1&kaDWlp`+wm$`dvQ7Yln699h^T}qkhLC>FVs* zaoy#L5*a6`1=(ok$|&bcyEwBI)o~@=TXNDLkK;Wo6u1wHYQS~O;hgo@sZS^DEIaSb zNb8Bhf)c%{IMdZOm*6#Duj+({HOMJBQ<6-1K)Gps%)_1xDgS73#5@*fJdp*i$Mata z%Oc4w-VsPw4%zLrDB(>y)&51}P5RoVKiKp?q3i@rCX6YPaa}UNl_oEUu`&NLuTK0H zo%)ibn)&9}zyqIRe zUh0c3RKC2jJ+otL3w9Yi-Y$r;TYV+GBH`VqXIe*I=cNlkX3(W6SyP3g=zo>R>=s^D zUgEEOIDIgsF>oK0qF&^>tw~X_z&F90Dd~f?&}1}(+~7O6@Gd^R_82#coVVLhN52Qr z0$2JCX&(NB)Y#BpHcI~MGg~vJ4sTWVaN-t|-V0ZAQ|47kD>Hdj4e`uu9IOt1bkBww z;+~43hM3(sQ8v^NCEumQ>u0pS7N=7?5=o4!z=Ew1#{qd&1+w=-nlg#HMMTG}?p`Z*tg0w}ufrp0D=B1Gi0XJ(GLHMw{(XHBt-(GqqfFa}u+a7Jp20 z$NZ(bA_r(%=4f*&74)&m$(T#Bnz@PckM1@9R`ZoFvfelZLy$E3a_+ROJLq?Wv<#-Z z1^TIEfjMu6M;SM0^+L15CfI1NwRLct)542Hp3x&Hf}m_E`4cfMgn67`*uz?ArybHi zKE2>mV3s9GiY8iIDo9Q7k|z`ZR%@edw%Fxg>@znbnW*1kvDqAU+Qhk?zM)iPi)ayi zL_{(ms^PfYE0wx3g{V^@vNo)Z0%2QRq`sPgy&{W66_dI0KAVNp^<1P|_0bU}I$!e! zY?EG_)rsz0JmE~ZJsG(?*JV1ta-6k<%)AZxUPAE7cE`hhuYd_B(Xy|ITp6M4iFYsbtv?9H9%RX>Tif(52~j2wc9(in@5%MDm(eGbTk?c zyqb};STQ^uc81*HT-ENR!ogZR+|uAH*?!A8bKz{e%TuB#IoUlsUp_HY=VOA?5f0Zz za!~;pr7+y(b)Zx2M}HEkto;S4n%@y)#jU+&hrNvjYeR9Yc2&YrYl{Cs8^jHtG34fFMDqSAjegm3*V})>gs*3?&`gI zU#6Go>7JgR>De{=j7B4ABy0C*m+aAENw#EbvAkl8!Al%aYy$!eIL2Tnn8Zm8aS|2> z9AXk<9Dc*|BL81 zl@e&^St!>oT7RzuprK*u-UFJoE-vN#c;c+I6dt6AA|8>3M6pWL1EtiHM1^LB&W7E{ zQ<K5;mQ1joOT43wJ)hgDpRaA(p2zS@`lwyXryH7 zosI?bzDX}?1!7Kg6_Cmi2rOQx{qfbDyrnB9BV51>Jw=_Xj4GFMPdVMw)9Us*fLxBE zt?irVe(3Uf(zUNz1H;FifqnoL>YUYLB$M>#fSsmYIat7L3KLKGA3A z({j1M8?OCxXE>cI+2i20^g{--WQA~@P=cT5GnfhWc>rRbi_8N$vs1U?^1xyc==6)Bw>r}pB!qRB zim01q9}JZf&ZwL>hofPW$z%0oi+YnPAhm@t{0XmAyJL^~1&gn3di!{n!=nx_Kpw=} zS%)4pmNH#{9z0IV3C1L>qU^2JQ(xy@6a#U5I^U*`ca-wHV|5wm$CGWe?4b}oxI-!h zx?F)KPZTL0K%>tOj7TBItmXujUNB|F+KY_V4_TT*vR@VU)aTSPTaaQNVpduF#!l5> zsedTrG#x7h(}=+%l|k={AxSu&7m=iZ)M|rDht(}Chm#HimM5)SaxE_b{4IU#)Yk$b zNh~hy99_moQ{Bmd4phFZ>{wA=w`??etP{=}!EY)AyMyD*39xditXj*bkbSyHFB#l6 zox@&!H>)u@AnS)uKg)d_dhe#XKlWTkGNjzjr|Upq@B>`HM+Omsj;yE{PUovjI?t4R z9ExQ?H^mXfIx_P`>b67N2`Pgint)49DwtDkWp2YqyZh_>WW_k;Crhr2m0aK_Th!vz zsU14qQp!)Zb@3T`vbC9vTx|{uhTcTMtM|2dmpBZe)`X%y7kiCfs~4|>QRNpctuDL| z4!g-xyKjbjZ2WEs{qZ(`roY9;2Xd64?6}7y+iKr6xq~(&-bTVLNgHB*-#VO(7=Za@ zwnnD2zP4M2wwK<&J8<)Q6f4Un!xdoKXis;?c9$2YOWNwhOx|e^=R9MV^(5Rni(1wg zE}~4$LY6D_hudAE`Pi|j*)iCeh2O<%WKB*<7B6F7N~OIvPkU>|WCY(8NOYW3PBoEx z3356{?!la-Rwl5i>bX*M!cZ6uHJzYuhnS2qmCy{J^Om;-@>0Yl)V1L`0&;rwjbXD` zyoR_>RA|Z~M((mo_Nl9ESL};*-@Eg&O&hK|GEQmAVuK1zne0us`uclQx{wsAG7zG$mY9LU9ps^^y_NPgdG;zlofm(YDF*K$Pm9s*7 za*-*c`X`v<1+k@=L-m!<5NwLsj3yyeSP_c%hO#;?m$Y`LWChs&_lo{g7cuZki?K>8?e0J=crJ1!=PudSQKEWPC!J{iHnw@dvEW{VPJ4$Qf zAfqwr{rRXoz`V$6!f!nf5Oq+5={t2NxA?*dp!hQPoW4u54ZgP-SO@PRcb{FGl)V-m z&9jSsedy|Fx){It1awq?T1>CK40ZO{0+WW5N-ZRwkzLm@F>1$pb0M<$!J{>-}g9eW!u0XGfy-F@00N34-KSHYhX*w4QG0$ptp!+UL(nxHhVS{3 z3cdMO2%&;E-3d_}kQ#SLDXkj|ig~?ITI`1#mVzk)O94xRF)Ef6Q=vjl>o`n>_s(jr zKK90g@uv0lob%Sm?7)@rP}iuD!n7p%azJe@w&#Lbldw8TcSTxdR}`x6ib6<5%d~9o zx^K<)}Nbv9!Jy^b(XBc znf*+tw($_}zu|9fdEQXve90}|#r8v=UiK+w;0Dp-mTFJ?MvgnZW4AvwyLc7*vL4w^ zwsTBfc!e9bZj?Q8M3>m!Vwos$0ne#Fie!eRJ72oybKj+=ZI*4qe#3L>+su8l1E!gJ zez#iPkH330IED}5@4hfmp01`UB`(5TiZ~7C5p)9#p!3MlR6tB@08iA-Uig}*HC!i1 z`|6?3_GDXq@g(A}TDz&+De3G;@$=Yu0QyIf(JGaLO%6(*_DGAT5YU-~xH;dy6N6i`V37%Pb5&E>uq%rDM$kT@Jyby+Yo&%CAG?>yB05aEeDaUvN z##rH8Sjd}=O&GQdjRB@ka5|0+HYu7T&c5RTr+Jzn(55kc{98EOs+!g&DA)pk#vMfV z6_D|OF0cR@uMRJOmFygR0ligS4*Zg$&|UXB%O1Lj5I&-nETyRX48)^~LgOvOcuX6r zD5iIcq5;%W2F`5fbn0x7`QSU2%^Nw(6yI`jxjbAurP%x*Adle9r)D1wP+;>0{fQ6- z7Se^pNpuN(6W$~w!PLDSu-_Hpq_=C;)Heg13xV4UHUg@@a|22P3=&R-M#*Car^}Jb z=4I_B?5z#PV7pmsF%_*{+ou%Jo|eVl%gkn{U{aT}1&^nrIY!Hs^C(QNhG@>d5CDx* zQJwKvV{c*oSS+=VZO8uLPP*Sv_6MRn>@j(5wdc<b`89akzg*F-IdZg z`-NL;pVsWd+rj&wan8S4#DrN6a zR~jrg@$+{gXB=(Ha>HXEf^`LbD_eeS6PvL%2nNo%3_G@=Nuxnh>s5j`5ea62EZgkv zlAR8oS37*gbfG)uPU*FR)xrbIq0<`n*`gjpA{OLzJSb<}=}aV>bNb?ZuQwDd<;uOc zINc?8)|M`>ndl4XL5pHEd!1E-Dwb^R-t0qBXL5CUTQjzyu}qs)wlB?fI~<8Izrgo) zUEPi9XWfaWK$`@YKsyqBF7Ct&)h<7z*>~L=AN069wWm#{h8s>Raz`SaouRzwDd>br zgCz#K?Z4JW%2_uGNp)SxOci{t=CNSGXBBwfEvR+ws0ZFOBSaRtVScaBxA~_ z^4m2UQSCJKCpHckgwYTX%FVsr%ljsm*zYm(0!mSuhWbhu^ACmri*{ow-NZS{vf|z| zIAIIYTB@6bub?)ine0+<_wfe3qX^g~iAyiJ{$89fLH+pK4~$h0{gS#r1(4#4X#RH? zCc6Zk>6@>|7t{819iFW{BwP*5k*|`MsD*dI#{bN8Q#MU)Wz5KTASRZ)Ng2*EU{i@FCL0X66fIKwaP0aTO$R;_a#fN;KE;QoUJdFKK3 z^Q_ALjvavIQ(v!>pj^xWm@jCpTC;Y#c}XdM{7Y+AR`Ug{+E%j)WLqH+EF>#2dUOg~Ngxyo!B@!f zyav9)Ws0wG0b$A+XCbH*;VhhaU*Ft_MW@y6js*~zW*5SBZam`X8M zA}X6?R3R7zGuW7`%xt990r#TDZ!QG8f)k2+k+tf~kEjLXfKJjk0rSuSM>4$o^xb>- z^uyd2unxVKoSe^PRx(`{WUga{Sit-McRtGPvB#v)C(5gGDe4F6LBZx^!TU`2me{SF z@5qW!cNuI>tCH&umm}BkH>y6EFeAUjgeW5x=`O2Zo3M6B7MI@bFzYO=(_(NqVnLJO z5CuWw6~n%ym=(QAGuS|VaeGl06tfGNADlKOS!s#cOduc;<8scs*k|-uz<3;89fhy%r6*K8U=yONmJCd z-k{!P0~Ma+rj!qL2r?x}9S~&mN$S8Lt0$?anfqCtWYb#Y(TUN}zGYjp-C98>yGOI$ zF{`e^_btr~`O5d+n{Qb$?oC^IJLa4~#&7A9#|Aq>Uf7~`*-LSYYR{@8kmE<8L1<7N z76U3bl@u|W$#SufI!3(V{z4WeL_qC_#{5UnK7djZdL1J7C=o=;CsN$Q3izdhVo5Ur zX}@&or?EC_wKUu@)bB#CqP7eE@h5?@VAD7}E$LV)tTXsxT0LhlBM#mtAr5X6LvZvV z4jzw1(+P(y+6y2_=g9D942Nfz6h4`6pV=Mnd~dOQAanha+g5JQZb-K^C8Mrb*;+{3 zMO~^`c1O+G9*5SK3YJGL2=b?rYuB4>sn*(uj;ecS-uQ__V|NIp{JN2VHRuW(1I>=E zQamI_OnRq>z0L{Z6^~8t_9Jl33bq(tnsinSXa%<@`JzZ_jlfG2F4#OCBwuPdoL~dy z(YBG{A#q^5qwUd8_O4y+O{|1N$r`gV6W}H^X{bFTTjS}Ht0}UtEORxVT%=H6bw;Co1c+pLohT>aG^Zw0ikmRs`!@Ac}cj#mxndB^OUR6Ft1x# zt#@9xT2oSUEM0ZvJE!XUF=&>7JBD0YlO`EiERyw8|lw*d4ZG&!89et-0igiu#q>u!!IB1%bR25}$rO7FnfJm0FXLrIjr;^34pv?s%T?Nw}f$WB~;hs~1 z-D&~2jhJ;@{Dtc&*@52bad`O?F%exjAmECkhZYbUg@YTE||Kj9vg2IvQom|5p-20 z%vhZ^Z4lVR(n!+69eE^u5pPth zH-r*7Z@Sqdslw6q)o3&^EZGb_(PYC|~&I>c)~JZbD)y9oYHzU=ys)>amWwNrMgzor@HEtEx4rcfSd}ks3AY^ZZ7s_P3%pQu%^?zofq8rmvlQ z>WsdOgwNN+EX&kBvEQEXoBS?|3&=-hokOr9H_7UY#%7#Z>{M@Pd&h%z|9-ga;8K(9qwQFvwZByQX-3qn= zT?g~X5QC2Ub;uC!%|g!mR)xm9xE7rEUA^H>DIEDVi39jz+eN>ok}?LYoyA;7?YcU* zH@Byp5BrTa&f)x3k1rgewL{DR%VNbsf|y1Zo1b&PwLkvfvOnk?dRG0%2^1$vG!L?CYNUaWC9Kr+;+4sqUyPAb+;YeZOucv zsAzr&MfyOR5HjBsM`I9~ul1mipe%gwD$o)KBp@OVLNlDbc`enpl0v8_Jif#wfV)tjvdMVKy0^j}m;UMU>PRfB_3N~j9utb=4Ep93#opOa<)-_5K_~Cg zjrzn=TdNC2$VP8Q9rTs6j0twdOzqzlzLhVbj)4viU(X{%7%I+E8UQ6qf|ApstFbw1 zD=V~=)NY{mAF95~6v#uV!=qkX70t;)F%K=nqI))^At1dO2)@b|3c)QGWQd}agix>6 zgXe{MXBAOUN3jbAV%&l&DI~mtwy^myiS5d66wv<+{(l~h`;CJPt?zAUn2sk4qyDOk`ngSMZn%dQVkZ_wr zK1qWdUkom%7sDPYkP6rWZu%u>5nWon)#kEQl9>^oV0YToT2`=V{pGR|i4)nTKy%!! zHK-&h9jRtUir%i-SiEmZw##Tca**HMTXyv?>a38)ridQX7d)M7^!4QLO=3fDUU@ zr!73Wd$n#50guG4-rlS%@%gD;-9<5(DUB`4Hmgqk*>&7q*FVn!^Z7Uu_G0|pkNaD? zHN2&{r#q(R=I)4%M2>9twR*v41y%v1+&RJN5OS28K{I2IsBMv@$u*^Wj>Ti+tHpIa zc1dmWO=+|dpo(?v980rSeX4ca&~gj=UeKWtmbV5xu0u94-`m5S&}I`NxEU3AD(aV> z`zSwyaim^pu)@F9NVc`+-+3gM)-RtK(TjyA7mhMNql~g852QigL^~a2m5o#Db>aAU z)YqCE(-@ehU(zq#e7N?%RCLhIMo*lpbzHO=e# zW*8u!MQ73ywnGrAx**gotmB;rCY>sET_(P}rQ?u_I^S~Io% zX#C(qfPa6TOp;B={83`{G}5FHh{Dm}QgjGn!T!YLNm1JZkJ1{zF;UXDpkwFPE9tV)q0zOjT8ngk=ap* zbV+4Y325V`-fl*8!yh8uj3H?vm8D3oy#gW&CV>c z0cXazXmp3p3P!G9gnFFK322{aw<{k5Rx5Xmt=(oCi6`{=!AyEs?6TqI)vL_mW`B4@ zR#VSvI+71|2D>)LB3eOHDrJ3hs_Zk~o=AJDnt5?!UKF=ZPaR>8)c(`s>hB-&(b5N9 zp?{CTWtN-ntlA?5IH@cZdno5Inbq~N(!GuGJe2MAI=nh7>ZdqxOtXFCfU@~wf(*8`+at+r!yGlZd|*%I33(`%T~dpF=&z~BbZxr;i#z&zRginavSDu z=U&0MZ6bRvr8&;1;I`ICo&)a-wRfmroBm5!snZ3-np97_@C^$G3w;eiXHtJ3G3sX( zF!zch??3i_OFm>scqgjXev5^-s(CS#9EWV=WdUVgpO?w z6unwe;57+@9UK=4U#6S~6NW=ZqSuk>9luj5_IBM4-2SlHo1RSO*QXz5zX1Nx*AsX9 zy=|i>Z@BmPiknJ_Os~oyTO$&mG|7_ZYJ1k*+r?ZL(B+f%SUy5=0-4i4CD(Ab@v9Wy zGKN4^w==K=(HX25l+;Y2?nwIDHH=Q4#)B#3FOxtxI-I98iqvGmfVNTZBa9llGGg+Z zsh1e>Z=5ECDXsu!I<=Q5)N>nthxd#!TGAkSkn+`a;}}McUG;z|WOYPW1^~+&GiYrZ z^_54{c|UfjWlxK=p){0?h?US1P}55*^pY+c>`&&7wtM~S_MK>hQDcy@&S=r^wJz>* zh9zq(qUKzZGhyAwY1M^*E7)SPTFoflvZ)dpx0sRhRv~8g%86@jmUuz$G*!iw{(-hJ zr^jWA6%8?eOtQLSrjj^rYYkt)H@6H+f!y7Tk2)ifl;7dXw)BkORx)BD89AG^J31aK z2QTk?s^|K?N4h39bRO!ux>VYmbXZFxp!w^vK(WaE9gFo~Qn94f;qYWGS5$vh^k`P5 z0~XjgZq8L6i8=?>YGcO3W;_PFd40I*&J^?(RWEN<=`RP1ib{hjTz@(o^9S+{pE{r$ zs4`TZ*w^uoU~U|T9h;!JBxe-|-uyG3sk&;0pni${+k%Jy72Jg?i$g+)qE(t)K4ZfB zt8w>p(=0Q)z4lRdffFla5)Ng1e0Cq~m4-?SGpo1tF4Q)$F3*46ov%8`&O7ug9?wOT z9Oe?`Y+THJ8Dqbea^F%VU7s`wx#arpk*Ku)J}q8NpToQl#2kv zQFqwW6cMJ4ZULR(goXTq43KW1ySQ6h?%lHXmfYtP8_I_s{>+-nI-}H+^ux+F=snip zyn^?24l1pp=OHV18cziTB>dl$1jK62+>J!Xx z{*8|7xY@(CcW3twc8*&Yn>+@lIPMCoO$phbNalmSc-7(hXP>7pgYXF-3nlq+$z6?k zcoz0(d{wo5Fx?xJY(S>YwZAY56#3chAK4gLoSfQO``-K2c}i}H*Yxy0p@V;k{0(9s z_=6*f*18W5Di>)`G(8PNLw87ZhzaL>b{bU4IRNq)5S)ZTqV@uN2(8AU;7LB6QC{*JWh-HKiu|0#cLeI!@q5t7bW%HF6Z=j#Imktk~L}%ndHNZqz0&0J+mp z5*<-6WU{Pr(qT(vhF4l87rgRD`%oDi+)hBzH(4nZ{jv||H%tMF-mDE2ONQXmmSt=E z6Oza5i8_I9Us~OF+xRspW_l++FQ=wvNR%^Ho1E_7i1&l%57us|nnI>@*N!_j^n2}AZ)Y&X-L!V~w!YoB zZqb+oy$)b^!dx?bC7^qgr;n=#pnGp2zpK0zXNbq^3S~jQD<=NDMxomiXqp^?a6O#D zI*;7pOQ-@EJLm6isDZPPsT}$Vs#!y68PPizYxRaHRk=b3oikY@CP#)+ zmB&AL&;8GVs{Gko)l*02HnGYkXb9+t=S*#}Inv$O1YvGFn#9STfP`)Op@CZm_N|Fe z#AAU)%K%SyB~5!>z-)d&+Uxn$=D;U8pLV-;9XpbU>+=KI^pF!9Bd=4>SwhWzI#E%m z-Pjm)Zvu3gMkp2~$u_t2Trza2tdOBAywK`@gPeYkd{BveE0!g)laP^&rGWnDSH%l0 zzEepm3+u0!N7_~#ELY0IE};ps^ff1-rk$Biv)CMlEWyU7PZoQ-#k6BdpI?$eI<5ZE zv0ppsbdUYbWg9AB)4M>n@~Qt&SgPx?oQ5oKr`$ZqV)!-6@?tvn{C%+C$h;I|0k;`Yuz* z*z_irl~p6m?ZA6Lb4YXC$Drf?ioCEOGDi2X^Pw@teG}x)hQ{dL^`fyce1U(B;Mkei z7}AXq6PXW=)x*ei8+<{kG~I|@tfrjB{@b7FfG z^W+m!$+k}^fBA;hx1jcVQBOOI~)T=oO6gXz!<7ZSrMSdup0AC?8Mzl_g&#Gm42QC#{7E9PCsU0>g99M{-x!wLWB50D%>JwB} z(WyfO&1q{-tf?6DIvuA`FU*Z@pp%>}s6VGP#%OKN*_wUP@L<8MbBWUh)sYJ;WvJc0 zX6_Ebi}&j|vXtLW6o`i}mu9G+@#O-;5=JA+B1Q0-)PrycW`k*gQ(|h=%c~@;*4?}? z{zVs@yywT*)UUo}jEw^+g9Qj{ArKL@OWypbH(s=U!WS_l*2R5EwKr9gyTb{cL5YQ4 zzOFf4!0u#?FmUvZe=UAIz9RqN^Ibi_6yODwkyRNCzjO@Fz@G5{Yki6bcq-n!F8%P2 z(nU=?$NGE3rjR34vWBdsKW!S#0XxW!RD$PdP;&FfVotPH|4ECxzGXi{8EIl1(0FXx%IZ9NmS!7R>jDJ znWuXFd_b+fE8?J(HGn72Z3x5*QHQ{1(zedGgQB&$L-KH}6za-Uc9k25Us5GpMC{2W zWU<;)k4iG4#GdB2UAjbTPggcEIg-=dr+UMCi2EvyHBFoYdj)dE?u38L-4niiS)`-8 zR4Enum+Xz%U2h3>Rc#<$t!&LU4@nJVu9Lx{?d^r9%!p2DPrb&2UW0|p4eR-i(_`vm z{EOtz@ymRCuI|kOIW^Qd7I}sJ;Z3*8$_`E0Gh_Qoo&8FZNe*!WTt)-d^|&7*dGt%_ zcB3Cr$E8BkQIB*}7-71;qiXc6WY2$Ht4oyTJy&{_3N+xTC$;#ZcFO?DNp;qMY1w$s z(7>+DPFm5+>833lXogf4A9mJ5&AToKU3DL;R*mf8^d7S%eDE*&xgIrE#09|eouEWwE6Pe zIy+hx2g-{DDe2nQv{>flN!R5r%@L+{AY5|Px9;;XP0kVqjSsf&oStso>-&Q{;Xio+ z^Zh2g9}O`!0ys3675NAV0@Zmr>EwrhmTd(pw36rAqbe#cY8M69Y&#QZOQ@9Mfku?g ztYk7RnCbBFoedjfX;+Vmu%9ubrn&>}i2xQUfVd^hWryDv&XqO|eQtfe_i&5BXR+G# zEW1nx83&U~2J+PzRBA{52f_H> z0%0#I{CdkHBDLVtOC8COE8PYAeYj9gvUe=1AhH|Qno0%9J+WeBYvJ9yQfZMxmQ5%o zn*s$x$P*hF-W~(Nwy#hC9GHN_Xg*@_+f0#L*1dn(A8)D$E>?l!RwBN@CR-o^ z8bPDw+ZTv{`mG=V;L<6pqe@7qVhh8ZZAvdnXc>-hYPIoNvkI`-1}sNIt^R0U8FNG2 zT($?4F%KTwu&%l9+M*|51K8~OW8R)thCHtcW*e5tW1P|;tm&g6S6c?L%#yhB^`RDD5?=vXpr>f>loQ!N(C?4JJ{>a zt6&9!PSKClkX5}~(Q{UB%qr->^z7C}yh|5%4KLc2+mQs%9}hhTRRRy9FLZ_#XW9@n z8y5#GtM0t}82pU4)q%fwn@qY?bDkh$9TnLB^*!`fA~O6{s2{(!mj z`%Id7^ozAm|7GpD+H&Sm{_lTS+xPvK(Z0{T?`3-KFP>!{VbXueEdOF{S?!y(=WEl@ zA-Bzap9^BovKWY!s6qk6B!ayWQDJ1jP8L=!-GI>9jEY)VKT5`5Ydz`YB20`hkEqVJ zA`U^9R{T4cO|c9zMfQO*A|3{9F}HEJq%|$>@=r`8hu0VTw#0&IV@X%t+2${Gb$;d$ z=Q%p32BM|O;J3F&CVvob0r8?r1S6klcQ|&UIKH^dNy!s~CXgo<#jQfrA@VhOy-hS4 z^#dKPhL&QX)T=U0EGY zp5DX7~6i_{^{*@7W(%`EGjSi(n>J-{ri zmmw>dg-s(qhP8_gUO338_GNAfWVD0qgN*37Q*+~&69qKln@9qF78SM*%EHI~Bo)8v z_xe4_Uv98(U2*C&mmFztaJC%pn^@T^C9So8T#>nc59hAeP^;AMbSO{#bz>;Ur}${1 z_smdE94yV{*s|$6U8JZm(U#{{XsTEw$|49O(#l9kng!8}GuFnraW)VAm;t zop7BY0}$FlaedT{K+KI$f{$4#K4cFy66ubLCihb-9L0oqz4_gTKHJySN?8r7rZNWHywWJ_pEnCMWjF`Q86hZP%`!v0YQBwsQvN_U{6`Jrgd?5 zaZ(!;Gm+H#a!-$Ic~^PqSj(!I!Kw~Oj!wtoj-Jj*Db(7X;XX}DuHNmdm&E6es|`phVo!hc^Z{V0{Rf!E zDF2OvVyP+x@<8QOqVmd2!eqJtN)@uCIYLO#q7%;v{CG8eFQ{{)i?S&yaGW8C^1Qcl%ixaU z`}YKH-rx@E9A3kfJ*7&zE4HURkuK?aM`rTkP$GkWMqMOxDr;>Ar-TP%<+ z1{_~;nq`LrSn76@7=#>jfB}IRz=-4DI-6M@^W`PptP|eQsa2X(WNrV3`q-*yK=nxxK5>G9GB3(1>Y6U}aD@#e=oio?7lkBDZ@UMZ+*4_LKEueN2?W&JJ_d!x!cu(p3aKi+-V&#SdO zlJxKn!hiXvw%V7^Pi*e)3Z3zSpOXjuJ*)94A;y~TUTbB2=Jd3f?ha__>j@v|4Ydk* zF%OrkjlyeY=5EQ8=weo6om`g z*kxyDd{cjmQES!P>afe(Ca&Dv(V6bb=SypHO>#9K0r#JrDEM@~ zmi2CvUH>a$tiPTo*MGg@y%g}WWOX}y7XU9`-dqP>#=@f@FY7?p#~k^ubK4&~c4~5| zBDcBw6uJEXzff;7EzZNrO7{-+>O87|(dNtZXuRjmf{=Kz>jiojk3mvFgQFX3JHYvV zRf5LjHR|@R5LG5)a-dr7J>W|l%b7NpvAd(C7s1Ho03GYp23<>OFw#5Rv4%IeO(C64 zt+9r@h4u>Q&9Ik4@t#QxW6ibcw48t}@<@D9ObVF2@U$Vd5{gs1QAk4B@G$v;EujHL88c~%I=`Xrb^S8XviFNJj)BDsfz;ARjatrUr zLKmX7nf0XN3*CRkI-04n(kU-#o1$eRYQVNCAJQdI(G^ZqfHrgmwb`L^>lbI@Mai(1T6IQewJKicre zNB%@EnJ!C@`r%ZEZ}1B|uZ_|&%e0wOtGays>B&WFT*7D{V!hF3UvE@4$JUiQODhVJ zi&g1LBdZIZj<$krnZd+4{1KbcZPM!)?$q=A9|Zg5GrmBuDduZ0Tm9&5}D4u$0R^X=iKJpIwu? z94Qpqw&iVJqv*G+D1`*kW&~=utHyh!>-wK&vQxWI zu@rGY7ZLa<6p=^f<*OK*bgM?)L#lr`hv!$T*Sp$t%O^ah%uKeJ)r&fC4ix*G(qOE~ zcjC|+O9v=Lwlmi;(tHj{wh-z+{B<^4{e-97yQEYULsJLV_~IL)fy7$82*ruz?Y{n0 zpfk9AX6fuE(8}Agj-W1+FRgQCoP+B`ZI76ds+o+V*{3p{!vySi#hUcK>7+aq6*9(< zt1C1Vsg!K|Svoa?F+8=CcofsWCYy$;zZ7z{?bX7i_SpSzpC3j4Vh(ntP) zd>%M@1l1E9G`})ol$BYDCo?orpYrQqe}$SZK=RX_pP+_7igYnZV2z-Y3?&A%5(yT4 zkZqyTLQINUjQA4o0p_Z*C#=&D=T#ubRU99n$OX_c&0dKogfJqV*ul{?h?daPk)HJ}BdLRR*(qO~JkO%7x{9*sqp@{NzXQ;CfGqbFB>^{V9^{fR8kxpMuf z;9>`A@`NsHXNG586aB}I^4o5hTfTMuP1!NuP%x&E)8$@lB;DyWtFzACr`0BwfSJ=0 z&jiM#fJ4rRJ(WsAZ3HoKUS$ld7|9Iv24hAm+fp81ovAYK*0@}83AMCFYlOdIpk*wI z8Z3^T9^Rz$xnkxXQzo35-~!wJF?(5Ci^ZBr<&svTJK>h2kq!qUWOJS2_5$9iq*Tu7 z&07A?wwGt}i&i=LYT8vPh8SNU92<{S%(7Lh$#w`xba*nITW(LfdcfM6Q~j)3#sp_| zNlDa8(B;?6{Tu%j-lyHDJEkc10!#?Hr9b;NDZ0Ip>`mV%#m-Q?GW0dV|Lck3mm;sG zF9kFQ%?npvLWQUrDg(v|ecO~Ms)-&J(N}`I#$*Z%1B=?`EVLJ<@M0tvcc)aC`7Kx= z%aHt}o`%hgw)C>`-lfj5^26DEBgfXSfB&5Q82^oH=T1o1-S!7^+emV_Qv$@85p34w zv`er`ZOQV`6tMSMhU;h_?GWv?ZL7O(UN)ZUcIvbaw_GQ$-tMe6hm6?L=JS=f%+0;7 z)g~wH6yt1xe0}ZSq#DfATAd={0*FH!G}Ye-Ph}UU(}l~AT#DR!IHz!1?+6BjGw%dH zJ5Ohg61RCe>)J_;(-3e-R>5OcV$v*Rbp!t-WOcQIx|N^`8p3FJRT_&V>dzFP%r7Az z2bSan$`PR@sQ+E5xW!%)QpW5R;DM$hJ0m!5+4u7+`Yf_BZP$gpFXnSO@5T#h{O^KYv*Rz z*VP(m<9oqcLs!(g+H7p}X=Nux7*Sj!c^Y43-~hw_TU>s4WuSAZ-c`!A1Uvl}3YRL_ z1d@pAY7=8##Nw&ULdEHibCk3pYH*!hU|A*Ff<+rb3i3>ANW>GgG7o1GLD1GoX5fhF z*nv*J+f~TLjd7Df7bvf~CU3H`YNIx82$mx%K3|>n#f>`F<&hTUU&F2?AO%NOC34|q z#bI70Is3Dtuu15S-J{Qj0<0>w=8k@zwObrO!*|Jm`PG`d)@Xhy%bQWmS%{XL<;XzV z-EW=S$gZDz6109#VF6T|1Yl=Lrr3lF^x5;_OAm+Bt)kJ^Y;u{>a#zAPFw4!}e}6577(88DRU}_q1+Y&W8HUdc zC_vZ~0}T{LDC9zkfv6`1|D|hLoqtFX6#Z4H?x#{~WOTt=Ez=8VAgfU`OutoL224=u zCZh>Pcoi_Y@UO*1si_yf3sitA!R$1(E?V03?wc~5cCUF6s{y%FlR4%I4}|lZCITUp zy3j*(B+l}v$d<(_2TmO@$^88@9TrN56oT@_Ey}f+?GI_ zFI7mKTPF~<`Z zNSSU#AY`YDmbP8XwyJoJ&X(-bygc19%(IfKKQpS+Yjrw{SD)!q+xjx^#awZiMZCgJ zSp)iGgHKL*QYn?nV%At%Vnt^wCX1)v;_1R0T3WQM>6Uk8I&D5vKUi#a_O!o1#lCSd z(srD|bt<)57m5Yt_6({U1hvti2z|r$W#Zg=74yvfsA&vfqJ&x{TfoRzfwtY4C@h1t zu}H;eNss#IJn^_NPt?3tnJ0En%$wTW8%mckQSx|J?9o`c#D!3Y$Sp4j?PTf~5k(KRO99MbDp8=PTIx zS#^PmRi+hvGqC50&?twf1eR#+ejCkLp*cfz#cQRG?l5dx6T|-Dn$*T>pgfZbM+D!b zG2)4uOohT!d`q`w(?C_Fa*M8{E7akv{7WVdKnv(v52l)G5K|5HstIGvWY9v_9?Y4o zEM}Y2u6CJAQI^klK--!y+q}}EZ0$I^?v^!?f=Ml?mIrj&P~4T4+Bzjy?K_g>%a4}> z0lz0#4H+#atJ&oF?xq2Em?8|yV{w;xX#u)g&ujh5Dwi*g$5nmRNtd_am1IE|k$O}s ztpb)v!J#v{%<*whPYNcd5uB-ktR>by37zZHBbP;Q)&cxz&>?E+B!t!tDO%Ul;;g-N z|NV2VgS}3PZ7l-f$XAvGtY7R!T@`mkD&2yjnwMm?NVp+!+ zovYio558x9vSzn5CTn6vc6ehr7E#ppg2`%+T9w(Vr)qm{>K)6RC96+=P4znbLQBau zNL#^MQ`SW6Ct!}&BNDKOx`DQg?Y^?vtm|R~Je0QrZ$sVogt~3)52)hB^k>R(dJ=Uh zE8#07GN|q{nGXeLr>6ErwhbopMk5G@k=;KHw#%fp*XGwI)9D_`Wa2e5JH4T2JDztqq zV*C1@6_Mdsdv9U@=p$xOCt%8R0_~!^wPoup`h>$^hkPuBL+Hpd(y=X5Iq9bVdOt%FMed%xy z{Qx0`9cbvoi2jVXp}j;1co~Ta*O|VE_8K8(3mW=2<2v(WXm|#TgmwZA_p}}%#D@ND zkDxtA2-1y+eFP2t*`G%HIU$ZD+63Ax+FfW*py6Bx`WJDIvxIh%5EuG&;d|E$gh;qv z!cRB)cH>#y$I%`j#Diz`pdSyu^P*4h6KJOh@tr_>i4cDVZ5r(kv}Xtj$Y@h&&!YX9 zkl+j&?is}OvIY(J3E}(DtAvDcpYSXpkwa*>R}_83M$mBY*h#b}35nx=aXfpX6YU7v z&mmI$OrAi)aSETOR-rwC_6i~C9cT{{(quuyXPHBUWCB2p`aZL~U>_vZlxL@DT3F$vh$RY#U3A8Vwy-LUc z`Wje8$Y2uf2||W&zoEwn8OG1ymkAl!frjT8#d)JQqrF7P*Z|r?gp8xFar8OS6(9rJLujnC>r{@Wd|X* z;s)>9Ldb285psKmkoP=I$a_nKLgSIUaF4t3{XHiLxfkF4?p{JZfX_}O3Hdz-A@||l z_q|5Q133SK8bUr)A>_kfB;+K{|L8-6eC!26K927`foneTA|aoAijaq%CFJ*?A>`p1 zLOz8)KZWxjd4!NpqkRU?_UJSrkNMD^B;*fnCgcxy5b{~H$I-{H@8gnR}4JY7LMMaW;{v#;VgzlP7BLHir@_jO$Vw`k9z|7X$XH}GuV_&Fhe_c9@W z??c1=o*O|sPRKVMX!!a34mA4nDMG$AMaT>I{vUAve|VLUZ=>HACkXit&iyW)?|-c$ zMSF#i8m>Q$`=8!{b{jBzdI`fE zCya_C3@-sN_%Xt04203n5JsOQjB%PU<|)EhULcI^S%hgHL9*KbVI*AZK1CSsQ-ty3 z`T&mQy@Uym5GL{ zgn_%-TbQS&u$9 ze339S__=8>VK%=)n60?~_6lKkp#Pod>x!2NGmC3>;ru=LZZFQ+hx;6`5aw!}bImh^ zIfUbDCkO)_!5qPJ95oQ;*b%~9k86&j-y2GVxe>=Vy-Ju{aPF=6+uwDHFz;SRnA@Kv z%pLf<-;2K9*G!l@rwMb{V}!Z;X~O&t`nnhA|L#kK`M_SnoOp;Z_u-oR(f0=>!hGmi z!konMNAUf}@cG9pgu$F<9zq`vqrXqRK$u7H_k9}Qf95H|Jc{T013b$gqVLBwg!x=2 zVgBe5!aOlSm_OM;m_O?!%#(P|&*S?)KS7wkcz`f}g?_)ZiZEZnb3FYRVZM4ZVV|GBANmOM$|HpN(F9?B`~YG872m)58ex8lK3*e)`HvqH=09=$FPaJS`U%3E z!Whlrv)apqB_o7oULvgOi-d(&gcY78tZss^2JmPbUm>jdUcy>s!rG&Rb>P^!gRl}u zSoa~qdQTG8hjRjV5jOZ^!iI28crRh2y@ZWDN!a+ygiYbIrV3#*xJT|0!ZxoWY|Cwg zE#aE-tAwrKxC5VcqQ9=66SilDuzl+YyQqZrAYlh^-O$a19e$Ruqv&_MLf8rPJ=sav zB{**>o^v^#YsEBSFS8JKHLhQ4Andx6gxxSp*clCBH{#mOPY`x1?!WCt0%M6)IJ|H~ zn5XD}i3*J&lJXlpW{H7$q4Bv2pF?vf=WsYa)i~yfkHt(@K35ZoZEhSJnWtDt5x>#@ zy~Jr6#|$yR(yo8b5;X@2DQBpN7r8U_V~!Yjv2n~36CY|EtBH-zH;%RVysvSrCr%!y z0!lvy9B*wL8_7%j;l{Cz7}RU=lnjT{n5Wd+8^`#2HHpSC{$5Q_;~0OhX1sBXzgM%l zag4uLbGUJgzgP2t#xee0&7;b(miDjP(>O-|hJ51~{TqfG$0|}bEN>j6f5W>Q$LQbi zk;bu_L=B&B9Bc9U|85-XNyaeOI5v=sG1WN6GZzx4pbfNCo&lV`sHqN07uJlv<*iG$wqjYw&Iie8MFAg8Nctw`CE~3 zFT*#n8$Y+=EE(tTP|jUWMv*ZllO<%Ya_+*OC(h|1gR@pDSMSH?^zJe#z~j-3CIcaM z5B|Fg|J{Obw<%X{#9ijkq|bQvuIE16{1ekB*oQuL;<^Jk-a_a->78cbRgvLAqu+1B z-%0!3g- z(01bYjkxbDdZnKoARYL*LwU-*IL_n$`|&LMaOPfox*sD#$7mKm_u$j*_wc z_C=qb-k*-}UNky-^e?A(rt-YlIhXqUVlpY?&ILTr$VmxuQ3 zJ|HjOv+cmajr+FB_+WPD=B>N;Z`~qay?e{nee!`FTjk}W6Y`S1TX)w_o~WOYkymcr zw}0oJ-Etw$a{9rUMpX- zb>AkOyG!1@XYaN2gpISadk${hl9QDOo4<17?k)00d8lt`{gnNCS9dtiTV|IXRmo_*W%ONJ(v@0s1WbJxb*6Fc|roZPc-*T&hY zZ5s!->^vZM$jdiw-?$Gy3*~HUwxzkbxbWn&e^@zJz~G$U&HN|w_{M!ZcQqd1;K75r ztyf;Xf5+Bq=>uH+)BisW`2wZ+TlMfiP(55y?f-U}`K`I~PRy0xnhF2!o10TG%r}xj z#cZeB32NFd$0ys-=thD5ULa-o?OV}WVD2}Q;w3fAFJp|pnO2g?xbhs-U_RI2J_sZK zAk5sYE)05oTf`Rs?kI#6d*jBrYN$ z1nU8=gpc@1fCQlmLnKThBuZi=P7;V`r%0MK!B3IJgXEza3s8|oQi8H9lQvQz?NFdq z(n-2VH|c>Ny^r*hMPvX9cLEZbeqndw{0=`{Y5m&Tc2)28Pq`ke`x&2cq5w z$ZbGw{4V)7)Vw`R{)4ujES6P z5JX@sjFn*+8)Ii2jL0~VRVXoT#>03SALA!KC%;g#>t!aygqa8vWnxU6Niaz!1uTyy zCc|XO>*QNVlgl&BOo3@(icATKp=D(CR+x6C1IZYjrk`2F{GZ;w z1WuBqD!(FTc4nDlK}Ec!S@8y(s;;V@QT}M}bni^>&h`v_EISKJQ`KEvUES4Hy>;yD zta2lAc_AWRu-x~3sN5ijcp@q)qM~vMh$sqp`^Eh-JF{M9`e*z1>#WGkcrRW=d~v-O z@p4Ygi)+OhaaJsd>%{e?*OXo>&WRhuqBt)uhzE-$u`E`^YUw|)Q{m&KPly}EL&Qzu zqPST+R6I=FA|5W*#3MvQG{w5u5G}DO+G0y|#J1Qey+w4zuIPz=>64{Ti9KJ=5 ziLtm%ToSj7%i<34qvFTJBgLb{qs3#yW5wgd;GVyZwF?pqUm3Xyyjd-niop`-?gLtEOllV39>*6=Wo5fqiTgBVN+r>M?JH@-i zyTxyc_lWn3_lft5-x41Xzb$@8{I2*t@%!Qr#0SM6iVulD5`QfIM0{BMsrWPT=i(#c zFT_X1Uy8pHe=R;H{zm+*_&f1&@d@!s@hS0X@%Q30;-?q!cEn2d6m4o zyodZ6`L*)v%H-f~LbM_w(zL*7?@r~EGY-ST_n z_sZ{+-!Jbc?=K%9e?Xp)Wm%EavMOt`E@$LPc}o7E{2}>3INf@X{9*Yca#mg=Ps=$u zFRztnzTA_y%7GlpksQn01z%3qMrlD{Z_ zN&d3@75S_3+44E^PWfE+(0`o8?>NTjks2+vPjtJLS9NyX9}n_sI9k_sRFm-;y7Yzb$`9{;vEz z`TOz@I|3?0;{5$z^`3d<+ z`6>Bn`S;2u`h7tByo7@~d z8)%Pih48_%&Boy17A}VtMxE|P>rhAk9A29@w^@pQDAAmV9-)kRe_1cHe+syZE=FgkV_w~>5 z^IPK{l!@crZeu(;-lunmmW&JoBf}C&_Sk^j99l9m49w56p&II+qsyV_jt)ck%9Zuj zMyK0tTsg9VLo0@Sq<;>ssHz;Ps$4ZyIW|?fYI8HTxmh*28S9@bRtIQ0SB%y5_$tlI z@iDzSylSg_Y<`bEBuIAj5(!@<;maX>=w_40JM_}Wa+~I>)bo;&b@bI|TIdQ69 zwZFByH+yUATY$)*(d_g##z%19=#7WBH3ll!>Er4tMqIp-F$)#2V^1Ta7Cr zXK%bSYTONhMq{VZ7^p`b6;O{lI;0+r-J`J&4fIP@zylLh@melk!;|*?BTcFZwi?4m z&!#%Q0e!P7-X$&Ql9BMDz5!!ZqTOysNz?TS;(=p21O!cXTRST5##ob#Iz1&0>cZq? zuhHnOZ<$A1{f?@jVWTlp6!xdr?`Yf%8@rum!v_bAqlhy?*{CtZg@>JX@0j909t>K& z^~+^?Q=vE0^rm_bO4Dr(hsWuIx-Rn}>S}Pe#%8BeFV_Kb6`DR#R$#BxPM&F1652I9+RQmb)7NOk^aR68!9|i1FT?vnYU;lV6JO+~e z;c-jqgC}^KYv<%N<7=q;K zQiu$Y`p6d>s{7Gp2~;cWMDGW>talvdRfX?txjR)2ZFi$ywf!q~*NePc_wTO4J5-z_ zR9v>*jiTH3uQZp-?wyLb;%?Nd6(3Q(nxn7gBCi(RD;00#ZWN1AB;E#nwGnxx3Q0G6 z#bVFhC>DE>cuo4M8F{tqUMUulTn*@(uDemphn|DFTlRN~#n44mH<33>?u{Z^ioCk$ zUVRN-nJVA+#EYZwb-95YHVp0tB;2%N)fo+1ds`|g-G8oidYzG~W7CQ1TNP;sZQlH@ z*xz0IJG8$&``fj@Bl|nhUHuNSuYs!qYo?{>;G!M?c7Tn6C1@IgE&HIo*47W&YiOiO zg!Yg-Xz&xYubC0B=Fobl!}$=e}U;8otz5TAxN=TeIFj7&$6+0b$e5>l-TMu z8UVU3)$(-6KScjzUaK@*sHxkXiHOIlhV6}!aC>cAOS*04!o5j)d(HC06Pp|LtL3}w z1n8-d74xcN2k-CNtU_a=coo7+8Gp?jD$C}GiK znSw&VP&O@`nzq33YqHZs;wp)zWz__M$_*k|9_ZtYRJ%4?yO2Vqf?va97d*@ZTMN6M z!k}T-G6e_0u0Um)J zJX2+=;u+D0mOXym1Jfjj7H;@;FHBVrZSL{wUYLp-+EN(WL_q07Dq&T*L&%~882T=B zXbaoH+*O7uBt_wHqYA{_FWO&|tG1bPt8NP|!`v8P`&slbJRO*z8f_5tF*d^E;Z_Jk z7C)7?k5xKtMXTo3Y9P`#`cAz9c*83NEOV#ED0AoOkPdli?mQb+bpA%QOMinR4GE}j zD7->539s~xPYj(1NzB~omkK@O9%kk$fNtMZ@ro_`6IX~er09QZXD*tLC8 z7cW%(;@3v$s`jn8Ba0)`<*0#eO)oxojKHco5Y!T>l}353Vt%I8Pi0O2l-H{2ZhEbH z<@IU}+gNER8^izn53CN#(r^U-PefSlwS6R>D2=y-&iji9{|j{Qvh*cHgKAqS73Try zzJ)j{jv{j-a%+Yr7aE|m^IGyEKc?-aj*=WiBoM))n_9}xb$_&nbJqkKb2 zLWlQ8m^9ubKLGxRkkT>y3#s=y8~1BE8SD4Hq~v6da!u7 zG?AVUAJbIM7DFvDA@2qm!7ycXbnqG+Z&EHOHapjSbElAZ)>yk?Ascnap?s%WtH12b@-^h8i`D)srpoT zR#)YW$d$_>9X_nD*h!4%%Ic&_{wUBMg=LwV}T$%N9b`rwCh8UH=$!)#8CBnP$TZq;PVLN^9T^4o_!9n@C>2P zn$WT9U@fb_%5^O)SU1C_)PoJ^aX8ueOjw9sR(eC}?XWO?sPs`-K)z7=ccIX8P<$D* zpVguNav^!phYtA=_RE`i^6P!*-aa(tLs$FI_xsSa4^@2#d-E;72l>#l58dcP*tc)v zt@%*Phc5ZhPy5g_P3Y)$>AtA{oAi$1+e(jtRqh$Ez`dmOy3$)q?}KISBd{TTzVsE? zB9FnsH3iF671pS;urfUimZLq`gPs6e&$D31d4(>YJHgkK_j7&dc|P=fAHqol8}Efa z^dcX6u@Ak(hhFMKFY}?7`w&hdSbnecp;!6Pt9|G-KJ;22dYuow-iOd*S$=Qyp*Q)^ zulW#8LD+bz?=v}nix1&kg?;umA9}kFy~Bsz=|k`Gp?CYxZ~D-COz3VOgq`<+Xti&E z#q`s#HeL&h-s50bdzJV!EKv7@wdhH(l)ML4jISJ6I`D!6A3ivB@F@phaqvyBCtry+ zc2B8zUXqI6?KpoS(N2z{kA{7QYQek2TJmP5A&7kHo0s zenb8ct}Qu(>$W_lW2n;n5rj68CtsGKhUF~YHRUz9uFKQ7Zpe9DTk;I9n{p1<9eEbl zTjdRqXq&V%t`E}nb5HC!n8H|cKe>Wfx5)FjHsunooASZ9w&ev}dvX=mTXo$& zMBPW~=_Wk6Szg3-L*9&QOWva5$cL-6G|ijUy+$bTgIx?Kuw&tY7^}~g7E3EqwYR2J zZEanucD5lOf$OGh;M$f=T({%~uG?}G*B#l$wI{d0eOY#JT}vsOF5)dqHR7zwZCr1W zJzUqMYQasZ+H6bqac#>zT({({xb8?`0J5t2NGO{jp4}uzxL%a+!nG;KxNgeZaNUuY zaqVGuhmVi(=_K}G%*h|cn`QY(TyK$&!u8?u$8c@P$KcwQPr!9cJ{s2@`FLEvEFX*9 z+#7QM+h#&NtCoy0enb8^;w{T3;<_S#0@qvQlW=XyC*!&omdNFX3H7{yeUm@)vO3kJ_Y-B`MrNf(xwzi0r5KQR&)4tnAWxp7pZuhL;`)~t>Sr&&^|Jg${l>`l zBK`cuxEjvyR`)uMuhX$qtN%tHD*Mo@eZ1HB(ErnK4d2(Qr}A~U8om!C?_RIpy+OY- zv42%RxsJqnm40$gKT$HgMBUpud8vN)GF)%BPhPH{yh1-wv0tg~adP)|^bYqxzj9xU zMW+2P;>~At{y=L(kMp6Y`_M0&(1AJ7{{NiSycc}U*#15rdcP0-mJfZvhko0Ke#eJ? z*N1-3hkoCO{=kPm=tF<#Lm%>?Kk}hJ@u3g<(4YFypZUDI0$NbcW1$wX$SH4$07f+Gz)4xyENO`{tqrZu)E3n3u*aHWCLLhWmbN*L^ZqU!9 zeJ0gTC;de2m+A<$&Jbc3SB&=fm8HX&2i=IJ5%yMr*DYeLbO`gLR_SioQMFULO7yXh z>g&`VD)j6UF_yujgxS%c^v&2g_4v}g)$SHFx~r>$*_htTr6iCCmepP!rOiQ?OEG=0U> zmn&SV!@b6OOH)mIs%e(0b^Cg^v8&0dfoz&f?ACD~=hB)cm$g7xw z>w&b!k#6*{cVnQ*W&&BABf}{=we?8ToeXp{99?4z! zHRv0vfSW3d8*HZ2M3sP-DvOuVC6iJmAf?74WweEDVKW-HE1SsRVS?Sah^}o2dkF)L3xzI2!cdjfIHXNuv{-4j8Gk7-`))ZkYZZqloKB>MTaEA+dq3#H1Hs zQfFau>$o*k2cZpRfJ&W(O2hPb(*Y@U7AdnPnShcyi;`;$NkB-QMaXGG65vs1;W1}O z0yOF@H0Cu4#s^Tl*`9B-H*%w)R&INvQpkZ0+A@NJ8zOWNZH+ zh9uPfNw)THG9;n)PqMXtQInuIceQ_#t^Jz~NvQo(Z0$E;0NiPf{InFkxl8X9i-RU; z!#oPzxhG}uVABnAT6FB5nuSIKo4-3|2erv^0Ldv9B-)wBaJ@e;a~JgWK4BIu?Los% zdC=c`G8QonBV|C$DHbtJLlO{kibc%2CP9Di1!ECoCeG;Z9ZC5F3mH>v=&7kx{$M18RVR5I`ejEKurb(Y7kl~kjUY(|ffsiO$ zHA=D=z=&V#UA8&_H8KQo*{W#{`a7+j!$kQ6ffB#+8@AT{ zVpfe5Azii=Z**GNMb)uNHH;X6mTk?-GgyFP`2>Meoo&|r!Nw-E3|_5KK0z?WFA&>f z9Ik8a_QN!>e1hPLUoLk0Z8$^gLe*|+ndnW+{K_#LTeZ{#U;H9+&}w%SK3i5vNR+2# zem&WTYql^~EMw&Hb;hqOH(Kftrxlujj9*|X)hp`D>0iqPX8ckUio@Yp>qSkcS1uEz z@ykxFLX0sWXyX^5`W&OpHNhFb6x}sLW4TPg#ji%89B*J=zGt<$M8{g@*QL9i4IHvG z!V*PmnO~mTlctuGbX)u~73$z<`4X*bnP0M^HSc0{8KcLw;KESmVacyweRC%L3C6R) zf$hkU0q771P8(PzI@z*Y*`8ZCGrO|7G(UCv{0$e*FU~KnEKik_&1zt$HlNy}Bv^Ax z-W1ROrMxpXZRI6+dK??lW0RTB!j@70jBrG~<;@6vLGhESli%lTJTiIdm<)!Y`~B zNPb~C43z97dV%B@*26%_VrgMtegm2+{CayKmfwJ=3T97SS&!^+0!v~LnVqFAl7<6g zVxVLJb)FV50TjOuKTivo016gnCX?sm1x$3!6@FjBd6HR}7=32><@xz&)xgpih*?1G zj=Q7IUe_!;%dj^FS{730gSxT|qhp|C`=(V=Kd?InN)}41q<&y}43sRIR`=BpffOc5 zO!cnDN|~UFU)5ivQWI41Yx|Y0{=h6g%S3x!;TQOActyspjAqx4+gPvq!om!R$*r0L zTHS1!Xt68&GQUBxN|e}@3~T&&1raTFgC0vmLIa z!Z1s;*cHrbI6@~YK@w&(3>EwXY3D39p9D*o(=fDHK>11~itS2iCNG&j@!P3p zjh`&jlM@Ymh2K&IH$uu=nk6M26u+;^_@=Xzq;KN4RvCA8mXhF!-&tin;8{`vC|(0^ zo#t6m0w!MnemdYmtt5T5@_Ve-DJ7XV@%ne-+fR$ER+1rMcDN(%04+H|6utit@xke!r6#!IH)NgG&fzR2!4oCkSmTxF z%JHkEBOv3o=E_&Br6cI#b>_ystfeIA;uYq`Bdw(*=;Afz)`_hpCD7v4=GO16B_+7x zwdTfEuB8l!n&!3U#=EYi3|NAHNN#y+9r7AdqA{Q5HRjfbuO$r_n$DmvcUDEUvUDBQ zGUh=q4sqXX=!tH9n%AuxkI$Bp zAdlCr8z<40l3=gQVvqWjw)6yl*n_~7Idw&C=?N0C34x(E-m5Jo0Uy6T&N#fblmuq{ zCOPFJ+tLwyIo)~=xGO)~mJtD()3fJbbdJoqu}<|(kXO8S2_@0IPxG30;~(6JPqgmS zyw=^g6t|QFZM@c5-xKh107t-E+jO8PTi9dA6$TS|g3 zUK4Me(pyS`EnW>D@ndfp5ODF@_=xL!%YgJ~yi)$W+0jtJ%GLJ(ye__P3^Wz2S_2h3 zRxT0U5z)g>^Llvf$i;UFZ2kzAcs)Gz|8MAtHh!Ad#?wy*SbBmgUMFw9GGHkQs(5w0 z`7nW{B&g!m@#b3wmXg4U*TtL9A6QC)BVHFzzL;Ri37~j|Jo(6iB`3(@weri<^jE>E z)uWQv%MYWp1YNvRewp;pL?b`VYvhNNk|2uL$h&V)m~tXY`DtD$?><{$X$h)$o%{-w zn4pSR$&V-{K^3o&SKrgHvJyD)`grvT4ogRH#B1ZtS34{vK@qQvHy`@2lmtV(F5Z3{ zM3bros)sJGjJKZ?v7`h=yf)r^fy7dheu>`;Z$4ULDG7pj9lZX|i6tZe;??i^(%;iq}!{2hdnDCehn<-GpHkP(*b zgrDYh^Y*JmmNZ}r8#!2=gQ2Zi+5jlfvib&ikA_=z|MerwBj5_^Gj_8Nc-Su{S@Hlb zkh9{0+=IOo?I;7VK*{RWKxveV(_|Mr2-#JFBD9oL z8(-yD37|9wJEqAdc4#SC)vY3QloVF{@&J?rCoBaOzc2u0*HKa^@e2b`nx)V*@mGRu zW~xk=B*hOuJx7w}6z(+Hy$;1~mXd9_lBM|JC&);0$084y37F+4$cl2yk`g^U#Ld#o z+Kw^|d7#YF!tiAk(>RGH9;B=~67u5XQI?c~h@T&W6g`tAr6}U3$ePsC(%y)lCWCg{ zrAmRsPm>j;Pn32={5%5NE5#B&PX_6Vqoi2kr^$-a$x9ULl`20^2I-tllx|wD z^7CXx=@X^>5kFG~>7q-NLW!R$gL333DU$d(vZD0jQXsk6aSlZzcx^Z-D6;t3vZC}- zP-OA5WsvqZKOj*@zFKFCh{A~9f&o%| zN6V5@9PxWFRH}}W;)vgW0ZNx9(UfBgY?gVJ{xqc#m~LIK@;e`pY(sy}(o)l2ir>Hh zYW;m2OHA>^?_yBIl$v%{{7wc?>(9m5q$#Z2W`-MPm#$AfKdOi+HH8+xp8?e7vp_a& ziY|UjgQAX*6NJ_HeGMSjpT4tc6Oh&TO$Hz~U&=GoM1x+b@k=jI>ra$gVluC)@#o`I z(xk}gj`kXF+y}M&CZbK8K&{3b_jTgx^Qo4aK&|FXx9OXcK)qxeHQm=<<4u-|(zR;3 zvAxDyD?xhEB}xERXTZQoPvutG=kiG-quo+UaXdBP2RG|z+NxELaAk1j^i`BHc<*H-rxt3@zEqpN_wwa zrnNj43%;mG=T*zJoHw8NwMkQKWm?nYYmR-FWs0s$%X;-GVVf|8SEiM{BdrqMdZm_W zX^&49>r|`6(+o&6DSOPPYArbhR;C5M{_Lrp{8Wk48KjvP`L5tK;*zNn6?Zkx6kwD6T$CKZThQa57I&GEHNs*sNU+_j~qIOMe<{u9}jI&^X;EBvr;KdWtN0|Y_K zLfC$a+tLR3ovLSA5X0%dyb-DZ532<8 z)~Et3tTxQsr3$ccGs8@?SlxG9by(F+UJE4Z^kP*vgDt?rDafjB8e4#e)s$7;Ott_E zhetP=Ex^Jq?W=A&TZDxdqxiUP7yDH=r!63cUTe7K<)*ep`8Z^{*=;^PI}vqF)lG17 zGTDl8Db#(oV@&LvHJ>Q$xG4Eg$zX);#bqhfi{dNYR2NotCc=CsaYNv!-zc`-&`EWOg z^03?1^6_X!c@#qKpk=*BSDkl&d@^Vg?i&278*50_nc63stc~fGQWb*fj@PI0GjN-TYR(2wfQ3~O)|_YFyewASt|GtvATI~ISoRwba?)=F0Sfhq?KNvu zs5$=v`2=YDopLqjU?498*A$$CfxPs#Dc78vfxPstDLH2YdFfpZI%flU>0MJQW?X_= zz!zYlaT*M~1cioYs1)q(YQK>sUlAwNwN2jgP)B*nmsP-r*?2M5GrrX*Dg ze$$`d*psg$p_g%nHNU^700&p@`ZIG`OvmtH!_U(=q<*N;(?*QR8GUa99@lecm1POd?7Bd|Y`a+!~6nnm5 zxeZSF3PE%5GnJ2QU==MJ4D}Y5`fW^#2pmzckvkxu0Qz?Ge zQ{D`?ak`jEXwi2?Zr4-Z^j#BhC&BX42MoFcVfi?WLJkUbh9f`IDQ5Q>`5CJ_9+p>r zcSfjI%-Azp3q?@O&;t%;H$=^y7|WXl2Lg9)EGK>F2i@th+zi~T#2q5b$6&)9uBy3{ zWO?b`7K)lXP?nd0FTz4S;f6?jjY)Jy7e1}fi z^gWV`*<-?K$67H{3>f%nkvkTbHw&%~o$H3Y^j0BTbAFZc(mN13$I5x>!-(Qe_vPgP zAiEyTo$|}g!nbC3+AlAMQIMh78pR#ZtQE7a?D>J!d0ftygFSaxv*r#S=B2lL6l=w- zDto>&a`u$G={pR#(~EiO?JnS2G0V!HJ3Lw|W?6v&-)ErEunY!HAzRG0(sYaDx;x33 zuLPTJVpA_>TLHaY;M9v5SDLO7*WGE#ycw`HPc#9T*m~i! zP-um+>sn#mo$Jh31iS7ie%&4H%uVkwP|U2d>oHKwsseg1Kp}PZuCIY&W|dtxC#e@R ztL(a7pkBL>~upR6dH`X&M;FiW>)DsWmUbHRi*26 zMfG9_bh^G77Bi`U-n9aEP&!{b?s^m#JC@V+&A8Z^9PE^GYUjE;b)7EW>OhaDT*0Y1`!s8md;=iyiC;#npGlV6gp2Z+=}oh zWLrVo4DQjqzl?m~h>B5Y9o=4wR!gB}jAlYBrVvV-QBjH+T$EygR!%Xii{V0YRLt}O zoJ55wG@&$Hs4&Gq8|_Jo8e=vhrCVrd$J8Lgq!4g%QZUM;5OSeTjfheRxS9#6pJL`2 zWuv096f@EoE>xI89qqW+>aA-BFm-3Fndlr&ZA`T*;9|y^6+dAuW}I2^6Xs&ZnYoaD zAvmJPaC5z4=U#UGnyHv=2K08xF;mPqv+ImAGsTQEU6+BGVzwF32M&cg%C0vL%@i}w zpr^Hak7kP5XVgaXhV^bgQ_MiKL;8Rj=Xf*Uv;ZtZ2QX92OjBMnKHX-DS!v2^#-rOz zF&jT|BdVaoI+jYi%~hU7Rb_ z(Ka>_G|{e|pIup9nzzvwaQ3j%=uTbRAM6foWPKj-_|&=c=dWMAFm?6t#EI#vk1L5R zsZK4*W^ueTYDAbQU&L1jCfyS!svMIgoTk(~tQ>>At<5Nl8pq+h8#%MI2y0J0nGx$lYcILYz2FlgPssq(Zu zZVpGC5k5}U?>U+F2CZR~-zk<~e>gG>X|?YSM^VAbCpbo=xRXRfu}4KKmpP6Xyl6=b zA!3YSg=2{FM+L@fpcg5zGK=qP@x?+~=$p8YvWP)bH5c0;b<;6Tczk^4*nmS zGB0DS1!k4;TtmC4)g4K}~^k)CSm z!qWNE^UKR?dLHU-)QRflso8Vqrsfuw=1;FIoL`(ex3YA6VR7yB`Nfs_n^tr+x$x}r z+Vbi(%PR{jt19Yo+)U~I7(K4@ynXy33oB>iPtCDxQ{}7I#OSQk?KmMl(CsNzb|WIF zfxu-{_ojD2MwJ`EkZt2$J}&(ds?7=;%dS3Tz>;G!nnJIPbsRZtk}1^6zQa+&+m@&1 z3LM{>a$x%EAxoK9gV4^yO}xmp+kwo2!`19pU+`#Mr3vnRE_mUi4J%{zo#zJ6g{!-n zyP^ox0o+h`-bF>c^0c+WOCHU?HpgY*0Tlp&Zj^~Sg`0r~baCk{)Cw^Rk4bVE*RUD5 zsDq;EvZ&*B8JOr3mMO)mX4x57Xe&+{i;N{=4#%Z1iFT){2$`Eu8fyDMhO8`3V4+s7 z8CYn$TuMf?1|bWNNfoPHs%GG!H!`Nkp?7&^;W0@LwHYA;551QyMGkGm&B9}n9MLW` z6&=uir?y+Y;V^?7W>;NGX4LME3_SGi#1t0VwP*$&N@Jax8FiW<3y%pbGB(<%6x?8P z@~$6D(#BJ@mQ;H{QmP>~oJ{7DJ`alyC=r)j63I`}c8|^3{W7(*kt8-Hn9L#qFquobEYXR< zL@tP$B1?2xK9Na!-=ZvN8LJslQzVH^QYMO`;-;|CUeq!QqvEEpiOzN=3zNzO?6a0j zx+F{4nILLPcJ%koGM0*po5BVPnyeW@)D$M(A$mr6T>MGwFm25$m~ov+q~j)-r|$X* zrZEHVS5?^O$y2(h!o!*p6L{oc5)?!+)-#4 zvFhxS7^ioF2@Q~LxCY8JJRL;BPzfrFYV?BkF=e@Nhf@pnH5^)MMh2^(1+-aCKIz56Hn<3;($?1(#L3B-7zi+r~?!AbOQY2Jd!0*ii8|o z5^w`am<}bT9?%+qSPRf@1t&|gk4r*^jCaCZeDs=ozcdq;;<|=n(j-9H?9H20wlN+~ zalc;}_hv$EM^zq5s}W^zc+c3XSWoWw&>k-0|_TCDHFTwD_J z;~W^~;FD0W#)n}Z9?7Ci&>?BWVeUbSMa@KFHLN`uPLd(**PT0p!bwc;;_h-q;^S|gF`}v8n1-ec_fsC_Dh(9L!uNDRA(Ah z(Xzl@ygsyZ!t7Ec)W;$>K15|O_PQ7_*GV~vaY!gnuuxAY z^utjey(B5r!^|8K%2PWloWucoLDEy;E?yGa(_Ib@2_>OiwN1`PR0^du+b@QGI-xA0 zJQB)6yS$s26QoNDBcVc!x3x(;Ktxz1AWQpO%fTU`ER4&w>^u@`RXbhF!68u!u2!RE zkx-m)-ZmK*Q4R@ps-3@O&qu=25Ff73BZINc$9f!f0x;d0YG&yXTo}vxJ}#3C?nzvX z^>ja*s8uz(M@93A>e*NJH@7`?ynIr*MmZ$lT)Q&M&LIIE+L>5(4$2@9D~dgJMm#%* zgk`FBsFs~W0=~3Mv56d_y-t!4`ryhW9+--eUMFGVsojEQ=aA52XvbhVI3)BK#y41Y z9tlO!-Vht zuk2jxuB3fzChk_!BMEXqP@bR$(_XkHNfPCdpuW<6xUzFd7|paNvg{n@_KzgmmsfTU z39Vh9z01x)&#hwhVGhq_=aJCTv`?`d91>cZaVwUcM?x#nj>WQbNN6S6H{2u+Lr6}5 znWP!Q7C8NQ!kS_qmxS`rY?!_$#wP(D;G&*pmnESi1`qW#JCB5_0T1;wJCB6Q0T1Hx9nC z^GE=?cF~ocLsD1B^@P!~Ol&B?WE?N@G91I9Z}ydqQW(?)!*xNWd36 z&P6#S)GXVBML8tYEIYRJ-xb26+DMTn@6~cH#JuEDgNczPgl$%O|2mN) zm5DO`rkmxWR@+o2`fG71nL%^TB8UD;R0<2=HVX^=MTs;P(bk!o6F4ABFAeBIh#bjP z>pUr?$Ps0cDu({bOd5-fS%KvtJuB!U*{nDRb18B}S)^vAH$jT1>MfOpcJQAf1$t_d zkyIAiKYR*{==RX$YIRPWvav|zVP7QA>M>+w$%^)oog&9Dij8DBhR(xWHYTZM3O?xo zi_TI~1hHOm(&Wfi9@?vF3X3eo!IVang>~;2AB$i1c4Clp>DXQbqWrmX3)#0dsm2QWj43`=}{08IM(ACY34> zB2JJ-&xVOK$pwvAlUspui5F=IDSQxZG9zu4C-S6b%YNi6rF67`gs@2#2eCM5V!4{Y z$G%F&q1h@x1e%nuNexUn*~?JS#uwjCqcKRs^nOMudDB%kF>~7VPx6+`NEwrJu}Li= z#VNf{H{V?g4I@n&W)2i*GeMe3^B{e;nk}2)e>4Tp#$dtoVcXY!M#<%);yGV#DKcSX z%>qRgZF0r$XOt|H;WQCL#{D~2`N~Cjj19M>giE@wzRQ#7WHl@uW6Fx2@-CiQDUseG zl?Tc)ok>hRnaX5&5|ilMDwT(Jm7bEB=&UA{MN|r|Ca3R;nuO+`G}bibz|NX~lRRu> zJZ`_U#W9L5)_tlmV6|B`(HcqR!^#uen4iW7^D_S`xrAc-$9?Qr&M+(UuhJN0%bQX~ zFs!2b2p>5n(l*N`n?T#FJh9#6X#!yrw||vfMo{f%K=lgCCR@hf_=b@O2JH;;%&}~; z$uq~w6V)Pl;bRrQ$jPJZ6dCe`Ik!(DxxS)$93MF*&j!mTn>?6N`XrL&iH>hRa!j5c z#|Czl48^m@vdNY$e7e$0nw+hug2+dXWvj`u$tDkGW=Se4tctUMPp$#apD#~r}W&~KQinHXk+wmGf8pP_|Asuc^4q`%5bj()G@ zd(vUIG2HTZqf7m$4IWX|&V|HfM>?C${ul}f3T4E-b=(+?TFHuu(bk}qCewaqI<{p8 zFTSpQaRqyq_}y&n_`-}9Exf&Mj62a%!87Ic+~*)_X`94K`O%FOux4ew4}(q2fvQT` zwSj$NCGk@3(7jk(!G87qf-ZRJuZw1T0r#%{N$H*Q@pn5L8-4f>r(is%pCpilLfVc} zba0;#zdJFRZX}s~g?MIZVQ%fhh4~w%DkqL#Sejp+UtF10K7!4|nac4C7tSv)s3!}H nXUxNLwR-&Y4YL>4u06kW!|cjbdFsT}iO7>_JgX|N@5lca($tv3 literal 0 HcmV?d00001 diff --git a/packages/marvel/stubs/resources/js/app.js b/packages/marvel/stubs/resources/js/app.js new file mode 100644 index 0000000..40c55f6 --- /dev/null +++ b/packages/marvel/stubs/resources/js/app.js @@ -0,0 +1 @@ +require('./bootstrap'); diff --git a/packages/marvel/stubs/resources/js/bootstrap.js b/packages/marvel/stubs/resources/js/bootstrap.js new file mode 100644 index 0000000..6922577 --- /dev/null +++ b/packages/marvel/stubs/resources/js/bootstrap.js @@ -0,0 +1,28 @@ +window._ = require('lodash'); + +/** + * We'll load the axios HTTP library which allows us to easily issue requests + * to our Laravel back-end. This library automatically handles sending the + * CSRF token as a header based on the value of the "XSRF" token cookie. + */ + +window.axios = require('axios'); + +window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; + +/** + * Echo exposes an expressive API for subscribing to channels and listening + * for events that are broadcast by Laravel. Echo and event broadcasting + * allows your team to easily build robust real-time web applications. + */ + +// import Echo from 'laravel-echo'; + +// window.Pusher = require('pusher-js'); + +// window.Echo = new Echo({ +// broadcaster: 'pusher', +// key: process.env.MIX_PUSHER_APP_KEY, +// cluster: process.env.MIX_PUSHER_APP_CLUSTER, +// forceTLS: true +// }); diff --git a/packages/marvel/stubs/resources/lang/de/common.php b/packages/marvel/stubs/resources/lang/de/common.php new file mode 100644 index 0000000..114a5d8 --- /dev/null +++ b/packages/marvel/stubs/resources/lang/de/common.php @@ -0,0 +1,6 @@ + 'Bestellung ansehen', + 'thanks' => 'Vielen Dank', + 'view-refund' => 'Rückerstattung ansehen', +]; diff --git a/packages/marvel/stubs/resources/lang/de/message.php b/packages/marvel/stubs/resources/lang/de/message.php new file mode 100644 index 0000000..19937c9 --- /dev/null +++ b/packages/marvel/stubs/resources/lang/de/message.php @@ -0,0 +1,4 @@ + 'Welcome', +]; diff --git a/packages/marvel/stubs/resources/lang/de/order.php b/packages/marvel/stubs/resources/lang/de/order.php new file mode 100644 index 0000000..88af293 --- /dev/null +++ b/packages/marvel/stubs/resources/lang/de/order.php @@ -0,0 +1,76 @@ + [ + 'admin' => [ + 'message' => 'Order has been cancelled with order tracking number :tracking_number', + 'subject' => 'Order has been cancelled', + ], + 'customer' => [ + 'message' => 'Your order has been cancelled and tracking number :tracking_number', + 'subject' => 'Your order has been cancelled', + ], + 'storeOwner' => [ + 'message' => 'Dear shop owner,Order has been cancelled with order tracking number :tracking_number', + 'subject' => 'Order has been cancelled', + ], + 'childOrderCustomer' => [ + 'message' => 'Dear shop owner,Order has been cancelled with order tracking number :tracking_number', + 'subject' => 'Order has been cancelled', + ], + ], + 'orderCreated' => [ + 'admin' => [ + 'message' => 'New order has been placed by :customer_name with order tracking number :tracking_number', + 'subject' => 'New order has been placed', + ], + 'customer' => [ + 'message' => 'Your order has been placed successfully with order tracking number :tracking_number', + 'subject' => 'Your order has been placed successfully', + ], + 'storeOwner' => [ + 'message' => 'Dear shop owner,New order has been placed by :customer_name with order tracking number :tracking_number', + 'subject' => 'New order has been placed', + ], + 'childOrderCustomer' => [ + 'message' => 'Dear shop owner,New order has been placed by :customer_name with order tracking number :tracking_number', + 'subject' => 'New order has been placed', + ], + ], + 'deliverOrder' => [ + 'admin' => [ + 'message' => 'Order has been delivered by :customer_name with order tracking number :tracking_number', + 'subject' => 'Order has been delivered', + ], + 'customer' => [ + 'message' => 'Your order has been delivered successfully with order tracking number :tracking_number', + 'subject' => 'Your order has been delivered successfully', + ], + 'storeOwner' => [ + 'message' => 'Dear shop owner,Order has been delivered by :customer_name with order tracking number :tracking_number', + 'subject' => 'Order has been delivered', + ], + 'childOrderCustomer' => [ + 'message' => 'Dear shop owner,Order has been delivered by :customer_name with order tracking number :tracking_number', + 'subject' => 'Order has been delivered', + ], + ], + 'statusChangeOrder' => [ + 'admin' => [ + 'message' => 'Order status has been changed by :customer_name with order tracking number :tracking_number', + 'subject' => 'Order status has been changed', + ], + 'customer' => [ + 'message' => 'Your order status has been changed successfully with order tracking number :tracking_number', + 'subject' => 'Your order status has been changed successfully', + ], + 'storeOwner' => [ + 'message' => 'Dear shop owner,Order status has been changed by :customer_name with order tracking number :tracking_number', + 'subject' => 'Order status has been changed', + ], + 'childOrderCustomer' => [ + 'message' => 'Dear shop owner,Order status has been changed by :customer_name with order tracking number :tracking_number', + 'subject' => 'Order status has been changed', + ], + ], + +]; diff --git a/packages/marvel/stubs/resources/lang/de/sms.php b/packages/marvel/stubs/resources/lang/de/sms.php new file mode 100644 index 0000000..3b103f0 --- /dev/null +++ b/packages/marvel/stubs/resources/lang/de/sms.php @@ -0,0 +1,111 @@ + [ + 'cancelOrder' => [ + 'admin' => [ + 'message' => 'Die Bestellung wurde mit der Bestellverfolgungsnummer :ORDER_TRACKING_NUMBER storniert', + 'subject' => 'Bestellung wurde storniert', + ], + 'customer' => [ + 'message' => 'Die Bestellung wurde mit der Bestellverfolgungsnummer :ORDER_TRACKING_NUMBER storniert', + 'subject' => 'Bestellung wurde storniert', + ], + 'storeOwner' => [ + 'message' => 'Sehr geehrter Shop-Inhaber, die Bestellung wurde mit der Auftragsverfolgungsnummer :ORDER_TRACKING_NUMBER storniert', + 'subject' => 'Bestellung wurde storniert', + ], + ], + 'orderCreated' => [ + 'admin' => [ + 'message' => 'Eine neue Bestellung wurde von :customer_name mit der Auftragsverfolgungsnummer :ORDER_TRACKING_NUMBER aufgegeben', + 'subject' => 'Neue Bestellung wurde aufgegeben', + ], + 'customer' => [ + 'message' => 'Ihre Bestellung wurde erfolgreich mit der Auftragsverfolgungsnummer :ORDER_TRACKING_NUMBER aufgegeben', + 'subject' => 'Ihre Bestellung wurde erfolgreich aufgegeben', + ], + 'storeOwner' => [ + 'message' => 'Sehr geehrter Shop-Inhaber, eine neue Bestellung wurde von :customer_name mit Auftragsverfolgungsnummer :ORDER_TRACKING_NUMBER aufgegeben', + 'subject' => 'Neue Bestellung wurde aufgegeben', + ], + ], + 'deliverOrder' => [ + 'admin' => [ + 'message' => 'Die Bestellung wurde mit der Sendungsverfolgungsnummer :ORDER_TRACKING_NUMBER geliefert', + 'subject' => 'Bestellung wurde geliefert', + ], + 'customer' => [ + 'message' => 'Ihre Bestellung wurde erfolgreich mit der Auftragsverfolgungsnummer :ORDER_TRACKING_NUMBER geliefert', + 'subject' => 'Ihre Bestellung wurde erfolgreich geliefert', + ], + 'storeOwner' => [ + 'message' => 'Sehr geehrter Shop-Inhaber, die Bestellung wurde erfolgreich mit der Bestellverfolgungsnummer :ORDER_TRACKING_NUMBER geliefert', + 'subject' => 'Bestellung wurde geliefert', + ], + + ], + 'statusChangeOrder' => [ + 'admin' => [ + 'message' => 'Der Bestellstatus wurde in :order_status mit der Bestellverfolgungsnummer :ORDER_TRACKING_NUMBER geändert', + 'subject' => 'Bestellstatus wurde geändert', + ], + 'customer' => [ + 'message' => 'Ihr Bestellstatus wurde in :order_status mit der Bestellverfolgungsnummer :ORDER_TRACKING_NUMBER geändert', + 'subject' => 'Ihr Bestellstatus wurde geändert', + ], + 'storeOwner' => [ + 'message' => 'Sehr geehrter Shop-Inhaber, der Bestellstatus wurde in :order_status mit der Bestellverfolgungsnummer :ORDER_TRACKING_NUMBER geändert', + 'subject' => 'Bestellstatus wurde geändert', + ], + ], + 'paymentSuccessOrder' => [ + 'admin' => [ + 'message' => 'Die Zahlung der Bestellung war erfolgreich mit der Bestellverfolgungsnummer :ORDER_TRACKING_NUMBER', + 'subject' => 'Die Zahlung der Bestellung war erfolgreich', + ], + 'customer' => [ + 'message' => 'Ihre Bestellung wurde mit der Sendungsverfolgungsnummer :ORDER_TRACKING_NUMBER erfolgreich bezahlt', + 'subject' => 'Die Zahlung Ihrer Bestellung war erfolgreich', + ], + 'storeOwner' => [ + 'message' => 'Sehr geehrter Ladenbesitzer, die Zahlung der Bestellung war erfolgreich mit der Bestellverfolgungsnummer :ORDER_TRACKING_NUMBER', + 'subject' => 'Die Zahlung der Bestellung war erfolgreich', + ], + ], + 'paymentFailedOrder' => [ + 'admin' => [ + 'message' => 'Die Zahlung der Bestellung ist mit der Bestellverfolgungsnummer :ORDER_TRACKING_NUMBER fehlgeschlagen', + 'subject' => 'Die Zahlung der Bestellung ist fehlgeschlagen', + ], + 'customer' => [ + 'message' => 'Die Zahlung der Bestellung ist mit der Bestellverfolgungsnummer :ORDER_TRACKING_NUMBER fehlgeschlagen', + 'subject' => 'Die Zahlung der Bestellung ist fehlgeschlagen', + ], + 'storeOwner' => [ + 'message' => 'Die Zahlung der Bestellung ist mit der Bestellverfolgungsnummer :ORDER_TRACKING_NUMBER fehlgeschlagen', + 'subject' => 'Die Zahlung der Bestellung ist fehlgeschlagen', + ], + ], + 'refundRequested' => [ + 'admin' => [ + 'message' => 'Der Kunde hat eine Rückerstattung mit der Auftragsverfolgungsnummer :ORDER_TRACKING_NUMBER angefordert', + 'subject' => 'Rückerstattung beantragt', + ], + 'customer' => [ + 'message' => 'Ihr Erstattungsantrag wurde erfolgreich mit der Auftragsverfolgungsnummer :ORDER_TRACKING_NUMBER gesendet', + 'subject' => 'Ihre Rückerstattungsanfrage wurde erfolgreich übermittelt', + ], + ], + 'refundStatusChange' => [ + 'admin' => [ + 'message' => 'Der Rückerstattungsstatus wurde in :refund_status mit Auftragsverfolgungsnummer :ORDER_TRACKING_NUMBER geändert', + 'subject' => 'Der Rückerstattungsstatus wurde geändert', + ], + 'customer' => [ + 'message' => 'Ihr Rückerstattungsstatus wurde in :refund_status mit Auftragsverfolgungsnummer :ORDER_TRACKING_NUMBER geändert', + 'subject' => 'Ihr Rückerstattungsstatus wurde geändert', + ], + ], + ] +]; diff --git a/packages/marvel/stubs/resources/lang/en/common.php b/packages/marvel/stubs/resources/lang/en/common.php new file mode 100644 index 0000000..6db36a9 --- /dev/null +++ b/packages/marvel/stubs/resources/lang/en/common.php @@ -0,0 +1,6 @@ + 'View order', + 'thanks' => 'Thanks', + 'view-refund' => 'View refund', +]; diff --git a/packages/marvel/stubs/resources/lang/en/message.php b/packages/marvel/stubs/resources/lang/en/message.php new file mode 100644 index 0000000..19937c9 --- /dev/null +++ b/packages/marvel/stubs/resources/lang/en/message.php @@ -0,0 +1,4 @@ + 'Welcome', +]; diff --git a/packages/marvel/stubs/resources/lang/en/sms.php b/packages/marvel/stubs/resources/lang/en/sms.php new file mode 100644 index 0000000..21dcb2b --- /dev/null +++ b/packages/marvel/stubs/resources/lang/en/sms.php @@ -0,0 +1,110 @@ + [ + 'cancelOrder' => [ + 'admin' => [ + 'message' => 'Order has been cancelled with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Order has been cancelled', + ], + 'customer' => [ + 'message' => 'Your order has been cancelled and tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Your order has been cancelled', + ], + 'storeOwner' => [ + 'message' => 'Dear shop owner,Order has been cancelled with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Order has been cancelled', + ], + ], + 'orderCreated' => [ + 'admin' => [ + 'message' => 'New order has been placed by :customer_name with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'New order has been placed', + ], + 'customer' => [ + 'message' => 'Your order has been placed successfully with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Your order has been placed successfully', + ], + 'storeOwner' => [ + 'message' => 'Dear shop owner,New order has been placed by :customer_name with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'New order has been placed', + ], + ], + 'deliverOrder' => [ + 'admin' => [ + 'message' => 'Order has been delivered successfully with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Order has been delivered', + ], + 'customer' => [ + 'message' => 'Your order has been delivered successfully with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Your order has been delivered successfully', + ], + 'storeOwner' => [ + 'message' => 'Dear shop owner,Order has been delivered successfully with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Order has been delivered', + ], + + ], + 'statusChangeOrder' => [ + 'admin' => [ + 'message' => 'Order status has been changed to :order_status with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Order status has been changed', + ], + 'customer' => [ + 'message' => 'Your order status has been changed to :order_status with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Your order status has been changed', + ], + 'storeOwner' => [ + 'message' => 'Dear shop owner,Order status has been changed to :order_status with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Order status has been changed', + ], + ], + 'paymentSuccessOrder' => [ + 'admin' => [ + 'message' => 'Order payment has been successful with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Order payment has been successful', + ], + 'customer' => [ + 'message' => 'Your order payment has been successful with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Your order payment has been successful', + ], + 'storeOwner' => [ + 'message' => 'Dear shop owner,Order payment has been successful with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Order payment has been successful', + ], + ], + 'paymentFailedOrder' => [ + 'admin' => [ + 'message' => 'Order payment has been failed with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Order payment has been failed', + ], + 'customer' => [ + 'message' => 'Your order payment has been failed with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Your order payment has been failed', + ], + 'storeOwner' => [ + 'message' => 'Dear shop owner,Order payment has been failed with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Order payment has been failed', + ], + ], + 'refundRequested' => [ + 'admin' => [ + 'message' => 'Customer has requested for refund with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Refund requested', + ], + 'customer' => [ + 'message' => 'Your refund request has been submitted successfully with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Your refund request has been submitted successfully', + ], + ], + 'refundStatusChange' => [ + 'admin' => [ + 'message' => 'Refund status has been changed to :refund_status with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Refund status has been changed', + ], + 'customer' => [ + 'message' => 'Your refund status has been changed to :refund_status with order tracking number :ORDER_TRACKING_NUMBER', + 'subject' => 'Your refund status has been changed', + ], + ], + ] +]; diff --git a/packages/marvel/stubs/resources/views/emails/contact-admin.blade.php b/packages/marvel/stubs/resources/views/emails/contact-admin.blade.php new file mode 100644 index 0000000..353172a --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/contact-admin.blade.php @@ -0,0 +1,10 @@ +@component('mail::message') +# {{$details['subject']}} + +Email: {{$details['email']}} + +{{$details['description']}} + +Thanks,
+{{ $details['name'] }} +@endcomponent \ No newline at end of file diff --git a/packages/marvel/stubs/resources/views/emails/forget-password.blade.php b/packages/marvel/stubs/resources/views/emails/forget-password.blade.php new file mode 100644 index 0000000..fe0100c --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/forget-password.blade.php @@ -0,0 +1,10 @@ +@component('mail::message') +# Password Reset Token + +Please copy the below token to reset your password. + +```{{$token}}``` + +Thanks,
+{{ config('app.name') }} +@endcomponent \ No newline at end of file diff --git a/packages/marvel/stubs/resources/views/emails/maintenance/reminder.blade.php b/packages/marvel/stubs/resources/views/emails/maintenance/reminder.blade.php new file mode 100644 index 0000000..10ccb83 --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/maintenance/reminder.blade.php @@ -0,0 +1,10 @@ + +@component('mail::message') +# Maintenance Reminder Email +Message: Due to our regular site maintenance, this site will be down from {{ $start }} to {{ $until }}. We apologize for any inconvenience caused during this period.
+@component('mail::button', ['url' => $url ]) + View dashboard +@endcomponent +Thanks,
+{{ config('app.name') }} +@endcomponent diff --git a/packages/marvel/stubs/resources/views/emails/maintenance/shop-maintenance.blade.php b/packages/marvel/stubs/resources/views/emails/maintenance/shop-maintenance.blade.php new file mode 100644 index 0000000..5d5bf44 --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/maintenance/shop-maintenance.blade.php @@ -0,0 +1,15 @@ +@component('mail::message') + +# {{$message }} + +Message: {{ $body }}. + +We apologize for any inconvenience caused during this period.
+ +@component('mail::button', ['url' => $url ]) +View shop +@endcomponent + +Thanks,
+{{ config('app.name') }} +@endcomponent \ No newline at end of file diff --git a/packages/marvel/stubs/resources/views/emails/order/order-cancelled.blade.php b/packages/marvel/stubs/resources/views/emails/order/order-cancelled.blade.php new file mode 100644 index 0000000..31fb3d1 --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/order/order-cancelled.blade.php @@ -0,0 +1,15 @@ +{{--$order collection is available here--}} + +@component('mail::message') +# {{ __('sms.order.cancelOrder.admin.subject') }} + +{{ __('sms.order.cancelOrder.admin.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number]) }} + + +@component('mail::button', ['url' => $url ]) + {{__('common.view-order')}} +@endcomponent + +{{__('common.thanks')}},
+{{ config('app.name') }} +@endcomponent \ No newline at end of file diff --git a/packages/marvel/stubs/resources/views/emails/order/order-delivered.blade.php b/packages/marvel/stubs/resources/views/emails/order/order-delivered.blade.php new file mode 100644 index 0000000..8427a6c --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/order/order-delivered.blade.php @@ -0,0 +1,15 @@ +{{--$order collection is available here--}} + +@component('mail::message') +# {{ __('sms.order.deliverOrder.admin.subject') }} + +{{ __('sms.order.deliverOrder.admin.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number]) }} + + +@component('mail::button', ['url' => $url ]) + {{__('common.view-order')}} +@endcomponent + +{{__('common.thanks')}},
+{{ config('app.name') }} +@endcomponent diff --git a/packages/marvel/stubs/resources/views/emails/order/order-invoice.blade.php b/packages/marvel/stubs/resources/views/emails/order/order-invoice.blade.php new file mode 100644 index 0000000..02db510 --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/order/order-invoice.blade.php @@ -0,0 +1,360 @@ + + + + + + + Order Invoice + + @if($language === "bd") + + @endif + + + + +{{--$order collection is available here--}} + +@component('mail::message') +# {{ __('sms.order.orderCreated.customer.subject') }} + +{{ __('sms.order.orderCreated.customer.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number]) }} + + +@component('mail::button', ['url' => $url ]) + {{__('common.view-order')}} +@endcomponent + +{{__('common.thanks')}},
+{{ config('app.name') }} +@endcomponent + + +
+ + @php + $contactDetails = $settings->options['contactDetails']; + $customer = $order->customer; + $shippingAddress = $order->shipping_address; + $products = $order->products; + $settings = $settings->options; + $authorDetails = $settings['contactDetails']; + $authorLocation = $authorDetails['location']; + $currency = isset($settings['currency']) ? $settings['currency']: 'USD'; + + if($order->parent_id) { + $parentOrder = $order->parent; + }else{ + $parentOrder = $order; + } + $cancelled_products = []; + foreach ($parentOrder->children as $childOrder) { + if($childOrder->order_status == 'order-cancelled') { + foreach ($childOrder->products as $product) { + $cancelled_products[] = $product->id; + } + } + } + + @endphp + +
+
+ @if(isset($translated_text['invoice_no']) || isset($order->tracking_number) ) +

{{ $translated_text['invoice_no'] }}: {{ $order->tracking_number }}

+ @endif + @if(isset($translated_text['delivery_time']) || isset($order->delivery_time) ) +

{{ isset($translated_text['payment_method']) ? $translated_text['payment_method'] : 'Payment Method' }}: {{ $order->payment_gateway }}

+ @endif +
+
+ @if(isset($translated_text['date'])) + {{ $translated_text['date'] }}: {{date("jS F, Y")}} + @endif +
+
+
+ +
+ +
+
    + @if(isset($customer['name']))
  • +
    {{$customer['name']}}
    +
  • @endif + + @if(isset($customer['email']))
  • +
    {{$customer['email']}}
    +
  • @endif + + @if(isset($order->customer_contact)) +
  • +
    {{$order->customer_contact}}
    +
  • + @endif + +
  • +
      + @if(isset($shippingAddress['street_address'])) +
    • {{$shippingAddress['street_address']}} +
    • + @endif + + @if(isset($shippingAddress['city'])) +
    • {{$shippingAddress['city']}}
    • + @endif + + @if(isset($shippingAddress['state'])) +
    • {{$shippingAddress['state']}}
    • + @endif + + @if(isset($shippingAddress['zip'])) +
    • {{$shippingAddress['zip']}}
    • + @endif + + @if(isset($shippingAddress['country'])) +
    • {{$shippingAddress['country']}} + @endif +
    +
  • +
+ +
    + @if(isset($settings['siteTitle'])) +
  • +
    {{$settings['siteTitle']}}
    +
  • + @endif + + @if(isset($authorDetails['website'])) +
  • +
    {{$authorDetails['website']}}
    +
  • + @endif + + @if(isset($authorDetails['contact'])) +
  • +
    {{$authorDetails['contact']}}
    +
  • + @endif + + @if(isset($authorLocation['formattedAddress'])) +
  • +
    {{$authorLocation['formattedAddress']}}
    +
  • + @endif +
+
+
+ +
+ + @if(isset($translated_text['products']) || isset($translated_text['quantity']) || isset($translated_text['total']) ) +
    + @if(isset($translated_text['products'])) +
  • +
    + {{ $translated_text['products'] }} +
    +
  • + @endif + + @if(isset($translated_text['quantity'])) +
  • +
    + {{ $translated_text['quantity'] }} +
    +
  • + @endif + + @if(isset($translated_text['total'])) +
  • +
    + {{ $translated_text['total'] }} +
    +
  • + @endif +
  • +
+ @endif + + @if (!empty($products)) + @foreach ($products as $product) +
    +
  • +
    + {{$product['name']}} + @if(in_array($product->id,$cancelled_products)) + {{ $translated_text['cancelled'] ?? "Cancelled"}} + @endif +
    +
  • +
  • +
    + {{$product->pivot['order_quantity']}} +
    +
  • +
  • +
    + @money($product->pivot['unit_price'], $currency) +
    +
  • +
  • +
+ @endforeach + @endif + +
+ +
+
+
+ @if(isset($order->amount)) +
+
{{ $translated_text['subtotal'] + }} :
+
+ @money($order->amount, $currency) +
+
+
+ @endif + + @if(isset($order->discount)) +
+
{{ $translated_text['discount'] + }} :
+ +
@money($order->discount, + $currency)
+
+
+ @endif + + @if(isset($order->sales_tax)) +
+
{{ $translated_text['tax'] + }} :
+ +
@money($order->sales_tax+$order->cancelled_tax, + $currency)
+
+
+ @endif + + @if(isset($order->delivery_fee)) +
+
{{ $translated_text['delivery_fee'] + }} :
+ +
+ @money($order->delivery_fee+$order->cancelled_delivery_fee, + $currency)
+
+
+ @endif + + @if(isset($order->cancelled_amount) && $order->cancelled_amount > 0 && $order->cancelled_tax > 0) +
+
+ {{(isset($translated_text['cancelled_tax'])) ? $translated_text['cancelled_tax'] : "Tax reduced"}} :
+ +
+ - @money($order->cancelled_tax, + $currency)
+
+
+ @endif + @if(isset($order->cancelled_amount) && $order->cancelled_amount > 0 && $order->cancelled_delivery_fee > 0) +
+
+ {{(isset($translated_text['cancelled_delivery_fee'])) ? $translated_text['cancelled_delivery_fee'] : "Delivery fee reduced"}} :
+ +
+ - @money($order->cancelled_delivery_fee, + $currency)
+
+
+ @endif + + @if(isset($order->cancelled_amount) && $order->cancelled_amount > 0) +
+
+ {{(isset($translated_text['cancelled_subtotal'])) ? $translated_text['cancelled_subtotal'] : " Cancelled subtotal "}}:
+ +
+ - @money(($order->cancelled_amount-$order->cancelled_tax-$order->cancelled_delivery_fee), + $currency)
+
+
+ @endif + + @if(isset($order->total)) +
+
{{ $translated_text['total'] + }} :
+ +
+ @money($order->total, + $currency)
+
+
+ @endif +
+
+
+ +
+ + + + + diff --git a/packages/marvel/stubs/resources/views/emails/order/order-processed.blade.php b/packages/marvel/stubs/resources/views/emails/order/order-processed.blade.php new file mode 100644 index 0000000..c6d257e --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/order/order-processed.blade.php @@ -0,0 +1,15 @@ +{{--$order collection is available here--}} + +@component('mail::message') +# Your order is processing! + +Your order was received successfully. And the order is in processing state. +Your Order tracking id {{$order->tracking_number}} + +@component('mail::button', ['url' => $url ]) +View Order +@endcomponent + +Thanks,
+{{ config('app.name') }} +@endcomponent \ No newline at end of file diff --git a/packages/marvel/stubs/resources/views/emails/order/order-received.blade.php b/packages/marvel/stubs/resources/views/emails/order/order-received.blade.php new file mode 100644 index 0000000..d125c18 --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/order/order-received.blade.php @@ -0,0 +1,22 @@ +{{--$order collection is available here--}} + +@component('mail::message') +@if($receiver == 'admin') + # {{ __('sms.order.orderCreated.admin.subject') }} + + {{ __('sms.order.orderCreated.admin.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number,'customer_name'=>$customer]) }} +@else + # {{ __('sms.order.orderCreated.storeOwner.subject') }} + + {{ __('sms.order.orderCreated.storeOwner.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number,'customer_name'=>$customer]) }} +@endif + + + +@component('mail::button', ['url' => $url ]) + {{__('common.view-order')}} +@endcomponent + +{{__('common.thanks')}},
+{{ config('app.name') }} +@endcomponent \ No newline at end of file diff --git a/packages/marvel/stubs/resources/views/emails/order/order-status-changed.blade.php b/packages/marvel/stubs/resources/views/emails/order/order-status-changed.blade.php new file mode 100644 index 0000000..486fb7a --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/order/order-status-changed.blade.php @@ -0,0 +1,20 @@ +{{--$order collection is available here--}} + +@component('mail::message') +# {{ __('sms.order.statusChangeOrder.customer.subject') }} +@php + +$status = ucfirst(str_replace('-', ' ', $order->order_status)); +$status = " **".$status."** "; +@endphp + +{{ __('sms.order.statusChangeOrder.customer.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number,'order_status'=>$status]) }} + + +@component('mail::button', ['url' => $url ]) +{{__('common.view-order')}} +@endcomponent + +{{__('common.thanks')}},
+{{ config('app.name') }} +@endcomponent diff --git a/packages/marvel/stubs/resources/views/emails/order/placed.blade.php b/packages/marvel/stubs/resources/views/emails/order/placed.blade.php new file mode 100644 index 0000000..177f73e --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/order/placed.blade.php @@ -0,0 +1,15 @@ +{{--$order collection is available here--}} + +@component('mail::message') +# {{ __('sms.order.orderCreated.customer.subject') }} + +{{ __('sms.order.orderCreated.customer.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number]) }} + + +@component('mail::button', ['url' => $url ]) + {{__('common.view-order')}} +@endcomponent + +{{__('common.thanks')}},
+{{ config('app.name') }} +@endcomponent diff --git a/packages/marvel/stubs/resources/views/emails/ownership/reminder.blade.php b/packages/marvel/stubs/resources/views/emails/ownership/reminder.blade.php new file mode 100644 index 0000000..c84334c --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/ownership/reminder.blade.php @@ -0,0 +1,19 @@ +@component('mail::message') +# Shop Ownership Transfer Email + +Hello, + +Ownership transfer request of {{ $shopName }} has been created. + +Current shop/store owner : {{ $previousOwnerName }} + +Requested new owner : {{ $newOwnerName }} + +Message : {{ $message }} + +@component('mail::button', ['url' => $url ]) +View dashboard +@endcomponent +Thanks,
+{{ config('app.name') }} +@endcomponent \ No newline at end of file diff --git a/packages/marvel/stubs/resources/views/emails/ownership/status.blade.php b/packages/marvel/stubs/resources/views/emails/ownership/status.blade.php new file mode 100644 index 0000000..5a7e847 --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/ownership/status.blade.php @@ -0,0 +1,19 @@ +@component('mail::message') +# Shop Ownership Transfer Email + +Hello, + +Ownership transfer request of {{ $shopName }} has been reviewed. + +Current shop/store owner : {{ $previousOwnerName }} + +Requested new owner : {{ $newOwnerName }} + +Message : {{ $message }} + +@component('mail::button', ['url' => $url ]) +View dashboard +@endcomponent +Thanks,
+{{ config('app.name') }} +@endcomponent \ No newline at end of file diff --git a/packages/marvel/stubs/resources/views/emails/payment/payment-failed.blade.php b/packages/marvel/stubs/resources/views/emails/payment/payment-failed.blade.php new file mode 100644 index 0000000..3e8c28f --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/payment/payment-failed.blade.php @@ -0,0 +1,14 @@ +{{--$order collection is available here--}} + +@component('mail::message') +# {{ __('sms.order.paymentFailedOrder.admin.subject') }} + +{{ __('sms.order.paymentFailedOrder.admin.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number]) }} + +@component('mail::button', ['url' => $url ]) + {{__('common.view-order')}} +@endcomponent + +{{__('common.thanks')}},
+{{ config('app.name') }} +@endcomponent diff --git a/packages/marvel/stubs/resources/views/emails/payment/payment-successful.blade.php b/packages/marvel/stubs/resources/views/emails/payment/payment-successful.blade.php new file mode 100644 index 0000000..cf9e9ce --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/payment/payment-successful.blade.php @@ -0,0 +1,14 @@ +{{--$order collection is available here--}} + +@component('mail::message') +# {{ __('sms.order.paymentSuccessOrder.admin.subject') }} + +{{ __('sms.order.paymentSuccessOrder.admin.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number]) }} + +@component('mail::button', ['url' => $url ]) +{{__('common.view-order')}} +@endcomponent + +{{__('common.thanks')}},
+{{ config('app.name') }} +@endcomponent diff --git a/packages/marvel/stubs/resources/views/emails/refund/refund-requested.blade.php b/packages/marvel/stubs/resources/views/emails/refund/refund-requested.blade.php new file mode 100644 index 0000000..5d97031 --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/refund/refund-requested.blade.php @@ -0,0 +1,25 @@ +@component('mail::message') + +@if($receiver == 'admin') +# {{ __('sms.order.refundRequested.admin.subject') }} + +{{ __('sms.order.refundRequested.admin.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number]) }} + +@component('mail::button', ['url' => $url ]) +{{__('common.view-order')}} +@endcomponent +@else +# {{ __('sms.order.refundRequested.customer.subject') }} + +{{ __('sms.order.refundRequested.customer.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number]) }} + +@component('mail::button', ['url' => $url ]) +{{__('common.view-order')}} +@endcomponent +@endif + + + +{{__('common.thanks')}},
+{{ config('app.name') }} +@endcomponent diff --git a/packages/marvel/stubs/resources/views/emails/refund/refund-updated.blade.php b/packages/marvel/stubs/resources/views/emails/refund/refund-updated.blade.php new file mode 100644 index 0000000..44fe56d --- /dev/null +++ b/packages/marvel/stubs/resources/views/emails/refund/refund-updated.blade.php @@ -0,0 +1,25 @@ +@component('mail::message') + +@if($receiver == 'admin') +# {{ __('sms.order.refundStatusChange.admin.subject') }} + +{{ __('sms.order.refundStatusChange.admin.message',['ORDER_TRACKING_NUMBER' => $order->tracking_number, 'refund_status' => $status]) }} + +@component('mail::button', ['url' => $url ]) + {{__('common.view-order')}} +@endcomponent +@else +# {{ __('sms.order.refundStatusChange.customer.subject') }} + +{{ __('sms.order.refundStatusChange.customer.message',['ORDER_TRACKING_NUMBER' => $order->tracking_number, 'refund_status' => $status]) }} + +@component('mail::button', ['url' => $url ]) + {{__('common.view-order')}} +@endcomponent +@endif + + + +{{__('common.thanks')}},
+{{ config('app.name') }} +@endcomponent diff --git a/packages/marvel/stubs/resources/views/pdf/order-invoice.blade.php b/packages/marvel/stubs/resources/views/pdf/order-invoice.blade.php new file mode 100644 index 0000000..9d98a01 --- /dev/null +++ b/packages/marvel/stubs/resources/views/pdf/order-invoice.blade.php @@ -0,0 +1,399 @@ + + + + + + Order Invoice + + @if ($language === 'bd') + + @endif + + + + + @php + $contactDetails = $settings->options['contactDetails']; + $customer = $order->customer; + $shippingAddress = $order->shipping_address; + $products = $order->products; + $settings = $settings->options; + $authorDetails = $settings['contactDetails']; + $authorLocation = $authorDetails['location']; + $currency = isset($settings['currency']) ? $settings['currency'] : 'USD'; + $currencyOptions = isset($settings['currencyOptions']) ? $settings['currencyOptions'] : ['formation' => 'en-US', 'fractions' => 2]; + $locale = $currencyOptions['formation'] ?? 'en-US'; + + $amountDue = $order->payment_status !== 'payment-success' ? $order->paid_total - intval($order?->wallet_point?->amount) : 0; + + if ($order->order_status === 'order-completed') { + $amountDue = 0; + } + + if ($order->parent_id) { + $parentOrder = $order->parent_order; + } else { + $parentOrder = $order; + } + $cancelled_products = []; + foreach ($parentOrder->children as $childOrder) { + if ($childOrder->order_status == 'order-cancelled') { + foreach ($childOrder->products as $product) { + $cancelled_products[] = $product->id; + } + } + } + + @endphp + +
+
+ @if (isset($translated_text['invoice_no']) || isset($order->tracking_number)) +

{{ $translated_text['invoice_no'] }}: {{ $order->tracking_number }}

+ @endif + @if (isset($translated_text['delivery_time']) || isset($order->delivery_time)) +

{{ isset($translated_text['payment_method']) ? $translated_text['payment_method'] : 'Payment Method' }}: + {{ $order->payment_gateway }}

+ @endif +
+
+ @if (isset($translated_text['date'])) +

{{ $translated_text['date'] }}: {{ date('jS F, Y') }}

+ @endif +
+
+
+ +
+ +
+
    + @if (isset($customer['name'])) +
  • +
    {{ $customer['name'] }}
    +
  • + @endif + + @if (isset($customer['email'])) +
  • +
    {{ $customer['email'] }}
    +
  • + @endif + + @if (isset($order->customer_contact)) +
  • +
    {{ $order->customer_contact }}
    +
  • + @endif + +
  • +
      + @if (isset($shippingAddress['street_address'])) +
    • + {{ $shippingAddress['street_address'] }} +
    • + @endif + + @if (isset($shippingAddress['city'])) +
    • {{ $shippingAddress['city'] }}
    • + @endif + + @if (isset($shippingAddress['state'])) +
    • {{ $shippingAddress['state'] }} +
    • + @endif + + @if (isset($shippingAddress['zip'])) +
    • {{ $shippingAddress['zip'] }}
    • + @endif + + @if (isset($shippingAddress['country'])) +
    • {{ $shippingAddress['country'] }} + + @endif +
    +
  • +
+ +
    + @if (isset($settings['siteTitle'])) +
  • +
    {{ $settings['siteTitle'] }}
    +
  • + @endif + + @if (isset($authorDetails['website'])) +
  • +
    {{ $authorDetails['website'] }}
    +
  • + @endif + + @if (isset($authorDetails['contact'])) +
  • +
    {{ $authorDetails['contact'] }}
    +
  • + @endif + + @if (isset($authorLocation['formattedAddress'])) +
  • +
    {{ $authorLocation['formattedAddress'] }}
    +
  • + @endif +
+
+
+ +
+ + @if (isset($translated_text['products']) || isset($translated_text['quantity']) || isset($translated_text['total'])) +
    + @if (isset($translated_text['products'])) +
  • +
    + {{ $translated_text['products'] }} +
    +
  • + @endif + + @if (isset($translated_text['quantity'])) +
  • +
    + {{ $translated_text['quantity'] }} +
    +
  • + @endif + + @if (isset($translated_text['total'])) +
  • +
    + {{ $translated_text['total'] }} +
    +
  • + @endif +
  • +
+ @endif + + @if (!empty($products)) + @foreach ($products as $product) +
    +
  • +
    + {{ $product['name'] }} + @if (in_array($product->id, $cancelled_products)) + {{ $translated_text['cancelled'] ?? 'Cancelled' }} + @endif +
    +
  • +
  • +
    + {{ $product->pivot['order_quantity'] }} +
    +
  • +
  • +
    + {{ formatCurrency($product->pivot['unit_price'], $currency, $locale) }} +
    +
  • +
  • +
+ @endforeach + @endif + +
+ +
+
+
+ @if (isset($order->amount)) +
+
+ {{ $translated_text['subtotal'] }} :
+
+ {{ formatCurrency($order->amount, $currency, $locale) }} +
+
+
+
+ @endif + @if (isset($order->discount)) +
+
+ {{ $translated_text['discount'] }} :
+ +
+ {{ formatCurrency($order->discount, $currency, $locale) }} +
+
+
+
+ @endif + @if (isset($order->sales_tax)) +
+
+ {{ $translated_text['tax'] }} :
+ +
+ {{ formatCurrency($order->sales_tax + $order->cancelled_tax, $currency, $locale) }} +
+
+
+ @endif + @if (isset($order->delivery_fee)) +
+
+ {{ $translated_text['delivery_fee'] }} :
+ +
+ {{ formatCurrency($order->sales_tax + $order->cancelled_tax, $currency, $locale) }} +
+ +
+
+
+ @endif + @if (isset($order->cancelled_amount) && $order->cancelled_amount > 0 && $order->cancelled_tax > 0) +
+
+ {{ isset($translated_text['cancelled_tax']) ? $translated_text['cancelled_tax'] : 'Tax reduced' }} + : +
+ +
+ - {{ formatCurrency($order->cancelled_tax, $currency, $locale) }} +
+ +
+
+
+ @endif + @if (isset($order->cancelled_amount) && $order->cancelled_amount > 0 && $order->cancelled_delivery_fee > 0) +
+
+ {{ isset($translated_text['cancelled_delivery_fee']) ? $translated_text['cancelled_delivery_fee'] : 'Delivery fee reduced' }} + : +
+ +
+ - {{ formatCurrency($order->cancelled_delivery_fee, $currency, $locale) }} +
+ +
+
+
+ @endif + @if (isset($order->cancelled_amount) && $order->cancelled_amount > 0) +
+
+ {{ isset($translated_text['cancelled_subtotal']) ? $translated_text['cancelled_subtotal'] : ' Cancelled subtotal ' }}: +
+ +
+ -{{ formatCurrency($order->cancelled_amount - $order->cancelled_tax - $order->cancelled_delivery_fee, $currency, $locale) }} +
+ +
+
+
+ @endif + @if (isset($order->total)) +
+
+ {{ $translated_text['total'] }} :
+ +
+ {{ formatCurrency($order->total, $currency, $locale) }} +
+ +
+
+
+ @endif + @if (isset($order?->wallet_point?->amount) && !$order->shop_id) +
+
+ {{ $translated_text['paid_from_wallet'] }} :
+ +
+ {{ formatCurrency($order?->wallet_point?->amount, $currency, $locale) }} +
+ +
+
+
+ @endif + @if (!$order->shop_id) +
+
+ {{ $translated_text['amount_due'] }} :
+ +
+ {{ formatCurrency($amountDue, $currency, $locale) }} +
+ +
+
+ @endif +
+
+
+ + + diff --git a/packages/marvel/stubs/resources/views/products/digital_product/update.blade.php b/packages/marvel/stubs/resources/views/products/digital_product/update.blade.php new file mode 100644 index 0000000..7c93974 --- /dev/null +++ b/packages/marvel/stubs/resources/views/products/digital_product/update.blade.php @@ -0,0 +1,15 @@ +@component('mail::message') +# Product Update Notice + +Hello {{ $user->name }}, + +One new update is available of this product {{ $product->name }}. You can download the update from your user profile's download section. +For more details, you can visit the product link. + +@component('mail::button', ['url' => $url ]) +View product +@endcomponent + +Thanks,
+{{ config('app.name') }} +@endcomponent \ No newline at end of file diff --git a/packages/marvel/stubs/seeders/DemoDataSeeders.php b/packages/marvel/stubs/seeders/DemoDataSeeders.php new file mode 100644 index 0000000..b11584d --- /dev/null +++ b/packages/marvel/stubs/seeders/DemoDataSeeders.php @@ -0,0 +1,82 @@ +command->info('Seed completed from sql file!'); + } +} diff --git a/packages/marvel/stubs/sql/chawkbazar/address.sql b/packages/marvel/stubs/sql/chawkbazar/address.sql new file mode 100644 index 0000000..763a23e --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/address.sql @@ -0,0 +1,50 @@ +INSERT INTO `address` ( + `id`, + `title`, + `type`, + `default`, + `address`, + `customer_id`, + `created_at`, + `updated_at` + ) +VALUES ( + 1, + 'Billing', + 'billing', + 0, + '{\"zip\": \"99614\", \"city\": \"Kipnuk\", \"state\": \"AK\", \"country\": \"United States\", \"street_address\": \"2231 Kidd Avenue\"}', + 1, + '2021-08-18 13:18:03', + '2021-08-18 13:18:03' + ), + ( + 2, + 'Shipping', + 'shipping', + 0, + '{\"zip\": \"40391\", \"city\": \"Winchester\", \"state\": \"KY\", \"country\": \"United States\", \"street_address\": \"2148 Straford Park\"}', + 1, + '2021-08-18 13:18:12', + '2021-08-18 13:18:12' + ), + ( + 3, + 'Billing', + 'billing', + 0, + '{\"zip\": \"10001\", \"city\": \"New York\", \"state\": \"New York\", \"country\": \"US\", \"street_address\": \"260 Terry Lane\"}', + 3, + '2021-11-25 06:23:04', + '2021-11-25 06:23:04' + ), + ( + 4, + 'Shipping', + 'shipping', + 0, + '{\"zip\": \"10022\", \"city\": \"New York\", \"state\": \"New York\", \"country\": \"US\", \"street_address\": \"1780 Angus Road\"}', + 3, + '2021-11-25 06:23:28', + '2021-11-25 06:23:28' + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/attachments.sql b/packages/marvel/stubs/sql/chawkbazar/attachments.sql new file mode 100644 index 0000000..795704f --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/attachments.sql @@ -0,0 +1,324 @@ +INSERT INTO `attachments` (`id`, `url`, `created_at`, `updated_at`) VALUES +(1, '', '2021-10-09 13:30:23', '2021-10-09 13:30:23'), +(2, '', '2021-10-09 13:30:34', '2021-10-09 13:30:34'), +(3, '', '2021-10-09 13:39:00', '2021-10-09 13:39:00'), +(4, '', '2021-10-09 13:42:22', '2021-10-09 13:42:22'), +(5, '', '2021-10-09 13:47:15', '2021-10-09 13:47:15'), +(6, '', '2021-10-09 13:47:43', '2021-10-09 13:47:43'), +(7, '', '2021-10-09 13:53:45', '2021-10-09 13:53:45'), +(8, '', '2021-10-09 16:20:22', '2021-10-09 16:20:22'), +(9, '', '2021-10-09 16:20:25', '2021-10-09 16:20:25'), +(10, '', '2021-10-09 16:21:30', '2021-10-09 16:21:30'), +(11, '', '2021-10-09 16:21:40', '2021-10-09 16:21:40'), +(12, '', '2021-10-09 16:22:16', '2021-10-09 16:22:16'), +(13, '', '2021-10-09 17:01:35', '2021-10-09 17:01:35'), +(14, '', '2021-10-09 17:02:11', '2021-10-09 17:02:11'), +(15, '', '2021-10-09 17:05:23', '2021-10-09 17:05:23'), +(16, '', '2021-10-09 17:06:57', '2021-10-09 17:06:57'), +(17, '', '2021-10-09 17:17:42', '2021-10-09 17:17:42'), +(18, '', '2021-10-09 17:18:48', '2021-10-09 17:18:48'), +(19, '', '2021-10-09 17:20:47', '2021-10-09 17:20:47'), +(20, '', '2021-10-09 17:21:10', '2021-10-09 17:21:10'), +(21, '', '2021-10-09 17:21:30', '2021-10-09 17:21:30'), +(22, '', '2021-10-09 17:21:55', '2021-10-09 17:21:55'), +(23, '', '2021-10-09 17:22:15', '2021-10-09 17:22:15'), +(24, '', '2021-10-09 17:23:13', '2021-10-09 17:23:13'), +(25, '', '2021-10-09 17:23:58', '2021-10-09 17:23:58'), +(26, '', '2021-10-09 17:37:38', '2021-10-09 17:37:38'), +(27, '', '2021-10-09 17:38:22', '2021-10-09 17:38:22'), +(28, '', '2021-10-09 17:38:34', '2021-10-09 17:38:34'), +(29, '', '2021-10-09 17:38:47', '2021-10-09 17:38:47'), +(30, '', '2021-10-09 17:40:03', '2021-10-09 17:40:03'), +(31, '', '2021-10-09 17:40:14', '2021-10-09 17:40:14'), +(32, '', '2021-10-09 17:40:27', '2021-10-09 17:40:27'), +(33, '', '2021-10-09 17:40:40', '2021-10-09 17:40:40'), +(34, '', '2021-10-09 17:52:47', '2021-10-09 17:52:47'), +(35, '', '2021-10-09 17:53:33', '2021-10-09 17:53:33'), +(36, '', '2021-10-09 17:53:48', '2021-10-09 17:53:48'), +(37, '', '2021-10-09 17:54:17', '2021-10-09 17:54:17'), +(38, '', '2021-10-09 17:55:41', '2021-10-09 17:55:41'), +(39, '', '2021-10-10 13:21:22', '2021-10-10 13:21:22'), +(40, '', '2021-10-10 13:21:22', '2021-10-10 13:21:22'), +(41, '', '2021-10-10 13:30:48', '2021-10-10 13:30:48'), +(42, '', '2021-10-10 13:31:51', '2021-10-10 13:31:51'), +(43, '', '2021-10-10 13:50:07', '2021-10-10 13:50:07'), +(44, '', '2021-10-10 13:50:11', '2021-10-10 13:50:11'), +(45, '', '2021-10-10 13:50:49', '2021-10-10 13:50:49'), +(46, '', '2021-10-10 13:50:55', '2021-10-10 13:50:55'), +(47, '', '2021-10-10 13:51:22', '2021-10-10 13:51:22'), +(48, '', '2021-10-10 13:51:29', '2021-10-10 13:51:29'), +(49, '', '2021-10-10 13:55:12', '2021-10-10 13:55:12'), +(50, '', '2021-10-10 13:55:43', '2021-10-10 13:55:43'), +(51, '', '2021-10-10 13:55:56', '2021-10-10 13:55:56'), +(52, '', '2021-10-10 13:56:02', '2021-10-10 13:56:02'), +(53, '', '2021-10-10 13:56:19', '2021-10-10 13:56:19'), +(54, '', '2021-10-10 13:56:51', '2021-10-10 13:56:51'), +(55, '', '2021-10-10 13:57:50', '2021-10-10 13:57:50'), +(56, '', '2021-10-10 13:57:55', '2021-10-10 13:57:55'), +(57, '', '2021-10-10 13:58:24', '2021-10-10 13:58:24'), +(58, '', '2021-10-10 13:58:29', '2021-10-10 13:58:29'), +(59, '', '2021-10-10 13:58:54', '2021-10-10 13:58:54'), +(60, '', '2021-10-10 13:59:02', '2021-10-10 13:59:02'), +(61, '', '2021-10-10 13:59:24', '2021-10-10 13:59:24'), +(62, '', '2021-10-10 13:59:29', '2021-10-10 13:59:29'), +(63, '', '2021-10-10 14:00:05', '2021-10-10 14:00:05'), +(64, '', '2021-10-10 14:00:17', '2021-10-10 14:00:17'), +(65, '', '2021-10-10 14:01:05', '2021-10-10 14:01:05'), +(66, '', '2021-10-10 14:01:07', '2021-10-10 14:01:07'), +(67, '', '2021-10-10 14:01:32', '2021-10-10 14:01:32'), +(68, '', '2021-10-10 14:01:50', '2021-10-10 14:01:50'), +(69, '', '2021-10-10 14:01:55', '2021-10-10 14:01:55'), +(70, '', '2021-10-10 14:02:19', '2021-10-10 14:02:19'), +(71, '', '2021-10-10 14:02:52', '2021-10-10 14:02:52'), +(72, '', '2021-10-10 14:03:29', '2021-10-10 14:03:29'), +(73, '', '2021-10-10 14:03:36', '2021-10-10 14:03:36'), +(74, '', '2021-10-10 14:03:56', '2021-10-10 14:03:56'), +(75, '', '2021-10-10 14:04:00', '2021-10-10 14:04:00'), +(76, '', '2021-10-10 14:04:23', '2021-10-10 14:04:23'), +(77, '', '2021-10-10 14:04:27', '2021-10-10 14:04:27'), +(78, '', '2021-10-10 15:19:50', '2021-10-10 15:19:50'), +(79, '', '2021-10-10 18:43:39', '2021-10-10 18:43:39'), +(80, '', '2021-10-10 18:44:46', '2021-10-10 18:44:46'), +(81, '', '2021-10-10 18:44:54', '2021-10-10 18:44:54'), +(82, '', '2021-10-10 18:44:54', '2021-10-10 18:44:54'), +(83, '', '2021-10-10 18:45:30', '2021-10-10 18:45:30'), +(84, '', '2021-10-10 18:45:31', '2021-10-10 18:45:31'), +(85, '', '2021-10-10 18:49:03', '2021-10-10 18:49:03'), +(86, '', '2021-10-10 18:49:03', '2021-10-10 18:49:03'), +(87, '', '2021-10-10 18:49:24', '2021-10-10 18:49:24'), +(88, '', '2021-10-10 18:49:24', '2021-10-10 18:49:24'), +(89, '', '2021-10-10 18:50:35', '2021-10-10 18:50:35'), +(90, '', '2021-10-10 18:50:35', '2021-10-10 18:50:35'), +(91, '', '2021-10-10 18:50:35', '2021-10-10 18:50:35'), +(92, '', '2021-10-10 18:50:36', '2021-10-10 18:50:36'), +(93, '', '2021-10-10 18:50:40', '2021-10-10 18:50:40'), +(94, '', '2021-10-10 18:50:40', '2021-10-10 18:50:40'), +(95, '', '2021-10-10 18:50:55', '2021-10-10 18:50:55'), +(96, '', '2021-10-10 18:50:55', '2021-10-10 18:50:55'), +(97, '', '2021-10-10 18:52:01', '2021-10-10 18:52:01'), +(98, '', '2021-10-10 18:52:19', '2021-10-10 18:52:19'), +(99, '', '2021-10-10 18:52:19', '2021-10-10 18:52:19'), +(100, '', '2021-10-10 18:52:19', '2021-10-10 18:52:19'), +(101, '', '2021-10-10 18:52:19', '2021-10-10 18:52:19'), +(102, '', '2021-10-10 18:52:23', '2021-10-10 18:52:23'), +(103, '', '2021-10-10 18:52:24', '2021-10-10 18:52:24'), +(104, '', '2021-10-10 18:52:24', '2021-10-10 18:52:24'), +(105, '', '2021-10-10 18:52:24', '2021-10-10 18:52:24'), +(106, '', '2021-10-10 18:53:31', '2021-10-10 18:53:31'), +(107, '', '2021-10-10 18:58:44', '2021-10-10 18:58:44'), +(108, '', '2021-10-10 18:59:50', '2021-10-10 18:59:50'), +(109, '', '2021-10-10 18:59:54', '2021-10-10 18:59:54'), +(110, '', '2021-10-10 19:29:51', '2021-10-10 19:29:51'), +(111, '', '2021-10-10 19:30:04', '2021-10-10 19:30:04'), +(112, '', '2021-10-10 19:30:04', '2021-10-10 19:30:04'), +(113, '', '2021-10-10 19:30:05', '2021-10-10 19:30:05'), +(114, '', '2021-10-10 19:30:05', '2021-10-10 19:30:05'), +(115, '', '2021-10-10 19:32:20', '2021-10-10 19:32:20'), +(116, '', '2021-10-10 19:32:27', '2021-10-10 19:32:27'), +(117, '', '2021-10-10 19:32:28', '2021-10-10 19:32:28'), +(118, '', '2021-10-10 19:32:28', '2021-10-10 19:32:28'), +(119, '', '2021-10-10 19:32:28', '2021-10-10 19:32:28'), +(120, '', '2021-10-10 19:36:45', '2021-10-10 19:36:45'), +(121, '', '2021-10-10 19:37:15', '2021-10-10 19:37:15'), +(122, '', '2021-10-10 19:37:15', '2021-10-10 19:37:15'), +(123, '', '2021-10-10 19:37:15', '2021-10-10 19:37:15'), +(124, '', '2021-10-10 19:37:15', '2021-10-10 19:37:15'), +(125, '', '2021-10-10 19:42:43', '2021-10-10 19:42:43'), +(126, '', '2021-10-10 19:43:08', '2021-10-10 19:43:08'), +(127, '', '2021-10-10 19:43:08', '2021-10-10 19:43:08'), +(128, '', '2021-10-10 19:43:09', '2021-10-10 19:43:09'), +(129, '', '2021-10-10 19:43:09', '2021-10-10 19:43:09'), +(130, '', '2021-10-10 19:46:05', '2021-10-10 19:46:05'), +(131, '', '2021-10-10 19:46:15', '2021-10-10 19:46:15'), +(132, '', '2021-10-10 19:46:15', '2021-10-10 19:46:15'), +(133, '', '2021-10-10 19:48:37', '2021-10-10 19:48:37'), +(134, '', '2021-10-10 19:48:42', '2021-10-10 19:48:42'), +(135, '', '2021-10-10 19:50:52', '2021-10-10 19:50:52'), +(136, '', '2021-10-10 19:50:57', '2021-10-10 19:50:57'), +(137, '', '2021-10-10 21:48:59', '2021-10-10 21:48:59'), +(138, '', '2021-10-10 21:49:10', '2021-10-10 21:49:10'), +(139, '', '2021-10-10 21:49:11', '2021-10-10 21:49:11'), +(140, '', '2021-10-10 21:49:11', '2021-10-10 21:49:11'), +(141, '', '2021-10-10 21:49:11', '2021-10-10 21:49:11'), +(142, '', '2021-10-11 13:13:35', '2021-10-11 13:13:35'), +(143, '', '2021-10-11 13:13:41', '2021-10-11 13:13:41'), +(144, '', '2021-10-11 13:13:42', '2021-10-11 13:13:42'), +(145, '', '2021-10-11 13:14:38', '2021-10-11 13:14:38'), +(146, '', '2021-10-11 13:14:44', '2021-10-11 13:14:44'), +(147, '', '2021-10-11 13:14:45', '2021-10-11 13:14:45'), +(148, '', '2021-10-11 13:19:40', '2021-10-11 13:19:40'), +(149, '', '2021-10-11 13:19:55', '2021-10-11 13:19:55'), +(150, '', '2021-10-11 13:19:56', '2021-10-11 13:19:56'), +(151, '', '2021-10-11 13:19:56', '2021-10-11 13:19:56'), +(152, '', '2021-10-11 13:19:56', '2021-10-11 13:19:56'), +(153, '', '2021-10-11 13:54:44', '2021-10-11 13:54:44'), +(154, '', '2021-10-11 13:55:02', '2021-10-11 13:55:02'), +(155, '', '2021-10-11 13:55:03', '2021-10-11 13:55:03'), +(156, '', '2021-10-11 13:55:03', '2021-10-11 13:55:03'), +(157, '', '2021-10-11 13:55:04', '2021-10-11 13:55:04'), +(158, '', '2021-10-11 14:29:34', '2021-10-11 14:29:34'), +(159, '', '2021-10-11 14:29:43', '2021-10-11 14:29:43'), +(160, '', '2021-10-11 14:29:43', '2021-10-11 14:29:43'), +(161, '', '2021-10-11 14:29:43', '2021-10-11 14:29:43'), +(162, '', '2021-10-11 14:29:43', '2021-10-11 14:29:43'), +(163, '', '2021-10-11 14:32:08', '2021-10-11 14:32:08'), +(164, '', '2021-10-11 14:33:03', '2021-10-11 14:33:03'), +(165, '', '2021-10-11 14:36:34', '2021-10-11 14:36:34'), +(166, '', '2021-10-11 14:36:39', '2021-10-11 14:36:39'), +(167, '', '2021-10-11 14:38:13', '2021-10-11 14:38:13'), +(168, '', '2021-10-11 14:38:21', '2021-10-11 14:38:21'), +(169, '', '2021-10-11 14:38:21', '2021-10-11 14:38:21'), +(170, '', '2021-10-11 14:38:21', '2021-10-11 14:38:21'), +(171, '', '2021-10-11 14:40:03', '2021-10-11 14:40:03'), +(172, '', '2021-10-11 14:40:14', '2021-10-11 14:40:14'), +(173, '', '2021-10-11 14:41:33', '2021-10-11 14:41:33'), +(174, '', '2021-10-11 14:42:02', '2021-10-11 14:42:02'), +(175, '', '2021-10-11 14:42:03', '2021-10-11 14:42:03'), +(176, '', '2021-10-11 14:42:04', '2021-10-11 14:42:04'), +(177, '', '2021-10-11 14:42:51', '2021-10-11 14:42:51'), +(178, '', '2021-10-11 14:42:54', '2021-10-11 14:42:54'), +(179, '', '2021-10-23 13:01:43', '2021-10-23 13:01:43'), +(180, '', '2021-10-23 13:09:07', '2021-10-23 13:09:07'), +(181, '', '2021-10-23 13:45:54', '2021-10-23 13:45:54'), +(182, '', '2021-10-23 13:48:31', '2021-10-23 13:48:31'), +(183, '', '2021-10-23 13:48:49', '2021-10-23 13:48:49'), +(184, '', '2021-10-23 16:17:44', '2021-10-23 16:17:44'), +(185, '', '2021-10-23 16:17:53', '2021-10-23 16:17:53'), +(186, '', '2021-10-23 19:54:10', '2021-10-23 19:54:10'), +(187, '', '2021-10-23 19:54:14', '2021-10-23 19:54:14'), +(188, '', '2021-10-23 20:12:44', '2021-10-23 20:12:44'), +(189, '', '2021-10-23 20:16:20', '2021-10-23 20:16:20'), +(190, '', '2021-10-23 20:16:24', '2021-10-23 20:16:24'), +(191, '', '2021-10-23 20:20:26', '2021-10-23 20:20:26'), +(192, '', '2021-10-23 20:30:08', '2021-10-23 20:30:08'), +(193, '', '2021-10-23 20:30:11', '2021-10-23 20:30:11'), +(194, '', '2021-10-23 21:09:12', '2021-10-23 21:09:12'), +(195, '', '2021-10-23 21:09:16', '2021-10-23 21:09:16'), +(196, '', '2021-10-23 21:11:48', '2021-10-23 21:11:48'), +(197, '', '2021-10-23 21:11:52', '2021-10-23 21:11:52'), +(198, '', '2021-10-23 21:16:05', '2021-10-23 21:16:05'), +(199, '', '2021-10-23 21:16:12', '2021-10-23 21:16:12'), +(200, '', '2021-10-23 21:18:21', '2021-10-23 21:18:21'), +(201, '', '2021-10-23 21:18:25', '2021-10-23 21:18:25'), +(202, '', '2021-10-23 21:20:07', '2021-10-23 21:20:07'), +(203, '', '2021-10-23 21:20:11', '2021-10-23 21:20:11'), +(204, '', '2021-10-23 21:22:08', '2021-10-23 21:22:08'), +(205, '', '2021-10-23 21:23:58', '2021-10-23 21:23:58'), +(206, '', '2021-10-23 21:24:02', '2021-10-23 21:24:02'), +(207, '', '2021-10-23 21:27:10', '2021-10-23 21:27:10'), +(208, '', '2021-10-23 21:27:14', '2021-10-23 21:27:14'), +(209, '', '2021-10-23 21:32:22', '2021-10-23 21:32:22'), +(210, '', '2021-10-23 21:35:05', '2021-10-23 21:35:05'), +(211, '', '2021-10-23 21:35:11', '2021-10-23 21:35:11'), +(212, '', '2021-10-23 21:38:52', '2021-10-23 21:38:52'), +(213, '', '2021-10-23 21:41:38', '2021-10-23 21:41:38'), +(214, '', '2021-10-23 21:41:42', '2021-10-23 21:41:42'), +(215, '', '2021-10-23 21:45:53', '2021-10-23 21:45:53'), +(216, '', '2021-10-23 21:45:58', '2021-10-23 21:45:58'), +(217, '', '2021-10-23 21:50:34', '2021-10-23 21:50:34'), +(218, '', '2021-10-23 21:50:38', '2021-10-23 21:50:38'), +(219, '', '2021-10-23 21:54:47', '2021-10-23 21:54:47'), +(220, '', '2021-10-23 21:54:51', '2021-10-23 21:54:51'), +(221, '', '2021-10-23 21:57:11', '2021-10-23 21:57:11'), +(222, '', '2021-10-23 21:57:14', '2021-10-23 21:57:14'), +(223, '', '2021-10-23 22:00:46', '2021-10-23 22:00:46'), +(224, '', '2021-10-23 22:01:09', '2021-10-23 22:01:09'), +(225, '', '2021-10-23 22:04:37', '2021-10-23 22:04:37'), +(226, '', '2021-10-23 22:08:09', '2021-10-23 22:08:09'), +(227, '', '2021-10-23 22:08:14', '2021-10-23 22:08:14'), +(228, '', '2021-10-23 22:10:37', '2021-10-23 22:10:37'), +(229, '', '2021-10-23 22:10:41', '2021-10-23 22:10:41'), +(230, '', '2021-10-23 22:13:34', '2021-10-23 22:13:34'), +(231, '', '2021-10-23 22:13:38', '2021-10-23 22:13:38'), +(232, '', '2021-10-23 22:16:37', '2021-10-23 22:16:37'), +(233, '', '2021-10-23 22:16:41', '2021-10-23 22:16:41'), +(234, '', '2021-10-23 22:19:04', '2021-10-23 22:19:04'), +(235, '', '2021-10-23 22:19:08', '2021-10-23 22:19:08'), +(236, '', '2021-10-23 22:21:07', '2021-10-23 22:21:07'), +(237, '', '2021-10-23 22:21:10', '2021-10-23 22:21:10'), +(238, '', '2021-10-25 07:17:45', '2021-10-25 07:17:45'), +(239, '', '2021-10-25 07:19:30', '2021-10-25 07:19:30'), +(240, '', '2021-10-25 07:19:44', '2021-10-25 07:19:44'), +(241, '', '2021-10-25 07:20:12', '2021-10-25 07:20:12'), +(242, '', '2021-10-25 07:20:21', '2021-10-25 07:20:21'), +(243, '', '2021-10-25 07:20:46', '2021-10-25 07:20:46'), +(244, '', '2021-10-25 07:20:54', '2021-10-25 07:20:54'), +(245, '', '2021-10-25 07:21:03', '2021-10-25 07:21:03'), +(246, '', '2021-10-25 07:35:16', '2021-10-25 07:35:16'), +(247, '', '2021-10-25 07:37:12', '2021-10-25 07:37:12'), +(248, '', '2021-10-25 07:39:11', '2021-10-25 07:39:11'), +(249, '', '2021-10-25 07:39:48', '2021-10-25 07:39:48'), +(250, '', '2021-10-25 12:35:01', '2021-10-25 12:35:01'), +(251, '', '2021-10-25 12:36:20', '2021-10-25 12:36:20'), +(252, '', '2021-10-25 12:37:22', '2021-10-25 12:37:22'), +(253, '', '2021-10-25 12:37:43', '2021-10-25 12:37:43'), +(254, '', '2021-10-25 12:39:01', '2021-10-25 12:39:01'), +(255, '', '2021-10-25 12:39:38', '2021-10-25 12:39:38'), +(256, '', '2021-10-27 09:13:12', '2021-10-27 09:13:12'), +(257, '', '2021-10-27 09:13:26', '2021-10-27 09:13:26'), +(258, '', '2021-10-27 09:13:39', '2021-10-27 09:13:39'), +(259, '', '2021-10-27 09:50:39', '2021-10-27 09:50:39'), +(260, '', '2021-10-27 09:51:22', '2021-10-27 09:51:22'), +(261, '', '2021-10-27 09:51:59', '2021-10-27 09:51:59'), +(262, '', '2021-10-27 09:52:25', '2021-10-27 09:52:25'), +(263, '', '2021-10-27 09:52:45', '2021-10-27 09:52:45'), +(264, '', '2021-10-27 09:53:00', '2021-10-27 09:53:00'), +(265, '', '2021-10-27 09:53:21', '2021-10-27 09:53:21'), +(266, '', '2021-10-27 09:53:39', '2021-10-27 09:53:39'), +(267, '', '2021-10-27 09:53:52', '2021-10-27 09:53:52'), +(268, '', '2021-11-08 06:57:52', '2021-11-08 06:57:52'), +(269, '', '2021-11-08 07:06:04', '2021-11-08 07:06:04'), +(270, '', '2021-11-08 07:06:17', '2021-11-08 07:06:17'), +(271, '', '2021-11-08 07:08:47', '2021-11-08 07:08:47'), +(272, '', '2021-11-08 07:09:47', '2021-11-08 07:09:47'), +(273, '', '2021-11-08 07:10:19', '2021-11-08 07:10:19'), +(274, '', '2021-11-08 07:13:54', '2021-11-08 07:13:54'), +(275, '', '2021-11-08 07:22:39', '2021-11-08 07:22:39'), +(276, '', '2021-11-08 07:23:07', '2021-11-08 07:23:07'), +(277, '', '2021-11-08 07:31:07', '2021-11-08 07:31:07'), +(278, '', '2021-11-08 07:31:22', '2021-11-08 07:31:22'), +(279, '', '2021-11-08 07:32:20', '2021-11-08 07:32:20'), +(280, '', '2021-11-08 07:33:04', '2021-11-08 07:33:04'), +(281, '', '2021-11-08 07:33:10', '2021-11-08 07:33:10'), +(282, '', '2021-11-08 07:33:38', '2021-11-08 07:33:38'), +(283, '', '2021-11-08 07:34:26', '2021-11-08 07:34:26'), +(284, '', '2021-11-08 07:35:08', '2021-11-08 07:35:08'), +(285, '', '2021-11-08 07:35:40', '2021-11-08 07:35:40'), +(286, '', '2021-11-08 07:36:06', '2021-11-08 07:36:06'), +(287, '', '2021-11-08 07:36:39', '2021-11-08 07:36:39'), +(288, '', '2021-11-08 07:37:03', '2021-11-08 07:37:03'), +(289, '', '2021-11-08 07:37:20', '2021-11-08 07:37:20'), +(290, '', '2021-11-08 07:38:18', '2021-11-08 07:38:18'), +(291, '', '2021-11-08 07:38:41', '2021-11-08 07:38:41'), +(292, '', '2021-11-08 10:01:31', '2021-11-08 10:01:31'), +(293, '', '2021-11-08 10:02:00', '2021-11-08 10:02:00'), +(294, '', '2021-11-08 10:03:23', '2021-11-08 10:03:23'), +(295, '', '2021-11-08 10:03:53', '2021-11-08 10:03:53'), +(296, '', '2021-11-08 10:04:44', '2021-11-08 10:04:44'), +(297, '', '2021-11-25 06:21:27', '2021-11-25 06:21:27'), +(298, '', '2021-11-27 17:16:54', '2021-11-27 17:16:54'), +(299, '', '2021-11-27 17:53:40', '2021-11-27 17:53:40'), +(300, '', '2021-11-27 17:53:48', '2021-11-27 17:53:48'), +(301, '', '2021-11-28 12:58:08', '2021-11-28 12:58:08'), +(302, '', '2021-11-28 12:58:21', '2021-11-28 12:58:21'), +(303, '', '2021-11-28 12:58:21', '2021-11-28 12:58:21'), +(304, '', '2022-01-10 17:47:49', '2022-01-10 17:47:49'), +(305, '', '2022-01-10 17:48:06', '2022-01-10 17:48:06'), +(306, '', '2022-01-10 17:48:25', '2022-01-10 17:48:25'), +(307, '', '2022-01-10 17:48:39', '2022-01-10 17:48:39'), +(308, '', '2022-01-10 17:48:49', '2022-01-10 17:48:49'), +(309, '', '2022-01-10 17:49:00', '2022-01-10 17:49:00'), +(310, '', '2022-01-10 17:49:12', '2022-01-10 17:49:12'), +(311, '', '2022-01-10 17:49:22', '2022-01-10 17:49:22'), +(312, '', '2022-03-01 05:02:27', '2022-03-01 05:02:27'), +(313, '', '2022-03-01 05:03:07', '2022-03-01 05:03:07'), +(314, '', '2022-03-01 05:03:17', '2022-03-01 05:03:17'), +(315, '', '2022-03-01 05:03:25', '2022-03-01 05:03:25'), +(316, '', '2022-03-01 05:03:33', '2022-03-01 05:03:33'), +(317, '', '2022-03-01 05:03:45', '2022-03-01 05:03:45'), +(318, '', '2022-03-01 05:03:52', '2022-03-01 05:03:52'), +(319, '', '2022-03-01 05:04:01', '2022-03-01 05:04:01'), +(320, '', '2022-03-02 04:47:15', '2022-03-02 04:47:15'), +(321, '', '2022-03-02 04:47:25', '2022-03-02 04:47:25'), +(322, '', '2022-03-02 04:47:48', '2022-03-02 04:47:48'), +(323, '', '2022-03-02 04:49:48', '2022-03-02 04:49:48'); diff --git a/packages/marvel/stubs/sql/chawkbazar/attribute_product.sql b/packages/marvel/stubs/sql/chawkbazar/attribute_product.sql new file mode 100644 index 0000000..19776d9 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/attribute_product.sql @@ -0,0 +1,99 @@ +INSERT INTO `attribute_product` (`id`, `attribute_value_id`, `product_id`, `created_at`, `updated_at`) VALUES +(384, 8, 1, NULL, NULL), +(385, 9, 1, NULL, NULL), +(386, 14, 2, NULL, NULL), +(387, 15, 2, NULL, NULL), +(388, 8, 3, NULL, NULL), +(389, 9, 3, NULL, NULL), +(390, 11, 3, NULL, NULL), +(391, 12, 3, NULL, NULL), +(392, 9, 5, NULL, NULL), +(393, 10, 5, NULL, NULL), +(394, 8, 7, NULL, NULL), +(395, 10, 7, NULL, NULL), +(396, 11, 7, NULL, NULL), +(397, 12, 7, NULL, NULL), +(398, 13, 7, NULL, NULL), +(399, 8, 8, NULL, NULL), +(400, 9, 8, NULL, NULL), +(401, 11, 8, NULL, NULL), +(402, 13, 8, NULL, NULL), +(403, 14, 14, NULL, NULL), +(404, 15, 14, NULL, NULL), +(405, 16, 14, NULL, NULL), +(406, 8, 15, NULL, NULL), +(407, 9, 15, NULL, NULL), +(408, 11, 15, NULL, NULL), +(409, 12, 15, NULL, NULL), +(410, 8, 16, NULL, NULL), +(411, 10, 16, NULL, NULL), +(412, 11, 16, NULL, NULL), +(413, 12, 16, NULL, NULL), +(414, 8, 17, NULL, NULL), +(415, 9, 17, NULL, NULL), +(430, 8, 20, NULL, NULL), +(431, 9, 20, NULL, NULL), +(432, 10, 20, NULL, NULL), +(435, 8, 21, NULL, NULL), +(436, 9, 21, NULL, NULL), +(437, 8, 22, NULL, NULL), +(438, 9, 22, NULL, NULL), +(439, 10, 22, NULL, NULL), +(440, 8, 23, NULL, NULL), +(441, 9, 23, NULL, NULL), +(442, 10, 23, NULL, NULL), +(443, 8, 24, NULL, NULL), +(444, 9, 24, NULL, NULL), +(445, 10, 24, NULL, NULL), +(446, 14, 25, NULL, NULL), +(447, 15, 25, NULL, NULL), +(448, 16, 25, NULL, NULL), +(449, 17, 25, NULL, NULL), +(450, 14, 27, NULL, NULL), +(451, 15, 27, NULL, NULL), +(452, 16, 27, NULL, NULL), +(453, 17, 27, NULL, NULL), +(454, 8, 29, NULL, NULL), +(455, 10, 29, NULL, NULL), +(456, 9, 29, NULL, NULL), +(457, 14, 31, NULL, NULL), +(458, 15, 31, NULL, NULL), +(459, 16, 31, NULL, NULL), +(460, 17, 31, NULL, NULL), +(461, 8, 33, NULL, NULL), +(462, 9, 33, NULL, NULL), +(463, 11, 35, NULL, NULL), +(464, 12, 35, NULL, NULL), +(465, 8, 36, NULL, NULL), +(466, 9, 36, NULL, NULL), +(467, 10, 36, NULL, NULL), +(468, 11, 57, NULL, NULL), +(469, 12, 57, NULL, NULL), +(470, 13, 57, NULL, NULL), +(471, 11, 55, NULL, NULL), +(472, 12, 55, NULL, NULL), +(473, 13, 55, NULL, NULL), +(474, 9, 53, NULL, NULL), +(475, 10, 53, NULL, NULL), +(476, 11, 50, NULL, NULL), +(477, 12, 50, NULL, NULL), +(478, 14, 49, NULL, NULL), +(479, 15, 49, NULL, NULL), +(480, 16, 49, NULL, NULL), +(481, 17, 49, NULL, NULL), +(482, 12, 47, NULL, NULL), +(483, 13, 47, NULL, NULL), +(484, 14, 46, NULL, NULL), +(485, 15, 46, NULL, NULL), +(486, 16, 46, NULL, NULL), +(487, 17, 46, NULL, NULL), +(488, 11, 43, NULL, NULL), +(489, 12, 43, NULL, NULL), +(490, 13, 43, NULL, NULL), +(491, 14, 42, NULL, NULL), +(492, 15, 42, NULL, NULL), +(493, 16, 42, NULL, NULL), +(494, 17, 42, NULL, NULL), +(495, 8, 41, NULL, NULL), +(496, 9, 41, NULL, NULL), +(497, 10, 41, NULL, NULL); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/attribute_values.sql b/packages/marvel/stubs/sql/chawkbazar/attribute_values.sql new file mode 100644 index 0000000..78907a0 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/attribute_values.sql @@ -0,0 +1,11 @@ +INSERT INTO `attribute_values` (`id`, `attribute_id`, `value`, `meta`, `created_at`, `updated_at`) VALUES +(8, 3, 'Red', '#FF0000', '2021-10-10 14:48:43', '2021-10-10 14:48:43'), +(9, 3, 'Blue', '#0000FF', '2021-10-10 14:48:43', '2021-10-10 14:48:43'), +(10, 3, 'Yellow', '#FFFF00', '2021-10-10 14:48:43', '2021-10-10 14:48:43'), +(11, 2, 'Small', NULL, '2021-11-28 12:11:01', '2021-11-28 12:11:01'), +(12, 2, 'Medium', NULL, '2021-11-28 12:11:01', '2021-11-28 12:11:01'), +(13, 2, 'Large', NULL, '2021-11-28 12:11:01', '2021-11-28 12:11:01'), +(14, 2, '7', NULL, '2021-11-28 12:11:01', '2021-11-28 12:11:01'), +(15, 2, '8', NULL, '2021-11-28 12:11:01', '2021-11-28 12:11:01'), +(16, 2, '9', NULL, '2021-11-28 12:11:01', '2021-11-28 12:11:01'), +(17, 2, '10', NULL, '2021-11-28 12:11:01', '2021-11-28 12:11:01'); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/attributes.sql b/packages/marvel/stubs/sql/chawkbazar/attributes.sql new file mode 100644 index 0000000..23a6894 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/attributes.sql @@ -0,0 +1,3 @@ +INSERT INTO `attributes` (`id`, `slug`, `name`, `shop_id`, `created_at`, `updated_at`) VALUES +(2, 'size', 'Size', 2, '2021-10-10 14:47:38', '2021-10-10 14:47:38'), +(3, 'color', 'Color', 2, '2021-10-10 14:48:43', '2021-10-10 14:48:43'); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/balances.sql b/packages/marvel/stubs/sql/chawkbazar/balances.sql new file mode 100644 index 0000000..b1ad66a --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/balances.sql @@ -0,0 +1,3 @@ +INSERT INTO `balances` (`id`, `shop_id`, `admin_commission_rate`, `total_earnings`, `withdrawn_amount`, `current_balance`, `payment_info`, `created_at`, `updated_at`) VALUES +(1, 1, 10, 0, 0, 0, '{\"bank\": \"test bank\", \"name\": \"chawkbazar\", \"email\": \"shop_owner@demo.com\", \"account\": 53415435}', '2021-10-09 16:24:30', '2021-10-09 16:39:44'), +(2, 2, 10, 14562, 7850, 6712, '{\"bank\": \"vendor bank\", \"name\": \"vendor\", \"email\": \"vendor@demo.com\", \"account\": 6523498651}', '2021-10-09 16:57:34', '2021-11-28 08:51:12'); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/became_sellers.sql b/packages/marvel/stubs/sql/chawkbazar/became_sellers.sql new file mode 100644 index 0000000..5ccd05e --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/became_sellers.sql @@ -0,0 +1,16 @@ +INSERT INTO + `became_sellers` ( + `id`, + `page_options`, + `language`, + `created_at`, + `updated_at` + ) +VALUES + ( + 1, + '{\"banner\":{\"newsTickerTitle\":\"Have a look at our updated terms and conditions policy.\",\"newsTickerURL\":\"https:\\/\\/chawkbazar-admin.redq.io\\/terms\",\"title\":\"Launch your online store effortlessly with Chawkbazar and start selling today.\",\"description\":\"Transform your business with Chawkbazar\'s seamless platform and kickstart your online sales instantly. Enjoy a hassle-free setup and reach your customers quickly and efficiently.\",\"button1Name\":\"SignUp Now\",\"button1Link\":\"https:\\/\\/chawkbazar-admin.redq.io\\/register\",\"button2Name\":\"Visit Help Center\",\"button2Link\":\"https:\\/\\/chawkbazar.redq.io\\/faq\",\"image\":{\"thumbnail\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2465\\/conversions\\/hero-thumbnail.jpg\",\"original\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2465\\/hero.png\",\"id\":2468,\"file_name\":\"hero.png\"}},\"sellingStepsTitle\":\"Start Selling In 4 Simple Steps\",\"sellingStepsDescription\":\"Launching your online business with Chawkbazar is a breeze. Join the 10 million sellers who already trust us with their success.\",\"sellingStepsItem\":[{\"title\":\"Signup for free\",\"description\":\"Discover all the necessary steps to successfully create your account here.\",\"image\":{\"thumbnail\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2455\\/conversions\\/Illustration-thumbnail.jpg\",\"original\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2455\\/Illustration.png\",\"id\":2458,\"file_name\":\"Illustration.png\"}},{\"title\":\"Sell Product\",\"description\":\"Unlock profitable opportunities and begin selling your products today.\",\"image\":{\"thumbnail\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2456\\/conversions\\/Illustration-%281%29-thumbnail.jpg\",\"original\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2456\\/Illustration-%281%29.png\",\"id\":2459,\"file_name\":\"Illustration-%281%29.png\"}},{\"title\":\"Earn Money\",\"description\":\"Monetize your potential and start earning today.\",\"image\":{\"thumbnail\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2457\\/conversions\\/Illustration-%282%29-thumbnail.jpg\",\"original\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2457\\/Illustration-%282%29.png\",\"id\":2460,\"file_name\":\"Illustration-%282%29.png\"}},{\"title\":\"Grow Business\",\"description\":\"Elevate your enterprise and empower your business growth with us.\",\"image\":{\"thumbnail\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2458\\/conversions\\/Illustration-%283%29-thumbnail.jpg\",\"original\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2458\\/Illustration-%283%29.png\",\"id\":2461,\"file_name\":\"Illustration-%283%29.png\"}}],\"userStoryTitle\":\"World-class customer stories\",\"userStoryDescription\":\"I\'ve never seen a platform as easy to use, as easy to onboard new users, as easy to scale, and as easy to customize to your own workflow, process, team, clientele, and changing environment.\",\"purposeTitle\":\"Why Sell with Chawkbazar\",\"purposeDescription\":\"Embarking on your digital entrepreneurship journey with Chawkbazar is a breeze. Over 1.4 million sellers have trusted us to nurture their businesses.\",\"purposeItems\":[{\"description\":\"Strategically engage and connect with your target audience to foster meaningful relationships and drive business growth.\",\"title\":\"Reach Customer\",\"icon\":{\"value\":\"BullsEyeIcon\"}},{\"description\":\"Unlock exclusive benefits and join our community with hassle-free registration.\",\"title\":\"Free Registration\",\"icon\":{\"value\":\"StoreIcon\"}},{\"description\":\"Fast, reliable, and hassle free delivery through Chawkbazar logistic network\",\"title\":\"Reliable Shipping\",\"icon\":{\"value\":\"ChatIcon\"}},{\"description\":\"Funds are safely deposited directly to your bank account on a weekly basis.\",\"title\":\"Timely Payments\",\"icon\":{\"value\":\"BullsEyeIcon\"}},{\"description\":\"Find new customers & grow more with advertising and our whole range of marketing tools.\",\"title\":\"Marketing Tools\",\"icon\":{\"value\":\"StoreIcon\"}},{\"description\":\"Learn all about e-commerce for free and get help with seller support.\",\"title\":\"Support & Training\",\"icon\":{\"value\":\"ReceiptIcon\"}}],\"commissionTitle\":\"Fee and Commission\",\"commissionDescription\":\"Starting your online business with Chawkbazar is easy. 14 lakh+ sellers trust us with their business.\",\"isMultiCommissionRate\":false,\"defaultCommissionRate\": 10,\"defaultCommissionDetails\": \"Default Commission\",\"dashboard\":{\"title\":\"Monetize user with Chawkbazar Dashboard\",\"description\":\"We offers high-quality films and the best documentary selection, \\nand the ability to browse alphabetically and by genre\",\"buttonName\":\"Chawkbazar Admin\",\"buttonLink\":\"https:\\/\\/chawkbazar-admin.redq.io\\/\",\"button2Name\":\"Documentation\",\"button2Link\":\"https:\\/\\/chawkbazar-laravel-doc.vercel.app\\/\",\"image\":{\"thumbnail\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2466\\/conversions\\/mockup-thumbnail.jpg\",\"original\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2466\\/mockup.png\",\"id\":2469,\"file_name\":\"mockup.png\"}},\"guidelineTitle\":\"Guideline for the seller\",\"guidelineDescription\":\"Starting your online business with Chawkbazar is easy. 14 lakh+ sellers trust us with their business.\",\"guidelineItems\":[{\"title\":\"How to register as a seller on Chawkbazar Admin?\",\"link\":\"https:\\/\\/chawkbazar-admin.redq.io\\/\"},{\"title\":\"Benefits of selling product on Chawkbazar Marketplace\",\"link\":\"https:\\/\\/chawkbazar-admin.redq.io\\/\"},{\"title\":\"What is the shipping method for the sellers?\",\"link\":\"https:\\/\\/chawkbazar-admin.redq.io\\/\"},{\"title\":\"How to listing a product in Chawkbazar Marketplace?\",\"link\":\"https:\\/\\/chawkbazar-admin.redq.io\\/\"},{\"title\":\"How to register as a seller on Chawkbazar Admin?\",\"link\":null},{\"title\":\"Benefits of selling product on Chawkbazar Marketplace\",\"link\":\"https:\\/\\/chawkbazar-admin.redq.io\\/\"},{\"title\":\"What is the shipping method for the sellers?\",\"link\":\"https:\\/\\/chawkbazar-admin.redq.io\\/\"},{\"title\":\"How to listing a product in Chawkbazar Marketplace?\",\"link\":\"https:\\/\\/chawkbazar-admin.redq.io\\/\"}],\"faqTitle\":\"Frequently Ask Question\",\"faqDescription\":\"Answers to common questions about our services and policies.\",\"faqItems\":[{\"title\":\"What is the process of project final delivery system?\",\"description\":\"

The project final delivery system typically involves several key steps. Firstly, the team conducts a thorough review of all project components to ensure completeness and quality. Secondly, any necessary documentation and deliverables are prepared and organized for client handover. Finally, the project is formally presented to the client, followed by a comprehensive review and sign-off process to ensure satisfaction and successful completion.<\\/p>\"},{\"title\":\"What is payment process, believe in upfront?\",\"description\":\"

The payment process, believing in upfront, involves transactions where payment is made in full at the beginning of a service or purchase, ensuring immediate financial commitment and trust between parties. This approach fosters transparency and reliability, minimizing risks and uncertainties associated with delayed or partial payments. Overall, upfront payment simplifies financial agreements, enhancing accountability and smooth transactional experiences.<\\/p>\"},{\"title\":\"What is the process of project final delivery system?\",\"description\":\"

The project final delivery system typically involves several key steps. Firstly, the project team conducts a thorough review to ensure all requirements are met. Then, they package and prepare the deliverables for client acceptance, often including documentation and training materials. Finally, the deliverables are formally handed over to the client, marking the completion of the project.<\\/p>\"},{\"title\":\"Estimate project budget for categories?\",\"description\":\"

To estimate project budgets for different categories, conduct thorough research on required resources and their costs. Utilize historical data, industry benchmarks, and expert consultations to create accurate projections. Regularly review and adjust budgets as project requirements evolve to ensure financial success.<\\/p>\"},{\"title\":\"All about project customization & monitaization\",\"description\":\"

Project customization and monetization involve tailoring your project to specific needs while generating revenue. It encompasses adapting features, design, and functionality to meet user preferences or business requirements. Effective customization and monetization strategies can enhance user experience and drive financial success for your project.<\\/p>\"}],\"contact\":{\"title\":\"Do you have question? Our experts are here to answer your questions\",\"description\":\"Our team of experts is readily available to address any inquiries you may have. Whether it\'s about our products, services, or anything else, feel free to ask\\u2014we\'re here to help!\"},\"sellerOpportunity\":{\"title\":\"Unlock the universe of Seller Opportunity\",\"description\":\"We offers high-quality films and the best documentary selection, \\nand the ability to browse alphabetically and by genre\",\"buttonName\":\"Register Now\",\"buttonLink\":\"https:\\/\\/chawkbazar-admin.redq.io\\/\",\"button2Name\":\"Documentation\",\"button2Link\":\"https:\\/\\/chawkbazar-admin.redq.io\\/\",\"image\":{\"thumbnail\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2467\\/conversions\\/app-thumbnail.jpg\",\"original\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2467\\/app.png\",\"id\":2470,\"file_name\":\"app.png\"}},\"userStories\":[{\"title\":\"World-class customer stories\",\"description\":\"I\'ve never seen a platform as easy to use, as easy to onboard new users, as easy to scale, and as easy to customize to your own workflow, process, team, clientele, and changing environment.\",\"link\":\"https:\\/\\/vimeo.com\\/356872441\",\"thumbnail\":{\"thumbnail\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2469\\/conversions\\/image-312-%281%29-thumbnail.jpg\",\"original\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2469\\/image-312-%281%29.png\",\"id\":2472,\"file_name\":\"image-312-%281%29.png\"}}]}', + 'en', + '2024-06-06 10:30:48', + '2024-06-12 11:31:46' + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/categories.sql b/packages/marvel/stubs/sql/chawkbazar/categories.sql new file mode 100644 index 0000000..610b137 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/categories.sql @@ -0,0 +1,117 @@ +INSERT INTO `categories` ( + `id`, + `name`, + `slug`, + `icon`, + `image`, + `banner_image`, + `details`, + `parent`, + `created_at`, + `updated_at`, + `deleted_at` + ) +VALUES ( + 1, + 'Bags', + 'bags', + 'HandBags', + '[{\"id\": 26, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/26/bags.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/26/conversions/bags-thumbnail.jpg\"}, {\"id\": 319, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/319/bags.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/319/conversions/bags-thumbnail.jpg\"}]', + '[{\"id\": 311, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/311/Bag.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/311/conversions/Bag-thumbnail.jpg\"}]', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + NULL, + '2021-10-09 17:38:08', + '2022-03-01 05:04:03', + NULL + ), + ( + 2, + 'Kids', + 'kids', + 'Pants', + '[{\"id\": 27, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/27/kids.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/27/conversions/kids-thumbnail.jpg\"}, {\"id\": 318, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/318/kids.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/318/conversions/kids-thumbnail.jpg\"}]', + '[{\"id\": 310, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/310/Kids.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/310/conversions/Kids-thumbnail.jpg\"}]', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + NULL, + '2021-10-09 17:38:27', + '2022-03-01 05:03:54', + NULL + ), + ( + 3, + 'Men', + 'men', + 'Wallet', + '[{\"id\": 28, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/28/men.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/28/conversions/men-thumbnail.jpg\"}, {\"id\": 317, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/317/man.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/317/conversions/man-thumbnail.jpg\"}]', + '[{\"id\": 309, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/309/Men.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/309/conversions/Men-thumbnail.jpg\"}]', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + NULL, + '2021-10-09 17:38:39', + '2022-03-01 05:03:47', + NULL + ), + ( + 4, + 'Sneakers', + 'sneakers', + 'Accessories', + '[{\"id\": 29, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/29/sneekers.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/29/conversions/sneekers-thumbnail.jpg\"}, {\"id\": 316, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/316/sneakers.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/316/conversions/sneakers-thumbnail.jpg\"}]', + '[{\"id\": 308, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/308/Sneakers.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/308/conversions/Sneakers-thumbnail.jpg\"}]', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + NULL, + '2021-10-09 17:39:56', + '2022-03-01 05:03:35', + NULL + ), + ( + 5, + 'Sports', + 'sports', + 'Accessories', + '[{\"id\": 30, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/30/sports.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/30/conversions/sports-thumbnail.jpg\"}, {\"id\": 315, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/315/sports.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/315/conversions/sports-thumbnail.jpg\"}]', + '[{\"id\": 307, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/307/sports.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/307/conversions/sports-thumbnail.jpg\"}]', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + NULL, + '2021-10-09 17:40:07', + '2022-03-01 05:03:27', + NULL + ), + ( + 6, + 'Sunglass', + 'sunglass', + 'Eyes', + '[{\"id\": 31, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/31/sunglass.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/31/conversions/sunglass-thumbnail.jpg\"}, {\"id\": 314, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/314/sunglass.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/314/conversions/sunglass-thumbnail.jpg\"}]', + '[{\"id\": 306, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/306/sunglass.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/306/conversions/sunglass-thumbnail.jpg\"}]', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + NULL, + '2021-10-09 17:40:22', + '2022-03-01 05:03:19', + NULL + ), + ( + 7, + 'Watch', + 'watch', + 'Accessories', + '[{\"id\": 32, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/32/watch.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/32/conversions/watch-thumbnail.jpg\"}, {\"id\": 313, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/313/watch.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/313/conversions/watch-thumbnail.jpg\"}]', + '[{\"id\": 305, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/305/watch.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/305/conversions/watch-thumbnail.jpg\"}]', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + NULL, + '2021-10-09 17:40:33', + '2022-03-01 05:03:08', + NULL + ), + ( + 8, + 'Women', + 'women', + 'WomenDress', + '[{\"id\": 33, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/33/women.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/33/conversions/women-thumbnail.jpg\"}, {\"id\": 312, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/312/woman.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/312/conversions/woman-thumbnail.jpg\"}]', + '[{\"id\": 304, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/304/women.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/304/conversions/women-thumbnail.jpg\"}]', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine. I am so happy, my dear friend, so absorbed in the exquisite sense of mere tranquil existence, that I neglect my talents. I should be incapable of drawing a single stroke at the present moment; and yet I feel that I never was a greater artist than now.', + NULL, + '2021-10-09 17:40:47', + '2022-03-01 05:02:30', + NULL + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/category_product.sql b/packages/marvel/stubs/sql/chawkbazar/category_product.sql new file mode 100644 index 0000000..4d9679a --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/category_product.sql @@ -0,0 +1,95 @@ +INSERT INTO `category_product` (`id`, `product_id`, `category_id`) VALUES +(1, 1, 8), +(2, 2, 5), +(3, 2, 4), +(4, 2, 3), +(5, 3, 8), +(6, 4, 6), +(7, 4, 5), +(8, 5, 8), +(9, 5, 5), +(10, 6, 7), +(11, 7, 8), +(12, 8, 8), +(13, 9, 8), +(14, 10, 8), +(15, 10, 3), +(16, 11, 8), +(17, 12, 1), +(18, 11, 6), +(19, 11, 3), +(20, 11, 2), +(21, 10, 2), +(22, 14, 5), +(23, 14, 4), +(24, 14, 3), +(25, 13, 8), +(26, 13, 7), +(27, 13, 3), +(28, 15, 8), +(29, 16, 5), +(30, 16, 3), +(31, 17, 3), +(32, 18, 7), +(33, 18, 3), +(34, 19, 7), +(35, 19, 3), +(36, 19, 8), +(37, 20, 8), +(38, 20, 5), +(39, 21, 3), +(40, 21, 5), +(41, 22, 8), +(42, 23, 1), +(43, 24, 1), +(44, 24, 8), +(45, 25, 8), +(46, 25, 3), +(47, 25, 5), +(48, 25, 4), +(49, 26, 8), +(50, 26, 5), +(51, 26, 3), +(52, 26, 1), +(53, 27, 8), +(54, 27, 4), +(55, 27, 5), +(56, 27, 3), +(57, 28, 8), +(58, 28, 5), +(59, 28, 6), +(60, 28, 3), +(61, 29, 2), +(62, 30, 1), +(63, 31, 5), +(64, 31, 3), +(65, 32, 1), +(66, 33, 8), +(67, 34, 8), +(68, 35, 2), +(69, 36, 8), +(70, 37, 7), +(71, 38, 2), +(72, 39, 6), +(73, 40, 6), +(74, 40, 3), +(75, 41, 3), +(76, 41, 8), +(77, 42, 5), +(78, 43, 3), +(79, 44, 1), +(80, 45, 2), +(81, 46, 4), +(82, 47, 3), +(83, 48, 7), +(84, 49, 5), +(85, 49, 3), +(86, 49, 8), +(87, 50, 8), +(88, 51, 1), +(89, 52, 6), +(90, 53, 8), +(91, 54, 7), +(92, 55, 8), +(93, 56, 8), +(94, 57, 2); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/commissions.sql b/packages/marvel/stubs/sql/chawkbazar/commissions.sql new file mode 100644 index 0000000..269ec84 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/commissions.sql @@ -0,0 +1,39 @@ +INSERT INTO `commissions` ( + `id`, + `level`, + `sub_level`, + `description`, + `min_balance`, + `max_balance`, + `commission`, + `image`, + `language`, + `created_at`, + `updated_at` + ) +VALUES ( + 79, + 'Level One', + 'Charges for listing a product on the platform.', + 'Earn attractive commissions with every sale! Our competitive rates reward your hard work and dedication, motivating you to achieve more. Join our sales team and turn your efforts into substantial earnings.', + 200, + '3000', + 15.00, + '{\"thumbnail\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2459\\/conversions\\/Frame-thumbnail.jpg\",\"original\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2459\\/Frame.png\",\"id\":2462,\"file_name\":\"Frame.png\"}', + 'en', + '2024-06-11 18:52:37', + '2024-06-12 11:31:46' + ), + ( + 83, + 'Level Two', + 'Charges for sales in a product on the platform.', + 'Get lucrative commissions on each sale! Our affordable prices encourage you to work harder and accomplish more by rewarding your diligence and hard work. Become a member of our sales team and make a big income from your efforts.', + 500, + '1000', + 20.00, + '{\"thumbnail\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2464\\/conversions\\/Frame-thumbnail.jpg\",\"original\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/2464\\/Frame.png\",\"id\":2467,\"file_name\":\"Frame.png\"}', + 'en', + '2024-06-12 10:58:09', + '2024-06-12 11:31:46' + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/coupons.sql b/packages/marvel/stubs/sql/chawkbazar/coupons.sql new file mode 100644 index 0000000..9922283 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/coupons.sql @@ -0,0 +1,247 @@ +INSERT INTO `coupons` ( + `id`, + `code`, + `language`, + `description`, + `image`, + `type`, + `amount`, + `minimum_cart_amount`, + `active_from`, + `expire_at`, + `target`, + `is_approve`, + `shop_id`, + `user_id`, + `created_at`, + `updated_at`, + `deleted_at` + ) +VALUES ( + 1, + 'EID2', + 'en', + NULL, + '{\"id\": 246, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/246/2x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/246/conversions/2x2x-thumbnail-thumbnail.jpg\"}', + 'fixed', + 2.00, + 0.00, + '2021-10-25T07:34:58.000Z', + '2026-11-30T07:34:58.000Z', + 0, + 1, + NULL, + NULL, + '2021-10-25 01:37:05', + '2024-01-14 23:22:15', + NULL + ), + ( + 2, + '4OFF', + 'en', + NULL, + '{\"id\": 247, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/247/4x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/247/conversions/4x2x-thumbnail-thumbnail.jpg\"}', + 'fixed', + 4.00, + 0.00, + '2021-10-25T07:34:58.000Z', + '2027-12-31T07:34:58.000Z', + 0, + 1, + NULL, + NULL, + '2021-10-25 01:37:29', + '2024-01-14 23:22:12', + NULL + ), + ( + 3, + 'RAMADAN5', + 'en', + NULL, + '{\"id\": 248, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/248/5x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/248/conversions/5x2x-thumbnail-thumbnail.jpg\"}', + 'fixed', + 5.00, + 0.00, + '2021-10-25T07:34:58.000Z', + '2030-12-31T07:34:58.000Z', + 0, + 1, + NULL, + NULL, + '2021-10-25 01:39:35', + '2024-01-14 23:22:09', + NULL + ), + ( + 4, + '6OFF', + 'en', + NULL, + '{\"id\": 249, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/249/6x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/249/conversions/6x2x-thumbnail-thumbnail.jpg\"}', + 'fixed', + 6.00, + 0.00, + '2021-10-25T07:34:58.000Z', + '2029-01-31T07:34:58.000Z', + 0, + 1, + NULL, + NULL, + '2021-10-25 01:40:08', + '2024-01-14 23:22:07', + NULL + ), + ( + 5, + 'SUMMER8', + 'en', + NULL, + '{\"id\": 250, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/250/8x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/250/conversions/8x2x-thumbnail-thumbnail.jpg\"}', + 'fixed', + 8.00, + 0.00, + '2021-10-25T12:32:39.000Z', + '2028-12-31T12:32:39.000Z', + 0, + 1, + NULL, + NULL, + '2021-10-25 06:35:30', + '2024-01-14 23:22:03', + NULL + ), + ( + 6, + 'WINTER10', + 'en', + NULL, + '{\"id\": 251, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/251/10x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/251/conversions/10x2x-thumbnail-thumbnail.jpg\"}', + 'fixed', + 10.00, + 0.00, + '2021-10-25T12:32:39.000Z', + '2026-01-31T12:32:39.000Z', + 0, + 1, + NULL, + NULL, + '2021-10-25 06:36:35', + '2024-01-14 23:22:00', + NULL + ), + ( + 7, + '12OFF', + 'en', + NULL, + '{\"id\": 252, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/252/12x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/252/conversions/12x2x-thumbnail-thumbnail.jpg\"}', + 'fixed', + 12.00, + 0.00, + '2021-10-25T12:32:39.000Z', + '2027-11-30T12:32:39.000Z', + 0, + 1, + NULL, + NULL, + '2021-10-25 06:37:34', + '2024-01-14 23:21:57', + NULL + ), + ( + 8, + 'SUMMER15', + 'en', + NULL, + '{\"id\": 253, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/253/15x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/253/conversions/15x2x-thumbnail-thumbnail.jpg\"}', + 'fixed', + 15.00, + 0.00, + '2021-10-25T12:32:39.000Z', + '2028-02-28T12:32:39.000Z', + 0, + 1, + NULL, + NULL, + '2021-10-25 06:38:02', + '2024-01-14 23:21:52', + NULL + ), + ( + 9, + 'CHRISTMAS18', + 'en', + NULL, + '{\"id\": 254, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/254/18x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/254/conversions/18x2x-thumbnail-thumbnail.jpg\"}', + 'fixed', + 18.00, + 0.00, + '2021-10-25T12:32:39.000Z', + '2029-12-31T12:32:39.000Z', + 0, + 1, + NULL, + NULL, + '2021-10-25 06:39:20', + '2024-01-14 22:26:16', + NULL + ), + ( + 10, + '20OFF', + 'en', + NULL, + '{\"id\": 255, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/255/20x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/255/conversions/20x2x-thumbnail-thumbnail.jpg\"}', + 'fixed', + 20.00, + 0.00, + '2021-10-25T12:32:39.000Z', + '2030-10-25T12:32:39.000Z', + 0, + 1, + NULL, + NULL, + '2021-10-25 06:39:51', + '2024-01-14 22:26:13', + NULL + ), + ( + 11, + 'NEWYEARSALE', + 'en', + NULL, + '{\"id\": 255, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/255/20x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/255/conversions/20x2x-thumbnail-thumbnail.jpg\"}', + 'percentage', + 10.00, + 100.00, + '2024-01-15T04:26:51.000Z', + '2024-12-31T18:00:00.000Z', + 0, + 1, + 11, + 1, + '2024-01-14 22:27:14', + '2024-01-14 22:36:23', + NULL + ), + ( + 12, + 'BLACKFRIDAY', + 'en', + NULL, + '{\"id\": 254, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/254/18x2x-thumbnail.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/254/conversions/18x2x-thumbnail-thumbnail.jpg\"}', + 'fixed', + 2.00, + 500.00, + '2024-01-15T04:36:02.519Z', + '2025-08-31T18:00:00.000Z', + 0, + 1, + 11, + 1, + '2024-01-14 22:39:20', + '2024-01-14 22:41:08', + NULL + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/media.sql b/packages/marvel/stubs/sql/chawkbazar/media.sql new file mode 100644 index 0000000..b21fed9 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/media.sql @@ -0,0 +1,324 @@ +INSERT INTO `media` (`id`, `model_type`, `model_id`, `uuid`, `collection_name`, `name`, `file_name`, `mime_type`, `disk`, `conversions_disk`, `size`, `manipulations`, `generated_conversions`, `custom_properties`, `responsive_images`, `order_column`, `created_at`, `updated_at`) VALUES +(1, 'Marvel\\Database\\Models\\Attachment', 1, 'e0d4cfc9-cb74-4598-8b7a-3715fbfd9aa9', 'default', 'user', 'user.png', 'image/png', 's3', 's3', 22159, '[]', '[]', '[]', '[]', 1, '2021-10-09 13:30:23', '2021-10-09 13:30:23'), +(2, 'Marvel\\Database\\Models\\Attachment', 2, '578c1f0b-dfdc-46aa-a04f-2ded1e57b6e2', 'default', 'user', 'user.png', 'image/png', 's3', 's3', 22159, '[]', '[]', '[]', '[]', 2, '2021-10-09 13:30:34', '2021-10-09 13:30:34'), +(3, 'Marvel\\Database\\Models\\Attachment', 3, 'fc6d10dd-804d-49a2-9167-5b68d08f7c08', 'default', 'user', 'user.png', 'image/png', 's3', 's3', 22159, '[]', '[]', '[]', '[]', 3, '2021-10-09 13:39:00', '2021-10-09 13:39:00'), +(4, 'Marvel\\Database\\Models\\Attachment', 4, 'ab5238bf-6a68-420f-b54b-4e4b94213c9f', 'default', 'user', 'user.png', 'image/png', 's3', 's3', 22159, '[]', '[]', '[]', '[]', 4, '2021-10-09 13:42:22', '2021-10-09 13:42:22'), +(5, 'Marvel\\Database\\Models\\Attachment', 5, '7a546abd-790f-4328-81cc-698ea70e2363', 'default', 'user', 'user.png', 'image/png', 's3', 's3', 22159, '[]', '[]', '[]', '[]', 5, '2021-10-09 13:47:15', '2021-10-09 13:47:15'), +(6, 'Marvel\\Database\\Models\\Attachment', 6, '41c98d41-d64d-4d8a-b714-61f69d823ab7', 'default', 'user', 'user.png', 'image/png', 's3', 's3', 22159, '[]', '[]', '[]', '[]', 6, '2021-10-09 13:47:43', '2021-10-09 13:47:43'), +(7, 'Marvel\\Database\\Models\\Attachment', 7, '93d27a3c-bb8c-42ed-9872-68403647f3ce', 'default', 'user', 'user.png', 'image/png', 's3', 's3', 22159, '[]', '{\"thumbnail\": true}', '[]', '[]', 7, '2021-10-09 13:53:45', '2021-10-09 13:53:45'), +(8, 'Marvel\\Database\\Models\\Attachment', 8, '50541671-4dc2-4669-a80d-43c13854922e', 'default', 'Untitled-4', 'Untitled-4.jpg', 'image/jpeg', 's3', 's3', 192327, '[]', '{\"thumbnail\": true}', '[]', '[]', 8, '2021-10-09 16:20:22', '2021-10-09 16:20:22'), +(9, 'Marvel\\Database\\Models\\Attachment', 9, '45930543-3fde-4c83-932c-b7aed5ca4d81', 'default', 'Untitled-4', 'Untitled-4.jpg', 'image/jpeg', 's3', 's3', 192327, '[]', '{\"thumbnail\": true}', '[]', '[]', 9, '2021-10-09 16:20:25', '2021-10-09 16:20:26'), +(10, 'Marvel\\Database\\Models\\Attachment', 10, 'f34e2f26-0eb6-4b83-bcac-a1d6248854be', 'default', 'logo', 'logo.svg', 'image/svg', 's3', 's3', 4193, '[]', '[]', '[]', '[]', 10, '2021-10-09 16:21:30', '2021-10-09 16:21:30'), +(11, 'Marvel\\Database\\Models\\Attachment', 11, 'c485538e-769f-4d01-95be-e6bb9b6226a5', 'default', 'og-image-01', 'og-image-01.png', 'image/png', 's3', 's3', 20029, '[]', '{\"thumbnail\": true}', '[]', '[]', 11, '2021-10-09 16:21:40', '2021-10-09 16:21:40'), +(12, 'Marvel\\Database\\Models\\Attachment', 12, 'a83f22c6-8eea-4fdd-bf51-8b2eec93c8ba', 'default', 'chawkBazar573_350', 'chawkBazar573_350.png', 'image/png', 's3', 's3', 97336, '[]', '{\"thumbnail\": true}', '[]', '[]', 12, '2021-10-09 16:22:16', '2021-10-09 16:22:16'), +(13, 'Marvel\\Database\\Models\\Attachment', 13, 'f1e9e1e7-9923-4cea-8b0e-42b98beb43bc', 'default', 'Men\'s Collection', 'Men\'s-Collection.jpg', 'image/jpeg', 's3', 's3', 55377, '[]', '{\"thumbnail\": true}', '[]', '[]', 13, '2021-10-09 17:01:35', '2021-10-09 17:01:35'), +(14, 'Marvel\\Database\\Models\\Attachment', 14, 'b618da8d-b5f4-47fe-947e-86a6ee1e0ebf', 'default', 'Men\'s Collection', 'Men\'s-Collection.jpg', 'image/jpeg', 's3', 's3', 55377, '[]', '{\"thumbnail\": true}', '[]', '[]', 14, '2021-10-09 17:02:11', '2021-10-09 17:02:11'), +(15, 'Marvel\\Database\\Models\\Attachment', 15, '03601c65-8744-47b9-951b-40ec15272a78', 'default', 'fashion', 'fashion.png', 'image/png', 's3', 's3', 2574, '[]', '{\"thumbnail\": true}', '[]', '[]', 15, '2021-10-09 17:05:23', '2021-10-09 17:05:23'), +(16, 'Marvel\\Database\\Models\\Attachment', 16, 'b38ee4af-259f-40cc-9920-a7ba40d71e74', 'default', 'Untitled-3', 'Untitled-3.jpg', 'image/jpeg', 's3', 's3', 70753, '[]', '{\"thumbnail\": true}', '[]', '[]', 16, '2021-10-09 17:06:58', '2021-10-09 17:06:58'), +(17, 'Marvel\\Database\\Models\\Attachment', 17, '7e42159e-b818-494c-9372-a3a8188f1a67', 'default', 'chawkb.sports', 'chawkb.sports.png', 'image/png', 's3', 's3', 101358, '[]', '{\"thumbnail\": true}', '[]', '[]', 17, '2021-10-09 17:17:42', '2021-10-09 17:17:42'), +(18, 'Marvel\\Database\\Models\\Attachment', 18, '927ff16a-c484-4699-8ebb-cbc20f3c8f63', 'default', 'chawkbwomen', 'chawkbwomen.jpg', 'image/jpeg', 's3', 's3', 114127, '[]', '{\"thumbnail\": true}', '[]', '[]', 18, '2021-10-09 17:18:48', '2021-10-09 17:18:48'), +(19, 'Marvel\\Database\\Models\\Attachment', 19, '6199d122-7ce6-4478-9a71-1c7d939645d9', 'default', 'chawkbwomen', 'chawkbwomen.jpg', 'image/jpeg', 's3', 's3', 114127, '[]', '{\"thumbnail\": true}', '[]', '[]', 19, '2021-10-09 17:20:47', '2021-10-09 17:20:47'), +(20, 'Marvel\\Database\\Models\\Attachment', 20, '6a60c610-75a7-4ae1-bec0-25b772ffa136', 'default', 'chawkbsunglass', 'chawkbsunglass.jpg', 'image/jpeg', 's3', 's3', 128922, '[]', '{\"thumbnail\": true}', '[]', '[]', 20, '2021-10-09 17:21:10', '2021-10-09 17:21:10'), +(21, 'Marvel\\Database\\Models\\Attachment', 21, '2d7f9338-836c-4bb0-a1fa-974886e0009b', 'default', 'chawkbcoupond', 'chawkbcoupond.jpg', 'image/jpeg', 's3', 's3', 20338, '[]', '{\"thumbnail\": true}', '[]', '[]', 21, '2021-10-09 17:21:30', '2021-10-09 17:21:30'), +(22, 'Marvel\\Database\\Models\\Attachment', 22, 'd1c86cb2-eb2f-4906-8d41-ea4c4fbaba88', 'default', 'chawkbbackpack', 'chawkbbackpack.jpg', 'image/jpeg', 's3', 's3', 288239, '[]', '{\"thumbnail\": true}', '[]', '[]', 22, '2021-10-09 17:21:55', '2021-10-09 17:21:56'), +(23, 'Marvel\\Database\\Models\\Attachment', 23, '3cc168c2-fb34-4f6f-a4bf-fff2406f7fa2', 'default', 'chawkbwomen', 'chawkbwomen.jpg', 'image/jpeg', 's3', 's3', 114127, '[]', '{\"thumbnail\": true}', '[]', '[]', 23, '2021-10-09 17:22:15', '2021-10-09 17:22:15'), +(24, 'Marvel\\Database\\Models\\Attachment', 24, 'f728ce68-3756-4bbe-8e8a-85b18249e344', 'default', 'Banner 5', 'Banner-5.png', 'image/png', 's3', 's3', 117129, '[]', '{\"thumbnail\": true}', '[]', '[]', 24, '2021-10-09 17:23:13', '2021-10-09 17:23:13'), +(25, 'Marvel\\Database\\Models\\Attachment', 25, 'db35c9bc-7bda-4c87-b29c-d48bf55eb6c3', 'default', 'Banner 5', 'Banner-5.png', 'image/png', 's3', 's3', 117129, '[]', '{\"thumbnail\": true}', '[]', '[]', 25, '2021-10-09 17:23:58', '2021-10-09 17:23:58'), +(26, 'Marvel\\Database\\Models\\Attachment', 26, 'af11c038-ae8c-40f1-a9be-61e51d3b78b5', 'default', 'bags', 'bags.png', 'image/png', 's3', 's3', 17083, '[]', '{\"thumbnail\": true}', '[]', '[]', 26, '2021-10-09 17:37:38', '2021-10-09 17:37:38'), +(27, 'Marvel\\Database\\Models\\Attachment', 27, 'e5eb0193-b2d2-4f72-ab33-7a708b647d58', 'default', 'kids', 'kids.png', 'image/png', 's3', 's3', 13277, '[]', '{\"thumbnail\": true}', '[]', '[]', 27, '2021-10-09 17:38:22', '2021-10-09 17:38:23'), +(28, 'Marvel\\Database\\Models\\Attachment', 28, '6ee925f5-b541-4428-b74f-709569dc9442', 'default', 'men', 'men.png', 'image/png', 's3', 's3', 15598, '[]', '{\"thumbnail\": true}', '[]', '[]', 28, '2021-10-09 17:38:34', '2021-10-09 17:38:34'), +(29, 'Marvel\\Database\\Models\\Attachment', 29, '349b57bb-5cb3-4cdc-acc8-c04710bdc3ba', 'default', 'sneekers', 'sneekers.png', 'image/png', 's3', 's3', 17150, '[]', '{\"thumbnail\": true}', '[]', '[]', 29, '2021-10-09 17:38:47', '2021-10-09 17:38:47'), +(30, 'Marvel\\Database\\Models\\Attachment', 30, 'b76fee2e-0d2a-4a68-b890-619976710eff', 'default', 'sports', 'sports.png', 'image/png', 's3', 's3', 23982, '[]', '{\"thumbnail\": true}', '[]', '[]', 30, '2021-10-09 17:40:03', '2021-10-09 17:40:03'), +(31, 'Marvel\\Database\\Models\\Attachment', 31, '9778d275-3c18-4431-b93d-0d14591945d8', 'default', 'sunglass', 'sunglass.png', 'image/png', 's3', 's3', 17982, '[]', '{\"thumbnail\": true}', '[]', '[]', 31, '2021-10-09 17:40:14', '2021-10-09 17:40:14'), +(32, 'Marvel\\Database\\Models\\Attachment', 32, '7540b424-021c-42ad-a368-e5d58524b156', 'default', 'watch', 'watch.png', 'image/png', 's3', 's3', 15779, '[]', '{\"thumbnail\": true}', '[]', '[]', 32, '2021-10-09 17:40:27', '2021-10-09 17:40:27'), +(33, 'Marvel\\Database\\Models\\Attachment', 33, '271f84bc-3ff4-4438-bb7a-741808322635', 'default', 'women', 'women.png', 'image/png', 's3', 's3', 22297, '[]', '{\"thumbnail\": true}', '[]', '[]', 33, '2021-10-09 17:40:40', '2021-10-09 17:40:40'), +(34, 'Marvel\\Database\\Models\\Attachment', 34, '66f9cf31-a969-40cd-8f51-4c9364f982a8', 'default', 'banner-mobile-3', 'banner-mobile-3.jpg', 'image/jpeg', 's3', 's3', 36290, '[]', '{\"thumbnail\": true}', '[]', '[]', 34, '2021-10-09 17:52:47', '2021-10-09 17:52:47'), +(35, 'Marvel\\Database\\Models\\Attachment', 35, '62532294-7ea1-4667-a949-59f40e5ce1ba', 'default', 'banner-1', 'banner-1.jpg', 'image/jpeg', 's3', 's3', 285505, '[]', '{\"thumbnail\": true}', '[]', '[]', 35, '2021-10-09 17:53:33', '2021-10-09 17:53:33'), +(36, 'Marvel\\Database\\Models\\Attachment', 36, 'e3f26c8d-c67c-46da-bf79-484cd0242510', 'default', 'banner-2', 'banner-2.jpg', 'image/jpeg', 's3', 's3', 236636, '[]', '{\"thumbnail\": true}', '[]', '[]', 36, '2021-10-09 17:53:48', '2021-10-09 17:53:49'), +(37, 'Marvel\\Database\\Models\\Attachment', 37, 'c1298ab1-4ddc-4444-9d64-59834437bb9e', 'default', 'banner-3', 'banner-3.jpg', 'image/jpeg', 's3', 's3', 19855, '[]', '{\"thumbnail\": true}', '[]', '[]', 37, '2021-10-09 17:54:17', '2021-10-09 17:54:17'), +(38, 'Marvel\\Database\\Models\\Attachment', 38, '89d69fff-3aae-4c3b-9a24-bd86e2e95c84', 'default', '1', '1.jpg', 'image/jpeg', 's3', 's3', 136581, '[]', '{\"thumbnail\": true}', '[]', '[]', 38, '2021-10-09 17:55:41', '2021-10-09 17:55:41'), +(39, 'Marvel\\Database\\Models\\Attachment', 39, '5b6f6a01-967c-4826-85f3-cc4a6566ecec', 'default', 'AE', 'AE.svg', 'image/svg', 's3', 's3', 2535, '[]', '[]', '[]', '[]', 39, '2021-10-10 13:21:22', '2021-10-10 13:21:22'), +(40, 'Marvel\\Database\\Models\\Attachment', 40, '0d55874e-5a2a-4dbf-bb36-822046aa3c52', 'default', 'logo1', 'logo1.png', 'image/png', 's3', 's3', 4125, '[]', '{\"thumbnail\": true}', '[]', '[]', 40, '2021-10-10 13:21:22', '2021-10-10 13:21:22'), +(41, 'Marvel\\Database\\Models\\Attachment', 41, '608a5395-25eb-41ae-a54a-ef6c41d7aa63', 'default', 'adidas', 'adidas.png', 'image/png', 's3', 's3', 73906, '[]', '{\"thumbnail\": true}', '[]', '[]', 41, '2021-10-10 13:30:48', '2021-10-10 13:30:49'), +(42, 'Marvel\\Database\\Models\\Attachment', 42, 'e5cc1862-9fbd-4a5d-b56e-0f3b2d6676ef', 'default', 'fustion', 'fustion.png', 'image/png', 's3', 's3', 4125, '[]', '{\"thumbnail\": true}', '[]', '[]', 42, '2021-10-10 13:31:51', '2021-10-10 13:31:51'), +(43, 'Marvel\\Database\\Models\\Attachment', 43, '1b0f48a3-6d99-4342-9feb-4d06b84589c1', 'default', 'puma-logo', 'puma-logo.png', 'image/png', 's3', 's3', 47631, '[]', '{\"thumbnail\": true}', '[]', '[]', 43, '2021-10-10 13:50:07', '2021-10-10 13:50:07'), +(44, 'Marvel\\Database\\Models\\Attachment', 44, 'de5506a5-fcca-46b0-8244-3280a0a32a22', 'default', 'vintege', 'vintege.png', 'image/png', 's3', 's3', 4600, '[]', '{\"thumbnail\": true}', '[]', '[]', 44, '2021-10-10 13:50:11', '2021-10-10 13:50:11'), +(45, 'Marvel\\Database\\Models\\Attachment', 45, '9faab4b4-a0a4-48f8-ac60-8373984bf337', 'default', 'dior', 'dior.png', 'image/png', 's3', 's3', 83177, '[]', '{\"thumbnail\": true}', '[]', '[]', 45, '2021-10-10 13:50:50', '2021-10-10 13:50:50'), +(46, 'Marvel\\Database\\Models\\Attachment', 46, '10b0b8a0-c40c-405d-aed1-07dc7ce07d35', 'default', 'logo3', 'logo3.png', 'image/png', 's3', 's3', 7335, '[]', '{\"thumbnail\": true}', '[]', '[]', 46, '2021-10-10 13:50:55', '2021-10-10 13:50:55'), +(47, 'Marvel\\Database\\Models\\Attachment', 47, 'f48b13f5-2866-4844-a4ee-03cdd05aece7', 'default', 'levi-s', 'levi-s.png', 'image/png', 's3', 's3', 104675, '[]', '{\"thumbnail\": true}', '[]', '[]', 47, '2021-10-10 13:51:22', '2021-10-10 13:51:23'), +(48, 'Marvel\\Database\\Models\\Attachment', 48, 'e776c383-e0e3-493a-b06c-42eb188f612f', 'default', 'logo4', 'logo4.png', 'image/png', 's3', 's3', 6376, '[]', '{\"thumbnail\": true}', '[]', '[]', 48, '2021-10-10 13:51:29', '2021-10-10 13:51:29'), +(49, 'Marvel\\Database\\Models\\Attachment', 49, '6d5b12bc-1f24-419d-ac51-903eed99e841', 'default', 'logo5', 'logo5.png', 'image/png', 's3', 's3', 4692, '[]', '{\"thumbnail\": true}', '[]', '[]', 49, '2021-10-10 13:55:12', '2021-10-10 13:55:12'), +(50, 'Marvel\\Database\\Models\\Attachment', 50, 'a96d0581-8ba7-40cc-a9b9-fea407dd8f59', 'default', 'Calvin klein', 'Calvin-klein.png', 'image/png', 's3', 's3', 110247, '[]', '{\"thumbnail\": true}', '[]', '[]', 50, '2021-10-10 13:55:43', '2021-10-10 13:55:43'), +(51, 'Marvel\\Database\\Models\\Attachment', 51, 'b3cdd16b-c382-488f-8635-f3f3d3979c63', 'default', 'logo5', 'logo5.png', 'image/png', 's3', 's3', 4692, '[]', '{\"thumbnail\": true}', '[]', '[]', 51, '2021-10-10 13:55:56', '2021-10-10 13:55:56'), +(52, 'Marvel\\Database\\Models\\Attachment', 52, 'dfcb6825-6d31-44e2-a3ff-b3e475fbd3b6', 'default', 'Calvin klein', 'Calvin-klein.png', 'image/png', 's3', 's3', 110247, '[]', '{\"thumbnail\": true}', '[]', '[]', 52, '2021-10-10 13:56:02', '2021-10-10 13:56:02'), +(53, 'Marvel\\Database\\Models\\Attachment', 53, '9ca7e26d-b715-4845-b0a8-a4a9ada90625', 'default', 'Calvin klein', 'Calvin-klein.png', 'image/png', 's3', 's3', 110247, '[]', '{\"thumbnail\": true}', '[]', '[]', 53, '2021-10-10 13:56:19', '2021-10-10 13:56:19'), +(54, 'Marvel\\Database\\Models\\Attachment', 54, '7469bda5-d785-43f7-9d40-a5d5ce049c14', 'default', 'logo5', 'logo5.png', 'image/png', 's3', 's3', 4692, '[]', '{\"thumbnail\": true}', '[]', '[]', 54, '2021-10-10 13:56:51', '2021-10-10 13:56:52'), +(55, 'Marvel\\Database\\Models\\Attachment', 55, '65a7fa04-9c69-4fdb-8d98-67215cc0af6d', 'default', 'tissot', 'tissot.png', 'image/png', 's3', 's3', 82906, '[]', '{\"thumbnail\": true}', '[]', '[]', 55, '2021-10-10 13:57:50', '2021-10-10 13:57:51'), +(56, 'Marvel\\Database\\Models\\Attachment', 56, '20d3eca3-8fba-4f1a-ac9b-39d1b25c9c1a', 'default', 'logo6', 'logo6.png', 'image/png', 's3', 's3', 10811, '[]', '{\"thumbnail\": true}', '[]', '[]', 56, '2021-10-10 13:57:55', '2021-10-10 13:57:56'), +(57, 'Marvel\\Database\\Models\\Attachment', 57, '35a870be-f8af-4ade-8819-33a31268bd31', 'default', 'nike', 'nike.png', 'image/png', 's3', 's3', 77110, '[]', '{\"thumbnail\": true}', '[]', '[]', 57, '2021-10-10 13:58:24', '2021-10-10 13:58:25'), +(58, 'Marvel\\Database\\Models\\Attachment', 58, '6a9f78b2-b30c-4fb9-950d-2d6232e1c09e', 'default', 'logo7', 'logo7.png', 'image/png', 's3', 's3', 6010, '[]', '{\"thumbnail\": true}', '[]', '[]', 58, '2021-10-10 13:58:29', '2021-10-10 13:58:29'), +(59, 'Marvel\\Database\\Models\\Attachment', 59, '711d928c-6628-44dd-a5ce-482166cfeafc', 'default', 'herschel', 'herschel.png', 'image/png', 's3', 's3', 109736, '[]', '{\"thumbnail\": true}', '[]', '[]', 59, '2021-10-10 13:58:54', '2021-10-10 13:58:54'), +(60, 'Marvel\\Database\\Models\\Attachment', 60, '1251386a-c992-4dd7-9c8c-a8841ffde2a8', 'default', 'logo8', 'logo8.png', 'image/png', 's3', 's3', 7658, '[]', '{\"thumbnail\": true}', '[]', '[]', 60, '2021-10-10 13:59:02', '2021-10-10 13:59:02'), +(61, 'Marvel\\Database\\Models\\Attachment', 61, '0543c3db-f0f0-4a52-9d48-431b59f59ecd', 'default', 'Hollister', 'Hollister.png', 'image/png', 's3', 's3', 98152, '[]', '{\"thumbnail\": true}', '[]', '[]', 61, '2021-10-10 13:59:24', '2021-10-10 13:59:24'), +(62, 'Marvel\\Database\\Models\\Attachment', 62, 'd67f9206-f67a-4d1a-89f0-5d5b5189102c', 'default', 'logo4', 'logo4.png', 'image/png', 's3', 's3', 6376, '[]', '{\"thumbnail\": true}', '[]', '[]', 62, '2021-10-10 13:59:29', '2021-10-10 13:59:29'), +(63, 'Marvel\\Database\\Models\\Attachment', 63, 'ba74fec0-a40c-464e-81d7-afce1ca6f8f8', 'default', 'zara', 'zara.png', 'image/png', 's3', 's3', 129667, '[]', '{\"thumbnail\": true}', '[]', '[]', 63, '2021-10-10 14:00:05', '2021-10-10 14:00:05'), +(64, 'Marvel\\Database\\Models\\Attachment', 64, '3b19edee-d781-4be3-9a43-cc56414970e7', 'default', 'logo10', 'logo10.png', 'image/png', 's3', 's3', 3917, '[]', '{\"thumbnail\": true}', '[]', '[]', 64, '2021-10-10 14:00:17', '2021-10-10 14:00:18'), +(65, 'Marvel\\Database\\Models\\Attachment', 65, '72056399-9e25-456c-9f89-97b3a4e9b3d7', 'default', 'gucci', 'gucci.png', 'image/png', 's3', 's3', 100904, '[]', '{\"thumbnail\": true}', '[]', '[]', 65, '2021-10-10 14:01:05', '2021-10-10 14:01:05'), +(66, 'Marvel\\Database\\Models\\Attachment', 66, '5fdff9e8-ec9c-445d-af37-f9d05407d455', 'default', 'gucci', 'gucci.png', 'image/png', 's3', 's3', 100904, '[]', '{\"thumbnail\": true}', '[]', '[]', 66, '2021-10-10 14:01:07', '2021-10-10 14:01:07'), +(67, 'Marvel\\Database\\Models\\Attachment', 67, '8af00cdc-c08f-4cba-8870-8705eb014898', 'default', 'logo11', 'logo11.png', 'image/png', 's3', 's3', 4064, '[]', '{\"thumbnail\": true}', '[]', '[]', 67, '2021-10-10 14:01:32', '2021-10-10 14:01:32'), +(68, 'Marvel\\Database\\Models\\Attachment', 68, '56ff1b9d-ea9a-4846-966e-5805f698fcc4', 'default', 'under-armour', 'under-armour.png', 'image/png', 's3', 's3', 74071, '[]', '{\"thumbnail\": true}', '[]', '[]', 68, '2021-10-10 14:01:50', '2021-10-10 14:01:50'), +(69, 'Marvel\\Database\\Models\\Attachment', 69, '9e94397a-a717-49ca-810a-6eda82bc5f94', 'default', 'logo12', 'logo12.png', 'image/png', 's3', 's3', 5089, '[]', '{\"thumbnail\": true}', '[]', '[]', 69, '2021-10-10 14:01:55', '2021-10-10 14:01:55'), +(70, 'Marvel\\Database\\Models\\Attachment', 70, '0086ffa4-bdc7-4646-9dc7-46ff312a136a', 'default', 'emporio-armani', 'emporio-armani.png', 'image/png', 's3', 's3', 92425, '[]', '{\"thumbnail\": true}', '[]', '[]', 70, '2021-10-10 14:02:19', '2021-10-10 14:02:19'), +(71, 'Marvel\\Database\\Models\\Attachment', 71, '96bf72d7-c5ba-418e-a793-ea72c99f2d50', 'default', 'vintege', 'vintege.png', 'image/png', 's3', 's3', 4600, '[]', '{\"thumbnail\": true}', '[]', '[]', 71, '2021-10-10 14:02:52', '2021-10-10 14:02:52'), +(72, 'Marvel\\Database\\Models\\Attachment', 72, 'e244d6c4-759e-4472-813c-d4f271a49a09', 'default', 'converse', 'converse.png', 'image/png', 's3', 's3', 61787, '[]', '{\"thumbnail\": true}', '[]', '[]', 72, '2021-10-10 14:03:30', '2021-10-10 14:03:30'), +(73, 'Marvel\\Database\\Models\\Attachment', 73, '0ec4564d-c540-4b62-859c-34888839e428', 'default', 'logo14', 'logo14.png', 'image/png', 's3', 's3', 8038, '[]', '{\"thumbnail\": true}', '[]', '[]', 73, '2021-10-10 14:03:36', '2021-10-10 14:03:36'), +(74, 'Marvel\\Database\\Models\\Attachment', 74, '1861e056-cd2b-4a16-b493-36279e6a28cb', 'default', 'ray-ban', 'ray-ban.png', 'image/png', 's3', 's3', 78389, '[]', '{\"thumbnail\": true}', '[]', '[]', 74, '2021-10-10 14:03:56', '2021-10-10 14:03:57'), +(75, 'Marvel\\Database\\Models\\Attachment', 75, 'd329c582-d24c-4af6-b7f1-90801e667af0', 'default', 'logo15', 'logo15.png', 'image/png', 's3', 's3', 3488, '[]', '{\"thumbnail\": true}', '[]', '[]', 75, '2021-10-10 14:04:00', '2021-10-10 14:04:00'), +(76, 'Marvel\\Database\\Models\\Attachment', 76, 'f22a67df-2a5f-46cc-92d8-c0c74892da63', 'default', 'h&m', 'h&m.png', 'image/png', 's3', 's3', 59308, '[]', '{\"thumbnail\": true}', '[]', '[]', 76, '2021-10-10 14:04:23', '2021-10-10 14:04:23'), +(77, 'Marvel\\Database\\Models\\Attachment', 77, '5ed77ecf-34a1-4727-996d-563ccb4fb250', 'default', 'logo16', 'logo16.png', 'image/png', 's3', 's3', 6871, '[]', '{\"thumbnail\": true}', '[]', '[]', 77, '2021-10-10 14:04:27', '2021-10-10 14:04:27'), +(78, 'Marvel\\Database\\Models\\Attachment', 78, '15530b5d-d84e-41e2-9e24-3eeaeaef728f', 'default', 'p-26-m', 'p-26-m.png', 'image/png', 's3', 's3', 22906, '[]', '{\"thumbnail\": true}', '[]', '[]', 78, '2021-10-10 15:19:50', '2021-10-10 15:19:50'), +(79, 'Marvel\\Database\\Models\\Attachment', 79, '869f67af-5ec4-44fe-a1e0-cab12b915f26', 'default', 'D-2', 'D-2.png', 'image/png', 's3', 's3', 151542, '[]', '{\"thumbnail\": true}', '[]', '[]', 79, '2021-10-10 18:43:39', '2021-10-10 18:43:39'), +(80, 'Marvel\\Database\\Models\\Attachment', 80, '12361c42-2478-4073-8347-8c1ab876bfba', 'default', 'G-1', 'G-1.png', 'image/png', 's3', 's3', 69567, '[]', '{\"thumbnail\": true}', '[]', '[]', 80, '2021-10-10 18:44:46', '2021-10-10 18:44:47'), +(81, 'Marvel\\Database\\Models\\Attachment', 81, '1ab8991e-e68d-4615-a806-c8f6fdac3707', 'default', 'G', 'G.png', 'image/png', 's3', 's3', 69567, '[]', '{\"thumbnail\": true}', '[]', '[]', 81, '2021-10-10 18:44:54', '2021-10-10 18:44:54'), +(82, 'Marvel\\Database\\Models\\Attachment', 82, 'de4b118a-1406-47eb-906d-ceaece7faa00', 'default', 'G-1', 'G-1.png', 'image/png', 's3', 's3', 69567, '[]', '{\"thumbnail\": true}', '[]', '[]', 82, '2021-10-10 18:44:54', '2021-10-10 18:44:54'), +(83, 'Marvel\\Database\\Models\\Attachment', 83, 'e0eeb04c-6704-41a8-989e-1debb35c0058', 'default', 'D', 'D.png', 'image/png', 's3', 's3', 189090, '[]', '{\"thumbnail\": true}', '[]', '[]', 83, '2021-10-10 18:45:30', '2021-10-10 18:45:31'), +(84, 'Marvel\\Database\\Models\\Attachment', 84, '7cc699f5-3fbb-43a0-a4bb-2951f942d1b9', 'default', 'D-1', 'D-1.png', 'image/png', 's3', 's3', 178508, '[]', '{\"thumbnail\": true}', '[]', '[]', 84, '2021-10-10 18:45:31', '2021-10-10 18:45:31'), +(85, 'Marvel\\Database\\Models\\Attachment', 85, '72c8b1ef-60d7-4750-9bb8-dec8e617c028', 'default', 'D', 'D.png', 'image/png', 's3', 's3', 189090, '[]', '{\"thumbnail\": true}', '[]', '[]', 85, '2021-10-10 18:49:03', '2021-10-10 18:49:03'), +(86, 'Marvel\\Database\\Models\\Attachment', 86, '9132d68e-df1c-438a-939d-56b01b26302e', 'default', 'D-1', 'D-1.png', 'image/png', 's3', 's3', 178508, '[]', '{\"thumbnail\": true}', '[]', '[]', 86, '2021-10-10 18:49:03', '2021-10-10 18:49:04'), +(87, 'Marvel\\Database\\Models\\Attachment', 87, '4f455d77-6e4d-4467-95ec-3656e50ea9ce', 'default', 'D-2', 'D-2.png', 'image/png', 's3', 's3', 151542, '[]', '{\"thumbnail\": true}', '[]', '[]', 87, '2021-10-10 18:49:24', '2021-10-10 18:49:24'), +(88, 'Marvel\\Database\\Models\\Attachment', 88, 'e2a9926a-2004-4da7-8af7-2223454b4293', 'default', 'D-3', 'D-3.png', 'image/png', 's3', 's3', 213392, '[]', '{\"thumbnail\": true}', '[]', '[]', 88, '2021-10-10 18:49:24', '2021-10-10 18:49:25'), +(89, 'Marvel\\Database\\Models\\Attachment', 89, 'd0ddad95-df13-41d1-91ca-16e8a1924dd6', 'default', 'D', 'D.png', 'image/png', 's3', 's3', 189090, '[]', '{\"thumbnail\": true}', '[]', '[]', 89, '2021-10-10 18:50:35', '2021-10-10 18:50:35'), +(90, 'Marvel\\Database\\Models\\Attachment', 90, '29504fee-00d3-41d1-b54c-a7896036cd3c', 'default', 'D-1', 'D-1.png', 'image/png', 's3', 's3', 178508, '[]', '{\"thumbnail\": true}', '[]', '[]', 90, '2021-10-10 18:50:35', '2021-10-10 18:50:35'), +(91, 'Marvel\\Database\\Models\\Attachment', 91, 'b2d40ecc-cac2-40e1-b3e7-e68746cf929f', 'default', 'D-2', 'D-2.png', 'image/png', 's3', 's3', 151542, '[]', '{\"thumbnail\": true}', '[]', '[]', 91, '2021-10-10 18:50:35', '2021-10-10 18:50:36'), +(92, 'Marvel\\Database\\Models\\Attachment', 92, 'd49a725a-67f0-405f-be1d-d00c6cb02245', 'default', 'D-3', 'D-3.png', 'image/png', 's3', 's3', 213392, '[]', '{\"thumbnail\": true}', '[]', '[]', 92, '2021-10-10 18:50:36', '2021-10-10 18:50:36'), +(93, 'Marvel\\Database\\Models\\Attachment', 93, 'ddad1e89-a521-4ff5-a610-318f1f740af1', 'default', 'D', 'D.png', 'image/png', 's3', 's3', 189090, '[]', '{\"thumbnail\": true}', '[]', '[]', 93, '2021-10-10 18:50:40', '2021-10-10 18:50:40'), +(94, 'Marvel\\Database\\Models\\Attachment', 94, 'df5343c2-2961-45f0-a9e6-ea7a36efcf9b', 'default', 'D-1', 'D-1.png', 'image/png', 's3', 's3', 178508, '[]', '{\"thumbnail\": true}', '[]', '[]', 94, '2021-10-10 18:50:40', '2021-10-10 18:50:40'), +(95, 'Marvel\\Database\\Models\\Attachment', 95, '41b6b53b-13c4-4877-a183-6452c3340832', 'default', 'D-2', 'D-2.png', 'image/png', 's3', 's3', 151542, '[]', '{\"thumbnail\": true}', '[]', '[]', 95, '2021-10-10 18:50:55', '2021-10-10 18:50:55'), +(96, 'Marvel\\Database\\Models\\Attachment', 96, 'c707c080-a830-4b4f-8279-c461cf1a2e9e', 'default', 'D-3', 'D-3.png', 'image/png', 's3', 's3', 213392, '[]', '{\"thumbnail\": true}', '[]', '[]', 96, '2021-10-10 18:50:55', '2021-10-10 18:50:56'), +(97, 'Marvel\\Database\\Models\\Attachment', 97, '3d40f25f-448e-42f1-80c5-fa7ebe8860f2', 'default', 'A-2', 'A-2.png', 'image/png', 's3', 's3', 117712, '[]', '{\"thumbnail\": true}', '[]', '[]', 97, '2021-10-10 18:52:02', '2021-10-10 18:52:02'), +(98, 'Marvel\\Database\\Models\\Attachment', 98, '33cd1b35-135a-4fde-9908-04adf8a6a2e9', 'default', 'A', 'A.png', 'image/png', 's3', 's3', 104357, '[]', '{\"thumbnail\": true}', '[]', '[]', 98, '2021-10-10 18:52:19', '2021-10-10 18:52:19'), +(99, 'Marvel\\Database\\Models\\Attachment', 99, '7714241c-afb4-45b8-8109-13b7435b42cf', 'default', 'A-1', 'A-1.png', 'image/png', 's3', 's3', 79807, '[]', '{\"thumbnail\": true}', '[]', '[]', 99, '2021-10-10 18:52:19', '2021-10-10 18:52:19'), +(100, 'Marvel\\Database\\Models\\Attachment', 100, 'c591c18c-c9ac-424b-b56e-fc81b4330b5a', 'default', 'A-2', 'A-2.png', 'image/png', 's3', 's3', 117712, '[]', '{\"thumbnail\": true}', '[]', '[]', 100, '2021-10-10 18:52:19', '2021-10-10 18:52:19'), +(101, 'Marvel\\Database\\Models\\Attachment', 101, '305c097d-5401-4409-aa8c-30d016e59b7f', 'default', 'A-3', 'A-3.png', 'image/png', 's3', 's3', 101611, '[]', '{\"thumbnail\": true}', '[]', '[]', 101, '2021-10-10 18:52:19', '2021-10-10 18:52:20'), +(102, 'Marvel\\Database\\Models\\Attachment', 102, '3d4466e0-b7ad-4ea1-a212-0b029f9da079', 'default', 'A', 'A.png', 'image/png', 's3', 's3', 104357, '[]', '{\"thumbnail\": true}', '[]', '[]', 102, '2021-10-10 18:52:23', '2021-10-10 18:52:24'), +(103, 'Marvel\\Database\\Models\\Attachment', 103, '6ef6d5d9-ce19-4301-aa4c-825c69cbe22b', 'default', 'A-1', 'A-1.png', 'image/png', 's3', 's3', 79807, '[]', '{\"thumbnail\": true}', '[]', '[]', 103, '2021-10-10 18:52:24', '2021-10-10 18:52:24'), +(104, 'Marvel\\Database\\Models\\Attachment', 104, '4c4e98bd-cc6d-4c02-951f-72bacfb4c25a', 'default', 'A-2', 'A-2.png', 'image/png', 's3', 's3', 117712, '[]', '{\"thumbnail\": true}', '[]', '[]', 104, '2021-10-10 18:52:24', '2021-10-10 18:52:24'), +(105, 'Marvel\\Database\\Models\\Attachment', 105, '93c7eabe-f0bd-490c-8ffc-30c8318463b1', 'default', 'A-3', 'A-3.png', 'image/png', 's3', 's3', 101611, '[]', '{\"thumbnail\": true}', '[]', '[]', 105, '2021-10-10 18:52:24', '2021-10-10 18:52:24'), +(106, 'Marvel\\Database\\Models\\Attachment', 106, 'd0709ed8-dd87-4d25-8bba-ee74080288ab', 'default', 'A-3', 'A-3.png', 'image/png', 's3', 's3', 101611, '[]', '{\"thumbnail\": true}', '[]', '[]', 106, '2021-10-10 18:53:31', '2021-10-10 18:53:31'), +(107, 'Marvel\\Database\\Models\\Attachment', 107, '49f4a7bb-2b39-4312-bc05-1ef4ab166999', 'default', 'H-1', 'H-1.png', 'image/png', 's3', 's3', 38786, '[]', '{\"thumbnail\": true}', '[]', '[]', 107, '2021-10-10 18:58:44', '2021-10-10 18:58:44'), +(108, 'Marvel\\Database\\Models\\Attachment', 108, '87327523-cb78-40c2-90ad-a61b36794fc2', 'default', 'H', 'H.png', 'image/png', 's3', 's3', 39402, '[]', '{\"thumbnail\": true}', '[]', '[]', 108, '2021-10-10 18:59:50', '2021-10-10 18:59:51'), +(109, 'Marvel\\Database\\Models\\Attachment', 109, '961053d3-6064-40c4-9017-ef91edbd8edf', 'default', 'H-1', 'H-1.png', 'image/png', 's3', 's3', 38786, '[]', '{\"thumbnail\": true}', '[]', '[]', 109, '2021-10-10 18:59:54', '2021-10-10 18:59:54'), +(110, 'Marvel\\Database\\Models\\Attachment', 110, '8c275923-8513-41bc-b833-cbb3886da543', 'default', 'B', 'B.png', 'image/png', 's3', 's3', 118665, '[]', '{\"thumbnail\": true}', '[]', '[]', 110, '2021-10-10 19:29:51', '2021-10-10 19:29:51'), +(111, 'Marvel\\Database\\Models\\Attachment', 111, '71bf4347-c3a1-4457-8246-bcbca0b9e67e', 'default', 'B', 'B.png', 'image/png', 's3', 's3', 118665, '[]', '{\"thumbnail\": true}', '[]', '[]', 111, '2021-10-10 19:30:04', '2021-10-10 19:30:04'), +(112, 'Marvel\\Database\\Models\\Attachment', 112, 'e626ee4e-4da5-4891-aba1-5ca67b26eef8', 'default', 'B-1', 'B-1.png', 'image/png', 's3', 's3', 153430, '[]', '{\"thumbnail\": true}', '[]', '[]', 112, '2021-10-10 19:30:04', '2021-10-10 19:30:05'), +(113, 'Marvel\\Database\\Models\\Attachment', 113, '5c2ccddc-7d06-4b7a-9ecd-8f5db0546dff', 'default', 'B-2', 'B-2.png', 'image/png', 's3', 's3', 121711, '[]', '{\"thumbnail\": true}', '[]', '[]', 113, '2021-10-10 19:30:05', '2021-10-10 19:30:05'), +(114, 'Marvel\\Database\\Models\\Attachment', 114, '9ef40531-fd4a-486d-b08a-174efd0f5d0c', 'default', 'B-3', 'B-3.png', 'image/png', 's3', 's3', 120153, '[]', '{\"thumbnail\": true}', '[]', '[]', 114, '2021-10-10 19:30:05', '2021-10-10 19:30:06'), +(115, 'Marvel\\Database\\Models\\Attachment', 115, '178dea41-d21f-4bcd-a399-269c46788521', 'default', 'B-3', 'B-3.png', 'image/png', 's3', 's3', 104577, '[]', '{\"thumbnail\": true}', '[]', '[]', 115, '2021-10-10 19:32:20', '2021-10-10 19:32:20'), +(116, 'Marvel\\Database\\Models\\Attachment', 116, '9d09bbec-1c37-49e5-bbac-2f09315293e4', 'default', 'B', 'B.png', 'image/png', 's3', 's3', 102702, '[]', '{\"thumbnail\": true}', '[]', '[]', 116, '2021-10-10 19:32:27', '2021-10-10 19:32:28'), +(117, 'Marvel\\Database\\Models\\Attachment', 117, '6d48343d-b764-4e56-9150-7b8731abf114', 'default', 'B-1', 'B-1.png', 'image/png', 's3', 's3', 85301, '[]', '{\"thumbnail\": true}', '[]', '[]', 117, '2021-10-10 19:32:28', '2021-10-10 19:32:28'), +(118, 'Marvel\\Database\\Models\\Attachment', 118, '6f0f9953-eb54-4160-9be2-713276524ce0', 'default', 'B-2', 'B-2.png', 'image/png', 's3', 's3', 103081, '[]', '{\"thumbnail\": true}', '[]', '[]', 118, '2021-10-10 19:32:28', '2021-10-10 19:32:28'), +(119, 'Marvel\\Database\\Models\\Attachment', 119, '41895638-01b3-440e-bc4a-307d61718c48', 'default', 'B-3', 'B-3.png', 'image/png', 's3', 's3', 104577, '[]', '{\"thumbnail\": true}', '[]', '[]', 119, '2021-10-10 19:32:28', '2021-10-10 19:32:28'), +(120, 'Marvel\\Database\\Models\\Attachment', 120, '531ae2a8-71dc-45a6-bacd-92b4c4656909', 'default', 'A', 'A.png', 'image/png', 's3', 's3', 166034, '[]', '{\"thumbnail\": true}', '[]', '[]', 120, '2021-10-10 19:36:45', '2021-10-10 19:36:45'), +(121, 'Marvel\\Database\\Models\\Attachment', 121, '73548aa6-1bf1-4848-a745-52eb8618f2ba', 'default', 'A', 'A.png', 'image/png', 's3', 's3', 166034, '[]', '{\"thumbnail\": true}', '[]', '[]', 121, '2021-10-10 19:37:15', '2021-10-10 19:37:15'), +(122, 'Marvel\\Database\\Models\\Attachment', 122, 'c12ec298-9abc-465d-b144-628e04fe0b23', 'default', 'A-1', 'A-1.png', 'image/png', 's3', 's3', 146188, '[]', '{\"thumbnail\": true}', '[]', '[]', 122, '2021-10-10 19:37:15', '2021-10-10 19:37:15'), +(123, 'Marvel\\Database\\Models\\Attachment', 123, 'e27b2f37-cf1b-48b7-b517-327b4eb2030f', 'default', 'A-2', 'A-2.png', 'image/png', 's3', 's3', 164163, '[]', '{\"thumbnail\": true}', '[]', '[]', 123, '2021-10-10 19:37:15', '2021-10-10 19:37:15'), +(124, 'Marvel\\Database\\Models\\Attachment', 124, 'ff804049-5467-4508-b25b-a2ee278f1251', 'default', 'A-3', 'A-3.png', 'image/png', 's3', 's3', 120151, '[]', '{\"thumbnail\": true}', '[]', '[]', 124, '2021-10-10 19:37:15', '2021-10-10 19:37:16'), +(125, 'Marvel\\Database\\Models\\Attachment', 125, '9ccc7380-9927-4300-8b6a-64e997105c7d', 'default', 'E- 1', 'E--1.png', 'image/png', 's3', 's3', 162494, '[]', '{\"thumbnail\": true}', '[]', '[]', 125, '2021-10-10 19:42:43', '2021-10-10 19:42:44'), +(126, 'Marvel\\Database\\Models\\Attachment', 126, 'c93c8aac-dbac-4fdd-b48c-c6f9911165e2', 'default', 'E- 1', 'E--1.png', 'image/png', 's3', 's3', 162494, '[]', '{\"thumbnail\": true}', '[]', '[]', 126, '2021-10-10 19:43:08', '2021-10-10 19:43:08'), +(127, 'Marvel\\Database\\Models\\Attachment', 127, '9d6388a9-1f31-491f-a79e-aea755a2a56e', 'default', 'E- 2', 'E--2.png', 'image/png', 's3', 's3', 205349, '[]', '{\"thumbnail\": true}', '[]', '[]', 127, '2021-10-10 19:43:08', '2021-10-10 19:43:09'), +(128, 'Marvel\\Database\\Models\\Attachment', 128, 'af9b9bce-b389-4516-9eb8-8cbb61ccf368', 'default', 'E- 3', 'E--3.png', 'image/png', 's3', 's3', 177260, '[]', '{\"thumbnail\": true}', '[]', '[]', 128, '2021-10-10 19:43:09', '2021-10-10 19:43:09'), +(129, 'Marvel\\Database\\Models\\Attachment', 129, '6b0327a0-19ec-44cc-adb3-06161cca79b2', 'default', 'E-4', 'E-4.png', 'image/png', 's3', 's3', 160022, '[]', '{\"thumbnail\": true}', '[]', '[]', 129, '2021-10-10 19:43:09', '2021-10-10 19:43:09'), +(130, 'Marvel\\Database\\Models\\Attachment', 130, '57b6f2a1-6607-4f4b-8237-30d970f68065', 'default', 'D - 2', 'D---2.png', 'image/png', 's3', 's3', 91374, '[]', '{\"thumbnail\": true}', '[]', '[]', 130, '2021-10-10 19:46:05', '2021-10-10 19:46:05'), +(131, 'Marvel\\Database\\Models\\Attachment', 131, 'a5d72d6d-4896-4370-a4cf-57327b14f218', 'default', 'D - 2', 'D---2.png', 'image/png', 's3', 's3', 91374, '[]', '{\"thumbnail\": true}', '[]', '[]', 131, '2021-10-10 19:46:15', '2021-10-10 19:46:15'), +(132, 'Marvel\\Database\\Models\\Attachment', 132, 'c97f534d-937c-4d27-a291-23e7a19add4e', 'default', 'D- 1', 'D--1.png', 'image/png', 's3', 's3', 91533, '[]', '{\"thumbnail\": true}', '[]', '[]', 132, '2021-10-10 19:46:15', '2021-10-10 19:46:15'), +(133, 'Marvel\\Database\\Models\\Attachment', 133, 'dd7de49d-ba2f-491c-84ef-e2f9cb213240', 'default', '2', '2.png', 'image/png', 's3', 's3', 26330, '[]', '{\"thumbnail\": true}', '[]', '[]', 133, '2021-10-10 19:48:37', '2021-10-10 19:48:37'), +(134, 'Marvel\\Database\\Models\\Attachment', 134, 'f23db25b-362e-44e5-baa6-7e9462f4f5c1', 'default', '2', '2.png', 'image/png', 's3', 's3', 26330, '[]', '{\"thumbnail\": true}', '[]', '[]', 134, '2021-10-10 19:48:42', '2021-10-10 19:48:42'), +(135, 'Marvel\\Database\\Models\\Attachment', 135, 'e842d324-768b-45b9-97d7-021bce197862', 'default', 'D', 'D.png', 'image/png', 's3', 's3', 22877, '[]', '{\"thumbnail\": true}', '[]', '[]', 135, '2021-10-10 19:50:52', '2021-10-10 19:50:52'), +(136, 'Marvel\\Database\\Models\\Attachment', 136, '17df9eff-02ef-49bf-b182-e98a9be4a2e8', 'default', 'D-1', 'D-1.png', 'image/png', 's3', 's3', 22694, '[]', '{\"thumbnail\": true}', '[]', '[]', 136, '2021-10-10 19:50:57', '2021-10-10 19:50:57'), +(137, 'Marvel\\Database\\Models\\Attachment', 137, '21d8fa83-6ba0-4168-af73-267c6b91b692', 'default', 'H-3', 'H-3.png', 'image/png', 's3', 's3', 86616, '[]', '{\"thumbnail\": true}', '[]', '[]', 137, '2021-10-10 21:48:59', '2021-10-10 21:48:59'), +(138, 'Marvel\\Database\\Models\\Attachment', 138, '0b0a88bb-2b4e-4cbe-8ba4-d8ecebf10d66', 'default', 'H', 'H.png', 'image/png', 's3', 's3', 86653, '[]', '{\"thumbnail\": true}', '[]', '[]', 138, '2021-10-10 21:49:10', '2021-10-10 21:49:11'), +(139, 'Marvel\\Database\\Models\\Attachment', 139, 'c22bb20b-099b-4078-9702-ecac84e1a1c6', 'default', 'H-1', 'H-1.png', 'image/png', 's3', 's3', 261785, '[]', '{\"thumbnail\": true}', '[]', '[]', 139, '2021-10-10 21:49:11', '2021-10-10 21:49:11'), +(140, 'Marvel\\Database\\Models\\Attachment', 140, 'ec1cec37-4b6b-4795-aaf5-972eb130e1f7', 'default', 'H-2', 'H-2.png', 'image/png', 's3', 's3', 165843, '[]', '{\"thumbnail\": true}', '[]', '[]', 140, '2021-10-10 21:49:11', '2021-10-10 21:49:11'), +(141, 'Marvel\\Database\\Models\\Attachment', 141, '7d75d1ec-d3e3-4b5c-bbd1-1718d267f001', 'default', 'H-3', 'H-3.png', 'image/png', 's3', 's3', 86616, '[]', '{\"thumbnail\": true}', '[]', '[]', 141, '2021-10-10 21:49:11', '2021-10-10 21:49:11'), +(142, 'Marvel\\Database\\Models\\Attachment', 142, 'c75200bf-ccf9-48b5-96cf-2edd72e24464', 'default', 'F', 'F.png', 'image/png', 's3', 's3', 66899, '[]', '{\"thumbnail\": true}', '[]', '[]', 142, '2021-10-11 13:13:35', '2021-10-11 13:13:35'), +(143, 'Marvel\\Database\\Models\\Attachment', 143, 'e17c0651-5709-42b6-b13f-17bdb1dc4b9a', 'default', 'F', 'F.png', 'image/png', 's3', 's3', 66899, '[]', '{\"thumbnail\": true}', '[]', '[]', 143, '2021-10-11 13:13:41', '2021-10-11 13:13:42'), +(144, 'Marvel\\Database\\Models\\Attachment', 144, '78ba177f-cd7f-4aae-825b-6de90de1d008', 'default', 'F-1', 'F-1.png', 'image/png', 's3', 's3', 67451, '[]', '{\"thumbnail\": true}', '[]', '[]', 144, '2021-10-11 13:13:42', '2021-10-11 13:13:42'), +(145, 'Marvel\\Database\\Models\\Attachment', 145, '52fe371c-2624-4a9d-adf7-1e01a41ee08e', 'default', 'E', 'E.png', 'image/png', 's3', 's3', 56941, '[]', '{\"thumbnail\": true}', '[]', '[]', 145, '2021-10-11 13:14:38', '2021-10-11 13:14:38'), +(146, 'Marvel\\Database\\Models\\Attachment', 146, '5917448d-544d-45b2-8739-6d06a35c2316', 'default', 'E', 'E.png', 'image/png', 's3', 's3', 56941, '[]', '{\"thumbnail\": true}', '[]', '[]', 146, '2021-10-11 13:14:44', '2021-10-11 13:14:45'), +(147, 'Marvel\\Database\\Models\\Attachment', 147, '0b1713cf-03be-4312-bc58-22779147ec26', 'default', 'E-1', 'E-1.png', 'image/png', 's3', 's3', 57301, '[]', '{\"thumbnail\": true}', '[]', '[]', 147, '2021-10-11 13:14:45', '2021-10-11 13:14:45'), +(148, 'Marvel\\Database\\Models\\Attachment', 148, '19fa3bda-2d92-4600-87e1-5d710833bed9', 'default', 'women5-1', 'women5-1.jpg', 'image/jpeg', 's3', 's3', 286630, '[]', '{\"thumbnail\": true}', '[]', '[]', 148, '2021-10-11 13:19:40', '2021-10-11 13:19:41'), +(149, 'Marvel\\Database\\Models\\Attachment', 149, 'cb7936a9-8aff-4bd0-be0f-ddca24952b14', 'default', 'women5-1', 'women5-1.jpg', 'image/jpeg', 's3', 's3', 286630, '[]', '{\"thumbnail\": true}', '[]', '[]', 149, '2021-10-11 13:19:55', '2021-10-11 13:19:56'), +(150, 'Marvel\\Database\\Models\\Attachment', 150, '69775278-bbf9-422b-bcd0-54ad15ec1b4e', 'default', 'women-14-1', 'women-14-1.jpg', 'image/jpeg', 's3', 's3', 286205, '[]', '{\"thumbnail\": true}', '[]', '[]', 150, '2021-10-11 13:19:56', '2021-10-11 13:19:56'), +(151, 'Marvel\\Database\\Models\\Attachment', 151, '011e560e-3d30-4335-8157-224da47efc2e', 'default', 'women-17-1', 'women-17-1.jpg', 'image/jpeg', 's3', 's3', 353669, '[]', '{\"thumbnail\": true}', '[]', '[]', 151, '2021-10-11 13:19:56', '2021-10-11 13:19:56'), +(152, 'Marvel\\Database\\Models\\Attachment', 152, 'c89619af-156a-446c-b08f-8436194ee3fd', 'default', 'women-18-1', 'women-18-1.jpg', 'image/jpeg', 's3', 's3', 237944, '[]', '{\"thumbnail\": true}', '[]', '[]', 152, '2021-10-11 13:19:56', '2021-10-11 13:19:56'), +(153, 'Marvel\\Database\\Models\\Attachment', 153, 'a9d67ba1-1e1e-497b-a04c-34fad7cb80a0', 'default', 'G', 'G.png', 'image/png', 's3', 's3', 162972, '[]', '{\"thumbnail\": true}', '[]', '[]', 153, '2021-10-11 13:54:44', '2021-10-11 13:54:45'), +(154, 'Marvel\\Database\\Models\\Attachment', 154, 'b311cd6b-115b-419c-9719-154784ed6329', 'default', 'G', 'G.png', 'image/png', 's3', 's3', 162972, '[]', '{\"thumbnail\": true}', '[]', '[]', 154, '2021-10-11 13:55:02', '2021-10-11 13:55:03'), +(155, 'Marvel\\Database\\Models\\Attachment', 155, '7c9efd28-91dc-456d-a613-8520f3a68c90', 'default', 'G-1', 'G-1.png', 'image/png', 's3', 's3', 215929, '[]', '{\"thumbnail\": true}', '[]', '[]', 155, '2021-10-11 13:55:03', '2021-10-11 13:55:03'), +(156, 'Marvel\\Database\\Models\\Attachment', 156, '521a542a-c06d-4daf-9db1-0bba5aaa6f34', 'default', 'G-2', 'G-2.png', 'image/png', 's3', 's3', 149888, '[]', '{\"thumbnail\": true}', '[]', '[]', 156, '2021-10-11 13:55:03', '2021-10-11 13:55:04'), +(157, 'Marvel\\Database\\Models\\Attachment', 157, 'c06354a2-25c8-4a0a-9b1c-e12f38a8e6e3', 'default', 'G-3', 'G-3.png', 'image/png', 's3', 's3', 203054, '[]', '{\"thumbnail\": true}', '[]', '[]', 157, '2021-10-11 13:55:04', '2021-10-11 13:55:04'), +(158, 'Marvel\\Database\\Models\\Attachment', 158, '9a142676-3c72-415f-96b8-1f67077fa807', 'default', 'Chawkbazar13', 'Chawkbazar13.png', 'image/png', 's3', 's3', 156222, '[]', '{\"thumbnail\": true}', '[]', '[]', 158, '2021-10-11 14:29:34', '2021-10-11 14:29:34'), +(159, 'Marvel\\Database\\Models\\Attachment', 159, 'ef324965-fbb0-49c9-a8fb-a3ae4bc6c8c9', 'default', 'Chawkbazar13', 'Chawkbazar13.png', 'image/png', 's3', 's3', 156222, '[]', '{\"thumbnail\": true}', '[]', '[]', 159, '2021-10-11 14:29:43', '2021-10-11 14:29:43'), +(160, 'Marvel\\Database\\Models\\Attachment', 160, '66d13efa-4692-435c-b9b7-3ae859db21b7', 'default', 'Chawkbazar14', 'Chawkbazar14.png', 'image/png', 's3', 's3', 174715, '[]', '{\"thumbnail\": true}', '[]', '[]', 160, '2021-10-11 14:29:43', '2021-10-11 14:29:43'), +(161, 'Marvel\\Database\\Models\\Attachment', 161, '766f65a9-fdc4-46ce-97d1-8c5daccce4af', 'default', 'Chawkbazar15', 'Chawkbazar15.png', 'image/png', 's3', 's3', 128366, '[]', '{\"thumbnail\": true}', '[]', '[]', 161, '2021-10-11 14:29:43', '2021-10-11 14:29:43'), +(162, 'Marvel\\Database\\Models\\Attachment', 162, '2012ce91-db37-4e01-b5a6-b687e0bbfa41', 'default', 'Chawkbazar16', 'Chawkbazar16.png', 'image/png', 's3', 's3', 142476, '[]', '{\"thumbnail\": true}', '[]', '[]', 162, '2021-10-11 14:29:43', '2021-10-11 14:29:44'), +(163, 'Marvel\\Database\\Models\\Attachment', 163, '07a52749-10e3-4f53-8f9e-fd0d9aa25f52', 'default', 'Watches-7', 'Watches-7.png', 'image/png', 's3', 's3', 41385, '[]', '{\"thumbnail\": true}', '[]', '[]', 163, '2021-10-11 14:32:08', '2021-10-11 14:32:08'), +(164, 'Marvel\\Database\\Models\\Attachment', 164, 'cfc7612f-faf0-41a3-84c1-34f97a612d2b', 'default', 'Watches-15', 'Watches-15.jpg', 'image/jpeg', 's3', 's3', 86243, '[]', '{\"thumbnail\": true}', '[]', '[]', 164, '2021-10-11 14:33:03', '2021-10-11 14:33:03'), +(165, 'Marvel\\Database\\Models\\Attachment', 165, '9314f01e-a225-4ed4-9697-1eba941d6875', 'default', 'Watches-10', 'Watches-10.jpg', 'image/jpeg', 's3', 's3', 87177, '[]', '{\"thumbnail\": true}', '[]', '[]', 165, '2021-10-11 14:36:34', '2021-10-11 14:36:34'), +(166, 'Marvel\\Database\\Models\\Attachment', 166, 'e8eb3a32-b126-4922-84ff-2990f1f16cae', 'default', 'Watches-1-1', 'Watches-1-1.jpg', 'image/jpeg', 's3', 's3', 87131, '[]', '{\"thumbnail\": true}', '[]', '[]', 166, '2021-10-11 14:36:39', '2021-10-11 14:36:39'), +(167, 'Marvel\\Database\\Models\\Attachment', 167, '0f052264-eabd-46b8-a1ff-530bb791f3a6', 'default', 'Women', 'Women.png', 'image/png', 's3', 's3', 174228, '[]', '{\"thumbnail\": true}', '[]', '[]', 167, '2021-10-11 14:38:13', '2021-10-11 14:38:14'), +(168, 'Marvel\\Database\\Models\\Attachment', 168, '7ad792af-cb18-4b99-8ff6-fa51459eb10c', 'default', 'Women-1', 'Women-1.png', 'image/png', 's3', 's3', 145531, '[]', '{\"thumbnail\": true}', '[]', '[]', 168, '2021-10-11 14:38:21', '2021-10-11 14:38:21'), +(169, 'Marvel\\Database\\Models\\Attachment', 169, 'b555c201-9fa5-401f-9a9b-feb1d21be4ee', 'default', 'Women-2', 'Women-2.png', 'image/png', 's3', 's3', 179435, '[]', '{\"thumbnail\": true}', '[]', '[]', 169, '2021-10-11 14:38:21', '2021-10-11 14:38:21'), +(170, 'Marvel\\Database\\Models\\Attachment', 170, '2a7729cc-5670-4061-8f7a-fef2140d67ab', 'default', 'Women-3', 'Women-3.png', 'image/png', 's3', 's3', 251358, '[]', '{\"thumbnail\": true}', '[]', '[]', 170, '2021-10-11 14:38:21', '2021-10-11 14:38:21'), +(171, 'Marvel\\Database\\Models\\Attachment', 171, 'ecb0f276-9e60-4bc4-95fd-73bf2068ed62', 'default', 'F-2', 'F-2.png', 'image/png', 's3', 's3', 159627, '[]', '{\"thumbnail\": true}', '[]', '[]', 171, '2021-10-11 14:40:03', '2021-10-11 14:40:04'), +(172, 'Marvel\\Database\\Models\\Attachment', 172, '9caff4b7-6680-4af3-b812-928ae7df54c7', 'default', 'F-3', 'F-3.png', 'image/png', 's3', 's3', 153376, '[]', '{\"thumbnail\": true}', '[]', '[]', 172, '2021-10-11 14:40:14', '2021-10-11 14:40:14'), +(173, 'Marvel\\Database\\Models\\Attachment', 173, '50109951-4dff-4a3c-80f4-2cdb47be573f', 'default', 'C', 'C.png', 'image/png', 's3', 's3', 105937, '[]', '{\"thumbnail\": true}', '[]', '[]', 173, '2021-10-11 14:41:33', '2021-10-11 14:41:33'), +(174, 'Marvel\\Database\\Models\\Attachment', 174, 'bd04a93e-a55b-4aea-aab1-d8d1456e4559', 'default', 'C-1', 'C-1.png', 'image/png', 's3', 's3', 116660, '[]', '{\"thumbnail\": true}', '[]', '[]', 174, '2021-10-11 14:42:02', '2021-10-11 14:42:03'), +(175, 'Marvel\\Database\\Models\\Attachment', 175, '44bd357f-a062-43fb-8600-b5841eaf2cce', 'default', 'C-2', 'C-2.png', 'image/png', 's3', 's3', 105490, '[]', '{\"thumbnail\": true}', '[]', '[]', 175, '2021-10-11 14:42:03', '2021-10-11 14:42:03'), +(176, 'Marvel\\Database\\Models\\Attachment', 176, '1ab95324-3b0f-4a81-8f66-56afcdc3d47e', 'default', 'C-3', 'C-3.png', 'image/png', 's3', 's3', 118729, '[]', '{\"thumbnail\": true}', '[]', '[]', 176, '2021-10-11 14:42:04', '2021-10-11 14:42:04'), +(177, 'Marvel\\Database\\Models\\Attachment', 177, 'b57d2efc-c994-412e-841c-503b7d8b2e2d', 'default', 'j', 'j.png', 'image/png', 's3', 's3', 89179, '[]', '{\"thumbnail\": true}', '[]', '[]', 177, '2021-10-11 14:42:51', '2021-10-11 14:42:51'), +(178, 'Marvel\\Database\\Models\\Attachment', 178, '38f2f007-d773-48f8-a371-479d4272f091', 'default', 'j-1', 'j-1.png', 'image/png', 's3', 's3', 88244, '[]', '{\"thumbnail\": true}', '[]', '[]', 178, '2021-10-11 14:42:54', '2021-10-11 14:42:54'), +(179, 'Marvel\\Database\\Models\\Attachment', 179, 'f0031f01-8b5e-45bc-9b8b-befb9014b05c', 'default', 'Backpack-4', 'Backpack-4.jpg', 'image/jpeg', 's3', 's3', 93976, '[]', '{\"thumbnail\": true}', '[]', '[]', 179, '2021-10-23 13:01:43', '2021-10-23 13:01:43'), +(180, 'Marvel\\Database\\Models\\Attachment', 180, 'e4f8b2c0-d951-4612-b04b-5dfbb504d192', 'default', 'Footwear-1-1', 'Footwear-1-1.jpg', 'image/jpeg', 's3', 's3', 85171, '[]', '{\"thumbnail\": true}', '[]', '[]', 180, '2021-10-23 13:09:07', '2021-10-23 13:09:08'), +(181, 'Marvel\\Database\\Models\\Attachment', 181, '256fb2ee-bb38-4448-baa6-d9bcb11ce003', 'default', 'Backpack-8', 'Backpack-8.jpg', 'image/jpeg', 's3', 's3', 151949, '[]', '{\"thumbnail\": true}', '[]', '[]', 181, '2021-10-23 13:45:54', '2021-10-23 13:45:54'), +(182, 'Marvel\\Database\\Models\\Attachment', 182, '9f8f223f-ff96-4f53-a2f3-6791b473e27b', 'default', 'Footwear-3-1', 'Footwear-3-1.jpg', 'image/jpeg', 's3', 's3', 90207, '[]', '{\"thumbnail\": true}', '[]', '[]', 182, '2021-10-23 13:48:31', '2021-10-23 13:48:32'), +(183, 'Marvel\\Database\\Models\\Attachment', 183, 'e3e61ab1-beeb-4864-88d8-0761110cfe70', 'default', 'Footwear-2-1', 'Footwear-2-1.jpg', 'image/jpeg', 's3', 's3', 90615, '[]', '{\"thumbnail\": true}', '[]', '[]', 183, '2021-10-23 13:48:49', '2021-10-23 13:48:49'), +(184, 'Marvel\\Database\\Models\\Attachment', 184, '1104a69d-cf6a-49b5-871e-5ca4fadca236', 'default', 'Sunglasess-12-1', 'Sunglasess-12-1.jpg', 'image/jpeg', 's3', 's3', 59210, '[]', '{\"thumbnail\": true}', '[]', '[]', 184, '2021-10-23 16:17:44', '2021-10-23 16:17:45'), +(185, 'Marvel\\Database\\Models\\Attachment', 185, '90ab13fb-c1e8-469b-8e55-240739462a8e', 'default', 'Sunglasess-13-1', 'Sunglasess-13-1.jpg', 'image/jpeg', 's3', 's3', 59066, '[]', '{\"thumbnail\": true}', '[]', '[]', 185, '2021-10-23 16:17:53', '2021-10-23 16:17:53'), +(186, 'Marvel\\Database\\Models\\Attachment', 186, '8f8ffe5c-9f6c-4075-9e65-f5dc861719e0', 'default', 'kids-11', 'kids-11.jpg', 'image/jpeg', 's3', 's3', 153687, '[]', '{\"thumbnail\": true}', '[]', '[]', 186, '2021-10-23 19:54:10', '2021-10-23 19:54:10'), +(187, 'Marvel\\Database\\Models\\Attachment', 187, 'c175bbf0-70e1-48d3-8d81-af1d578e783e', 'default', 'kids-25', 'kids-25.jpg', 'image/jpeg', 's3', 's3', 153697, '[]', '{\"thumbnail\": true}', '[]', '[]', 187, '2021-10-23 19:54:14', '2021-10-23 19:54:14'), +(188, 'Marvel\\Database\\Models\\Attachment', 188, '4ab097c0-ae5a-463f-8dea-c8eef04e8b42', 'default', 'Backpack-1', 'Backpack-1.jpg', 'image/jpeg', 's3', 's3', 148089, '[]', '{\"thumbnail\": true}', '[]', '[]', 188, '2021-10-23 20:12:44', '2021-10-23 20:12:44'), +(189, 'Marvel\\Database\\Models\\Attachment', 189, '3555ca4c-404c-4c01-ad15-28a8d3ae8b63', 'default', 'Footwear-4-1', 'Footwear-4-1.jpg', 'image/jpeg', 's3', 's3', 98624, '[]', '{\"thumbnail\": true}', '[]', '[]', 189, '2021-10-23 20:16:20', '2021-10-23 20:16:20'), +(190, 'Marvel\\Database\\Models\\Attachment', 190, '8631100b-06c4-4f73-9a77-50bc55899449', 'default', 'Footwear-5', 'Footwear-5.jpg', 'image/jpeg', 's3', 's3', 98618, '[]', '{\"thumbnail\": true}', '[]', '[]', 190, '2021-10-23 20:16:24', '2021-10-23 20:16:24'), +(191, 'Marvel\\Database\\Models\\Attachment', 191, '9bbac096-8ed4-4c74-9a4a-76ebfd942209', 'default', 'Backpack-5', 'Backpack-5.jpg', 'image/jpeg', 's3', 's3', 129164, '[]', '{\"thumbnail\": true}', '[]', '[]', 191, '2021-10-23 20:20:26', '2021-10-23 20:20:26'), +(192, 'Marvel\\Database\\Models\\Attachment', 192, '3bae879c-b735-42ff-a058-af2bd241f547', 'default', 'women9-1', 'women9-1.jpg', 'image/jpeg', 's3', 's3', 233916, '[]', '{\"thumbnail\": true}', '[]', '[]', 192, '2021-10-23 20:30:08', '2021-10-23 20:30:08'), +(193, 'Marvel\\Database\\Models\\Attachment', 193, '031a6b82-8829-474f-9140-2f6bb6f48ba5', 'default', 'women-22-1', 'women-22-1.jpg', 'image/jpeg', 's3', 's3', 234207, '[]', '{\"thumbnail\": true}', '[]', '[]', 193, '2021-10-23 20:30:11', '2021-10-23 20:30:12'), +(194, 'Marvel\\Database\\Models\\Attachment', 194, 'eebbb509-8bee-4134-b11d-7a0fc4f07a0b', 'default', 'women10@2x-1', 'women10@2x-1.jpg', 'image/jpeg', 's3', 's3', 440922, '[]', '{\"thumbnail\": true}', '[]', '[]', 194, '2021-10-23 21:09:12', '2021-10-23 21:09:12'), +(195, 'Marvel\\Database\\Models\\Attachment', 195, '55c7fe01-88c4-4e7e-af8a-dc604c2909ff', 'default', 'women-13-1', 'women-13-1.jpg', 'image/jpeg', 's3', 's3', 133361, '[]', '{\"thumbnail\": true}', '[]', '[]', 195, '2021-10-23 21:09:16', '2021-10-23 21:09:16'), +(196, 'Marvel\\Database\\Models\\Attachment', 196, '63cc9398-0709-409b-b5d8-b03cd4a0493f', 'default', 'kids-4', 'kids-4.jpg', 'image/jpeg', 's3', 's3', 176721, '[]', '{\"thumbnail\": true}', '[]', '[]', 196, '2021-10-23 21:11:48', '2021-10-23 21:11:48'), +(197, 'Marvel\\Database\\Models\\Attachment', 197, '267b5b3c-2ef7-4478-9e06-751c24a9a2bf', 'default', 'kids-5', 'kids-5.jpg', 'image/jpeg', 's3', 's3', 176416, '[]', '{\"thumbnail\": true}', '[]', '[]', 197, '2021-10-23 21:11:52', '2021-10-23 21:11:52'), +(198, 'Marvel\\Database\\Models\\Attachment', 198, 'd5bc0067-4f6b-4fbb-832e-fabe0d09ee54', 'default', 'Grid-14', 'Grid-14.png', 'image/png', 's3', 's3', 375894, '[]', '{\"thumbnail\": true}', '[]', '[]', 198, '2021-10-23 21:16:05', '2021-10-23 21:16:05'), +(199, 'Marvel\\Database\\Models\\Attachment', 199, '8b0cec88-2220-43bd-a9f6-5081687b2acc', 'default', 'Chawkbazar26', 'Chawkbazar26.png', 'image/png', 's3', 's3', 115114, '[]', '{\"thumbnail\": true}', '[]', '[]', 199, '2021-10-23 21:16:12', '2021-10-23 21:16:13'), +(200, 'Marvel\\Database\\Models\\Attachment', 200, 'f904de66-7d60-4626-991d-6f71b8d05ae5', 'default', 'Watches-16', 'Watches-16.jpg', 'image/jpeg', 's3', 's3', 72716, '[]', '{\"thumbnail\": true}', '[]', '[]', 200, '2021-10-23 21:18:22', '2021-10-23 21:18:22'), +(201, 'Marvel\\Database\\Models\\Attachment', 201, '80aa872c-5f79-43f7-a9a0-d3ed16f8bb6c', 'default', 'Watches-16', 'Watches-16.jpg', 'image/jpeg', 's3', 's3', 72716, '[]', '{\"thumbnail\": true}', '[]', '[]', 201, '2021-10-23 21:18:25', '2021-10-23 21:18:25'), +(202, 'Marvel\\Database\\Models\\Attachment', 202, 'bee26d39-8b1e-4eaf-b674-969c76ff6d07', 'default', 'kids-17', 'kids-17.jpg', 'image/jpeg', 's3', 's3', 142513, '[]', '{\"thumbnail\": true}', '[]', '[]', 202, '2021-10-23 21:20:07', '2021-10-23 21:20:07'), +(203, 'Marvel\\Database\\Models\\Attachment', 203, 'b92b00d6-04f8-473c-bfa9-d993f315c11b', 'default', 'kids-23', 'kids-23.jpg', 'image/jpeg', 's3', 's3', 142426, '[]', '{\"thumbnail\": true}', '[]', '[]', 203, '2021-10-23 21:20:11', '2021-10-23 21:20:11'), +(204, 'Marvel\\Database\\Models\\Attachment', 204, '6f405f94-db87-45d8-ab79-324f209b9006', 'default', 'Sunglasess-15-1', 'Sunglasess-15-1.jpg', 'image/jpeg', 's3', 's3', 49004, '[]', '{\"thumbnail\": true}', '[]', '[]', 204, '2021-10-23 21:22:08', '2021-10-23 21:22:08'), +(205, 'Marvel\\Database\\Models\\Attachment', 205, '85ec3a83-d8ce-4fec-a2c5-ebdc99380145', 'default', 'Sunglasess-5-1', 'Sunglasess-5-1.jpg', 'image/jpeg', 's3', 's3', 48174, '[]', '{\"thumbnail\": true}', '[]', '[]', 205, '2021-10-23 21:23:58', '2021-10-23 21:23:58'), +(206, 'Marvel\\Database\\Models\\Attachment', 206, '96197b45-d274-4c1e-abb7-2727a6a01493', 'default', 'Sunglasess-6', 'Sunglasess-6.jpg', 'image/jpeg', 's3', 's3', 48089, '[]', '{\"thumbnail\": true}', '[]', '[]', 206, '2021-10-23 21:24:02', '2021-10-23 21:24:03'), +(207, 'Marvel\\Database\\Models\\Attachment', 207, '650fc476-8595-4c22-998f-6a0fcf40b3b2', 'default', 'Chawkbazar13', 'Chawkbazar13.png', 'image/png', 's3', 's3', 156222, '[]', '{\"thumbnail\": true}', '[]', '[]', 207, '2021-10-23 21:27:11', '2021-10-23 21:27:11'), +(208, 'Marvel\\Database\\Models\\Attachment', 208, '905d702c-c700-4d4a-a0c0-9941964463d5', 'default', 'Chawkbazar14', 'Chawkbazar14.png', 'image/png', 's3', 's3', 174715, '[]', '{\"thumbnail\": true}', '[]', '[]', 208, '2021-10-23 21:27:14', '2021-10-23 21:27:14'), +(209, 'Marvel\\Database\\Models\\Attachment', 209, '8d1dacea-8dbd-42bf-9860-d43b1512bcbd', 'default', 'Footwear-17', 'Footwear-17.jpg', 'image/jpeg', 's3', 's3', 104214, '[]', '{\"thumbnail\": true}', '[]', '[]', 209, '2021-10-23 21:32:22', '2021-10-23 21:32:22'), +(210, 'Marvel\\Database\\Models\\Attachment', 210, '8560d880-a5e2-40c5-b315-7999cb352c5c', 'default', 'mens-9', 'mens-9.jpg', 'image/jpeg', 's3', 's3', 123759, '[]', '{\"thumbnail\": true}', '[]', '[]', 210, '2021-10-23 21:35:05', '2021-10-23 21:35:05'), +(211, 'Marvel\\Database\\Models\\Attachment', 211, '26af81dc-e940-49dd-a70b-4b57a667bb98', 'default', 'mens-13', 'mens-13.jpg', 'image/jpeg', 's3', 's3', 92148, '[]', '{\"thumbnail\": true}', '[]', '[]', 211, '2021-10-23 21:35:11', '2021-10-23 21:35:11'), +(212, 'Marvel\\Database\\Models\\Attachment', 212, '56d2457b-870c-4eec-8bd4-a6b5ee685838', 'default', 'Backpack-6', 'Backpack-6.jpg', 'image/jpeg', 's3', 's3', 170325, '[]', '{\"thumbnail\": true}', '[]', '[]', 212, '2021-10-23 21:38:52', '2021-10-23 21:38:53'), +(213, 'Marvel\\Database\\Models\\Attachment', 213, '02d63f7e-c487-4129-9293-3c1e6da85dc7', 'default', 'Chawkbazar17', 'Chawkbazar17.png', 'image/png', 's3', 's3', 195028, '[]', '{\"thumbnail\": true}', '[]', '[]', 213, '2021-10-23 21:41:38', '2021-10-23 21:41:38'), +(214, 'Marvel\\Database\\Models\\Attachment', 214, '0f571034-0326-48fe-ba3d-7953b4a642c1', 'default', 'Chawkbazar20', 'Chawkbazar20.png', 'image/png', 's3', 's3', 199843, '[]', '{\"thumbnail\": true}', '[]', '[]', 214, '2021-10-23 21:41:42', '2021-10-23 21:41:42'), +(215, 'Marvel\\Database\\Models\\Attachment', 215, '2379907f-2f2d-4e98-8cb2-a8e5255373b0', 'default', 'Footwear-9', 'Footwear-9.jpg', 'image/jpeg', 's3', 's3', 87066, '[]', '{\"thumbnail\": true}', '[]', '[]', 215, '2021-10-23 21:45:53', '2021-10-23 21:45:54'), +(216, 'Marvel\\Database\\Models\\Attachment', 216, 'f03c9383-37e9-4864-9597-762bc9219b54', 'default', 'Footwear-8', 'Footwear-8.jpg', 'image/jpeg', 's3', 's3', 87079, '[]', '{\"thumbnail\": true}', '[]', '[]', 216, '2021-10-23 21:45:58', '2021-10-23 21:45:58'), +(217, 'Marvel\\Database\\Models\\Attachment', 217, 'f4a65632-52a1-408f-be2d-ba7ad4bdff41', 'default', 'mens-2', 'mens-2.jpg', 'image/jpeg', 's3', 's3', 214505, '[]', '{\"thumbnail\": true}', '[]', '[]', 217, '2021-10-23 21:50:34', '2021-10-23 21:50:34'), +(218, 'Marvel\\Database\\Models\\Attachment', 218, '45cc2e4e-1f02-48fd-ab89-96cb2c9f2a1f', 'default', 'mens-7', 'mens-7.jpg', 'image/jpeg', 's3', 's3', 224468, '[]', '{\"thumbnail\": true}', '[]', '[]', 218, '2021-10-23 21:50:38', '2021-10-23 21:50:38'), +(219, 'Marvel\\Database\\Models\\Attachment', 219, '5c667594-c8a3-450d-a69c-71940147c9f7', 'default', 'Watches-6-1', 'Watches-6-1.jpg', 'image/jpeg', 's3', 's3', 101135, '[]', '{\"thumbnail\": true}', '[]', '[]', 219, '2021-10-23 21:54:47', '2021-10-23 21:54:47'), +(220, 'Marvel\\Database\\Models\\Attachment', 220, '39fe9d49-eded-4904-81d7-f95275d167ab', 'default', 'Watches-7-1', 'Watches-7-1.jpg', 'image/jpeg', 's3', 's3', 101172, '[]', '{\"thumbnail\": true}', '[]', '[]', 220, '2021-10-23 21:54:51', '2021-10-23 21:54:51'), +(221, 'Marvel\\Database\\Models\\Attachment', 221, '625e670b-bcca-4284-aaf8-ea0e85595eae', 'default', 'Footwear-18', 'Footwear-18.jpg', 'image/jpeg', 's3', 's3', 108507, '[]', '{\"thumbnail\": true}', '[]', '[]', 221, '2021-10-23 21:57:11', '2021-10-23 21:57:11'), +(222, 'Marvel\\Database\\Models\\Attachment', 222, 'cae70b88-4091-4748-a1d5-1df5d970b22b', 'default', 'Footwear-19', 'Footwear-19.jpg', 'image/jpeg', 's3', 's3', 108403, '[]', '{\"thumbnail\": true}', '[]', '[]', 222, '2021-10-23 21:57:14', '2021-10-23 21:57:14'), +(223, 'Marvel\\Database\\Models\\Attachment', 223, 'd1752da1-516b-46be-bd93-87cad20336ca', 'default', 'Casual-Wear-4-1', 'Casual-Wear-4-1.jpg', 'image/jpeg', 's3', 's3', 271254, '[]', '{\"thumbnail\": true}', '[]', '[]', 223, '2021-10-23 22:00:46', '2021-10-23 22:00:46'), +(224, 'Marvel\\Database\\Models\\Attachment', 224, '4241eda7-ebab-4b44-bc78-d41566f58eab', 'default', 'Casual-Wear-5-1', 'Casual-Wear-5-1.jpg', 'image/jpeg', 's3', 's3', 341697, '[]', '{\"thumbnail\": true}', '[]', '[]', 224, '2021-10-23 22:01:09', '2021-10-23 22:01:09'), +(225, 'Marvel\\Database\\Models\\Attachment', 225, '59d7e2ee-9a26-4736-8fce-9f305eddfc77', 'default', 'Backpack-7', 'Backpack-7.jpg', 'image/jpeg', 's3', 's3', 130531, '[]', '{\"thumbnail\": true}', '[]', '[]', 225, '2021-10-23 22:04:37', '2021-10-23 22:04:38'), +(226, 'Marvel\\Database\\Models\\Attachment', 226, '913d5e66-9852-496c-ab77-2d823bbb9836', 'default', 'Sunglasess-2-1', 'Sunglasess-2-1.jpg', 'image/jpeg', 's3', 's3', 56380, '[]', '{\"thumbnail\": true}', '[]', '[]', 226, '2021-10-23 22:08:09', '2021-10-23 22:08:09'), +(227, 'Marvel\\Database\\Models\\Attachment', 227, '3a713933-2306-4e9c-b47e-a0b0a383879f', 'default', 'Sunglasess-3-1', 'Sunglasess-3-1.jpg', 'image/jpeg', 's3', 's3', 56209, '[]', '{\"thumbnail\": true}', '[]', '[]', 227, '2021-10-23 22:08:14', '2021-10-23 22:08:14'), +(228, 'Marvel\\Database\\Models\\Attachment', 228, '3eabba42-43ce-4186-9b74-ebde3eba607c', 'default', 'Chawkbazar22', 'Chawkbazar22.png', 'image/png', 's3', 's3', 172407, '[]', '{\"thumbnail\": true}', '[]', '[]', 228, '2021-10-23 22:10:37', '2021-10-23 22:10:37'), +(229, 'Marvel\\Database\\Models\\Attachment', 229, 'ed2e2d6e-ab71-475b-987b-17948d0ae377', 'default', 'Chawkbazar21', 'Chawkbazar21.png', 'image/png', 's3', 's3', 173733, '[]', '{\"thumbnail\": true}', '[]', '[]', 229, '2021-10-23 22:10:41', '2021-10-23 22:10:41'), +(230, 'Marvel\\Database\\Models\\Attachment', 230, '2c39c6de-0e1a-4910-971a-79dfe4dd160d', 'default', 'Watches-4-1', 'Watches-4-1.jpg', 'image/jpeg', 's3', 's3', 80464, '[]', '{\"thumbnail\": true}', '[]', '[]', 230, '2021-10-23 22:13:34', '2021-10-23 22:13:34'), +(231, 'Marvel\\Database\\Models\\Attachment', 231, '958234f7-5736-4f1e-b2ed-1c61421218f4', 'default', 'Watches-4-1', 'Watches-4-1.jpg', 'image/jpeg', 's3', 's3', 80464, '[]', '{\"thumbnail\": true}', '[]', '[]', 231, '2021-10-23 22:13:38', '2021-10-23 22:13:38'), +(232, 'Marvel\\Database\\Models\\Attachment', 232, '7fe19180-4201-4148-b9e3-3f88ed98dde7', 'default', 'Casual-Wear-1-1', 'Casual-Wear-1-1.jpg', 'image/jpeg', 's3', 's3', 210409, '[]', '{\"thumbnail\": true}', '[]', '[]', 232, '2021-10-23 22:16:37', '2021-10-23 22:16:37'), +(233, 'Marvel\\Database\\Models\\Attachment', 233, 'e45ba2aa-45df-417e-b6f9-b6affd19b965', 'default', 'Casual-Wear-8', 'Casual-Wear-8.jpg', 'image/jpeg', 's3', 's3', 210426, '[]', '{\"thumbnail\": true}', '[]', '[]', 233, '2021-10-23 22:16:41', '2021-10-23 22:16:41'), +(234, 'Marvel\\Database\\Models\\Attachment', 234, '6c13e390-e2c5-41c1-a5f9-196d0b07a913', 'default', 'Chawkbazar1', 'Chawkbazar1.png', 'image/png', 's3', 's3', 157232, '[]', '{\"thumbnail\": true}', '[]', '[]', 234, '2021-10-23 22:19:04', '2021-10-23 22:19:04'), +(235, 'Marvel\\Database\\Models\\Attachment', 235, '073d41a9-b117-4f82-964a-a7d0cc05afa1', 'default', 'Chawkbazar2', 'Chawkbazar2.png', 'image/png', 's3', 's3', 172083, '[]', '{\"thumbnail\": true}', '[]', '[]', 235, '2021-10-23 22:19:08', '2021-10-23 22:19:08'), +(236, 'Marvel\\Database\\Models\\Attachment', 236, 'c008c075-f963-4e62-8c69-0f8645d32ada', 'default', 'kids-1', 'kids-1.jpg', 'image/jpeg', 's3', 's3', 240482, '[]', '{\"thumbnail\": true}', '[]', '[]', 236, '2021-10-23 22:21:07', '2021-10-23 22:21:07'), +(237, 'Marvel\\Database\\Models\\Attachment', 237, '459da7af-da15-4dd4-8911-ec56b742ee8e', 'default', 'kids-3', 'kids-3.jpg', 'image/jpeg', 's3', 's3', 193979, '[]', '{\"thumbnail\": true}', '[]', '[]', 237, '2021-10-23 22:21:10', '2021-10-23 22:21:11'), +(238, 'Marvel\\Database\\Models\\Attachment', 238, 'ed43f42d-bb32-4509-88c6-232b17751f67', 'default', 'blaze-fashion', 'blaze-fashion.png', 'image/png', 's3', 's3', 4396, '[]', '{\"thumbnail\": true}', '[]', '[]', 238, '2021-10-25 07:17:45', '2021-10-25 07:17:46'), +(239, 'Marvel\\Database\\Models\\Attachment', 239, '058428fd-16c0-42f4-9f1b-75930d1db83d', 'default', 'club-shoes', 'club-shoes.png', 'image/png', 's3', 's3', 4099, '[]', '{\"thumbnail\": true}', '[]', '[]', 239, '2021-10-25 07:19:30', '2021-10-25 07:19:31'), +(240, 'Marvel\\Database\\Models\\Attachment', 240, 'dcf5e5db-0d24-4de8-911f-a614c9ee5b4d', 'default', 'elegance', 'elegance.png', 'image/png', 's3', 's3', 4140, '[]', '{\"thumbnail\": true}', '[]', '[]', 240, '2021-10-25 07:19:44', '2021-10-25 07:19:44'), +(241, 'Marvel\\Database\\Models\\Attachment', 241, '5ae65d7a-db2a-4690-9542-f1d2a4b784dd', 'default', 'fashadil', 'fashadil.png', 'image/png', 's3', 's3', 4920, '[]', '{\"thumbnail\": true}', '[]', '[]', 241, '2021-10-25 07:20:12', '2021-10-25 07:20:12'), +(242, 'Marvel\\Database\\Models\\Attachment', 242, '28df1088-e666-4689-8f8c-2d5648635e86', 'default', 'fusion', 'fusion.png', 'image/png', 's3', 's3', 3722, '[]', '{\"thumbnail\": true}', '[]', '[]', 242, '2021-10-25 07:20:21', '2021-10-25 07:20:21'), +(243, 'Marvel\\Database\\Models\\Attachment', 243, 'edcf670d-65e7-4d32-8283-8d17eb237b97', 'default', 'hoppister', 'hoppister.png', 'image/png', 's3', 's3', 3895, '[]', '{\"thumbnail\": true}', '[]', '[]', 243, '2021-10-25 07:20:46', '2021-10-25 07:20:46'), +(244, 'Marvel\\Database\\Models\\Attachment', 244, '84a50245-9896-4e04-8443-94e484d69795', 'default', 'hunter-shoes', 'hunter-shoes.png', 'image/png', 's3', 's3', 4868, '[]', '{\"thumbnail\": true}', '[]', '[]', 244, '2021-10-25 07:20:54', '2021-10-25 07:20:55'), +(245, 'Marvel\\Database\\Models\\Attachment', 245, '1b141d53-295a-4a25-97b6-84ca75c70c15', 'default', 'shovia', 'shovia.png', 'image/png', 's3', 's3', 3814, '[]', '{\"thumbnail\": true}', '[]', '[]', 245, '2021-10-25 07:21:03', '2021-10-25 07:21:04'), +(246, 'Marvel\\Database\\Models\\Attachment', 246, 'bc18606f-8d78-4142-aa88-45cb02553114', 'default', '2x2x-thumbnail', '2x2x-thumbnail.jpg', 'image/jpeg', 's3', 's3', 7616, '[]', '{\"thumbnail\": true}', '[]', '[]', 246, '2021-10-25 07:35:16', '2021-10-25 07:35:16'), +(247, 'Marvel\\Database\\Models\\Attachment', 247, '8dedabb0-d891-480e-9c30-d204f48c14da', 'default', '4x2x-thumbnail', '4x2x-thumbnail.jpg', 'image/jpeg', 's3', 's3', 8640, '[]', '{\"thumbnail\": true}', '[]', '[]', 247, '2021-10-25 07:37:12', '2021-10-25 07:37:12'), +(248, 'Marvel\\Database\\Models\\Attachment', 248, '3a585487-ae1d-423a-88f0-85fac0f0dfd0', 'default', '5x2x-thumbnail', '5x2x-thumbnail.jpg', 'image/jpeg', 's3', 's3', 7550, '[]', '{\"thumbnail\": true}', '[]', '[]', 248, '2021-10-25 07:39:11', '2021-10-25 07:39:11'), +(249, 'Marvel\\Database\\Models\\Attachment', 249, 'd3b8a812-3be5-4eba-a469-ac4831f4aff4', 'default', '6x2x-thumbnail', '6x2x-thumbnail.jpg', 'image/jpeg', 's3', 's3', 8827, '[]', '{\"thumbnail\": true}', '[]', '[]', 249, '2021-10-25 07:39:48', '2021-10-25 07:39:48'), +(250, 'Marvel\\Database\\Models\\Attachment', 250, 'c876f3d3-9be9-47a7-91f8-e7820d9131a5', 'default', '8x2x-thumbnail', '8x2x-thumbnail.jpg', 'image/jpeg', 's3', 's3', 8050, '[]', '{\"thumbnail\": true}', '[]', '[]', 250, '2021-10-25 12:35:01', '2021-10-25 12:35:01'), +(251, 'Marvel\\Database\\Models\\Attachment', 251, 'fa1d9f4c-d25a-47ed-978c-a8d32155f446', 'default', '10x2x-thumbnail', '10x2x-thumbnail.jpg', 'image/jpeg', 's3', 's3', 8452, '[]', '{\"thumbnail\": true}', '[]', '[]', 251, '2021-10-25 12:36:20', '2021-10-25 12:36:20'), +(252, 'Marvel\\Database\\Models\\Attachment', 252, 'e51f205d-8f6d-4d45-b042-7f78efbad12c', 'default', '12x2x-thumbnail', '12x2x-thumbnail.jpg', 'image/jpeg', 's3', 's3', 8981, '[]', '{\"thumbnail\": true}', '[]', '[]', 252, '2021-10-25 12:37:22', '2021-10-25 12:37:22'), +(253, 'Marvel\\Database\\Models\\Attachment', 253, '9e6bfdca-15da-4add-9ef0-4968b7017be1', 'default', '15x2x-thumbnail', '15x2x-thumbnail.jpg', 'image/jpeg', 's3', 's3', 7708, '[]', '{\"thumbnail\": true}', '[]', '[]', 253, '2021-10-25 12:37:43', '2021-10-25 12:37:44'), +(254, 'Marvel\\Database\\Models\\Attachment', 254, '551437d3-6df7-48e8-a6d6-543e21fdd4bc', 'default', '18x2x-thumbnail', '18x2x-thumbnail.jpg', 'image/jpeg', 's3', 's3', 8445, '[]', '{\"thumbnail\": true}', '[]', '[]', 254, '2021-10-25 12:39:01', '2021-10-25 12:39:01'), +(255, 'Marvel\\Database\\Models\\Attachment', 255, 'cbafa86f-6653-4498-ac93-9351214e3332', 'default', '20x2x-thumbnail', '20x2x-thumbnail.jpg', 'image/jpeg', 's3', 's3', 9076, '[]', '{\"thumbnail\": true}', '[]', '[]', 255, '2021-10-25 12:39:38', '2021-10-25 12:39:38'), +(256, 'Marvel\\Database\\Models\\Attachment', 256, '52afee64-6b2e-4e66-b09c-264bd92b3042', 'default', 'logo final2x', 'logo-final2x.png', 'image/png', 's3', 's3', 5922, '[]', '{\"thumbnail\": true}', '[]', '[]', 256, '2021-10-27 09:13:12', '2021-10-27 09:13:13'), +(257, 'Marvel\\Database\\Models\\Attachment', 257, '5f59488f-5ea3-49fe-94f0-c338c842f129', 'default', 'logo final', 'logo-final.png', 'image/png', 's3', 's3', 2799, '[]', '{\"thumbnail\": true}', '[]', '[]', 257, '2021-10-27 09:13:26', '2021-10-27 09:13:26'), +(258, 'Marvel\\Database\\Models\\Attachment', 258, '9cae36a3-799b-4d11-97c3-837ff4bb6091', 'default', 'logo final2x', 'logo-final2x.png', 'image/png', 's3', 's3', 5922, '[]', '{\"thumbnail\": true}', '[]', '[]', 258, '2021-10-27 09:13:39', '2021-10-27 09:13:39'), +(259, 'Marvel\\Database\\Models\\Attachment', 259, 'e930a646-bb3e-460a-866e-5973a3e0e5c3', 'default', 'Group 36179', 'Group-36179.png', 'image/png', 's3', 's3', 10469, '[]', '{\"thumbnail\": true}', '[]', '[]', 259, '2021-10-27 09:50:39', '2021-10-27 09:50:39'), +(260, 'Marvel\\Database\\Models\\Attachment', 260, '0af2dccd-c566-479c-bc68-ef49625523b1', 'default', 'Group 36179', 'Group-36179.png', 'image/png', 's3', 's3', 10469, '[]', '{\"thumbnail\": true}', '[]', '[]', 260, '2021-10-27 09:51:22', '2021-10-27 09:51:22'), +(261, 'Marvel\\Database\\Models\\Attachment', 261, '4d914f86-e3a2-45e1-b578-8f6062756237', 'default', 'Group 36180', 'Group-36180.png', 'image/png', 's3', 's3', 8576, '[]', '{\"thumbnail\": true}', '[]', '[]', 261, '2021-10-27 09:51:59', '2021-10-27 09:51:59'), +(262, 'Marvel\\Database\\Models\\Attachment', 262, '35bb9b60-b79a-4e69-b514-ba72e233eb12', 'default', 'Group 36181', 'Group-36181.png', 'image/png', 's3', 's3', 10841, '[]', '{\"thumbnail\": true}', '[]', '[]', 262, '2021-10-27 09:52:25', '2021-10-27 09:52:26'), +(263, 'Marvel\\Database\\Models\\Attachment', 263, '578fe0db-e435-4b28-82b0-7108cf8642e0', 'default', 'Group 36186', 'Group-36186.png', 'image/png', 's3', 's3', 12336, '[]', '{\"thumbnail\": true}', '[]', '[]', 263, '2021-10-27 09:52:45', '2021-10-27 09:52:45'), +(264, 'Marvel\\Database\\Models\\Attachment', 264, '078c45dd-b5fd-48d0-96b3-3b8a1a47827d', 'default', 'Group 36185', 'Group-36185.png', 'image/png', 's3', 's3', 8009, '[]', '{\"thumbnail\": true}', '[]', '[]', 264, '2021-10-27 09:53:00', '2021-10-27 09:53:00'), +(265, 'Marvel\\Database\\Models\\Attachment', 265, '16c98a5b-f832-492a-a4c2-24a441d0af99', 'default', 'Group 36184', 'Group-36184.png', 'image/png', 's3', 's3', 8723, '[]', '{\"thumbnail\": true}', '[]', '[]', 265, '2021-10-27 09:53:21', '2021-10-27 09:53:21'), +(266, 'Marvel\\Database\\Models\\Attachment', 266, '49ec8d93-e0b5-492f-9e8a-26f28cc77262', 'default', 'Group 36183', 'Group-36183.png', 'image/png', 's3', 's3', 8144, '[]', '{\"thumbnail\": true}', '[]', '[]', 266, '2021-10-27 09:53:39', '2021-10-27 09:53:39'), +(267, 'Marvel\\Database\\Models\\Attachment', 267, '4ab83941-23e0-4e05-846f-5d94c274f6a4', 'default', 'Group 36182', 'Group-36182.png', 'image/png', 's3', 's3', 7958, '[]', '{\"thumbnail\": true}', '[]', '[]', 267, '2021-10-27 09:53:52', '2021-10-27 09:53:52'), +(268, 'Marvel\\Database\\Models\\Attachment', 268, 'f2b48f76-b767-4ec3-86de-587f7ce4490f', 'default', 'Group 36179', 'Group-36179.png', 'image/png', 's3', 's3', 10469, '[]', '{\"thumbnail\": true}', '[]', '[]', 268, '2021-11-08 06:57:52', '2021-11-08 06:57:53'), +(269, 'Marvel\\Database\\Models\\Attachment', 269, '5902275f-091d-47c4-9c6a-8f9ee4cf71de', 'default', 'h&m', 'h&m.png', 'image/png', 's3', 's3', 59308, '[]', '{\"thumbnail\": true}', '[]', '[]', 269, '2021-11-08 07:06:04', '2021-11-08 07:06:04'), +(270, 'Marvel\\Database\\Models\\Attachment', 270, '3bf0f7a2-00f9-4ede-a0dc-d3f59b0344b5', 'default', 'Group 36181', 'Group-36181.png', 'image/png', 's3', 's3', 10841, '[]', '{\"thumbnail\": true}', '[]', '[]', 270, '2021-11-08 07:06:17', '2021-11-08 07:06:17'), +(271, 'Marvel\\Database\\Models\\Attachment', 271, '3fc77740-dc8f-458d-894c-ee18a789fe80', 'default', 'logo16', 'logo16.png', 'image/png', 's3', 's3', 6871, '[]', '{\"thumbnail\": true}', '[]', '[]', 271, '2021-11-08 07:08:47', '2021-11-08 07:08:47'), +(272, 'Marvel\\Database\\Models\\Attachment', 272, '80405012-e2fe-4c6e-a64d-21e255fab974', 'default', 'club-shoes', 'club-shoes.png', 'image/png', 's3', 's3', 4099, '[]', '{\"thumbnail\": true}', '[]', '[]', 272, '2021-11-08 07:09:47', '2021-11-08 07:09:48'), +(273, 'Marvel\\Database\\Models\\Attachment', 273, 'd1120cfc-af4d-49c9-bd6e-5945b00eb7a3', 'default', 'elegance', 'elegance.png', 'image/png', 's3', 's3', 4140, '[]', '{\"thumbnail\": true}', '[]', '[]', 273, '2021-11-08 07:10:19', '2021-11-08 07:10:19'), +(274, 'Marvel\\Database\\Models\\Attachment', 274, '054c424e-1294-45fb-b30f-cfcf0b439228', 'default', 'fashadil', 'fashadil.png', 'image/png', 's3', 's3', 4920, '[]', '{\"thumbnail\": true}', '[]', '[]', 274, '2021-11-08 07:13:54', '2021-11-08 07:13:54'), +(275, 'Marvel\\Database\\Models\\Attachment', 275, '1c3b5d78-cb34-497b-bf65-444701099bdd', 'default', 'fusion', 'fusion.png', 'image/png', 's3', 's3', 3722, '[]', '{\"thumbnail\": true}', '[]', '[]', 275, '2021-11-08 07:22:39', '2021-11-08 07:22:39'), +(276, 'Marvel\\Database\\Models\\Attachment', 276, '577c51f3-c9c4-43aa-a87f-7101e104e94f', 'default', 'hoppister', 'hoppister.png', 'image/png', 's3', 's3', 3895, '[]', '{\"thumbnail\": true}', '[]', '[]', 276, '2021-11-08 07:23:07', '2021-11-08 07:23:07'), +(277, 'Marvel\\Database\\Models\\Attachment', 277, '5895c3af-3ed2-4388-a5c9-c7a6ec594cfc', 'default', 'shovia', 'shovia.png', 'image/png', 's3', 's3', 3814, '[]', '{\"thumbnail\": true}', '[]', '[]', 277, '2021-11-08 07:31:07', '2021-11-08 07:31:07'), +(278, 'Marvel\\Database\\Models\\Attachment', 278, 'cb62d655-8773-4c25-a328-4df39e0990d5', 'default', 'hoppister', 'hoppister.png', 'image/png', 's3', 's3', 3895, '[]', '{\"thumbnail\": true}', '[]', '[]', 278, '2021-11-08 07:31:22', '2021-11-08 07:31:22'), +(279, 'Marvel\\Database\\Models\\Attachment', 279, 'f97af277-1e2f-46ef-8ae8-95006b9585ad', 'default', 'vintege', 'vintege.png', 'image/png', 's3', 's3', 4600, '[]', '{\"thumbnail\": true}', '[]', '[]', 279, '2021-11-08 07:32:20', '2021-11-08 07:32:20'), +(280, 'Marvel\\Database\\Models\\Attachment', 280, '5c121826-93de-42f0-822c-3f111f66041c', 'default', 'elegance', 'elegance.png', 'image/png', 's3', 's3', 4140, '[]', '{\"thumbnail\": true}', '[]', '[]', 280, '2021-11-08 07:33:04', '2021-11-08 07:33:04'), +(281, 'Marvel\\Database\\Models\\Attachment', 281, 'b10ea837-6211-4f5d-8d66-f63b5d34606d', 'default', 'shovia', 'shovia.png', 'image/png', 's3', 's3', 3814, '[]', '{\"thumbnail\": true}', '[]', '[]', 281, '2021-11-08 07:33:10', '2021-11-08 07:33:10'), +(282, 'Marvel\\Database\\Models\\Attachment', 282, '9788d3ab-fa28-477f-9533-4436eb8be002', 'default', 'Group 36179', 'Group-36179.png', 'image/png', 's3', 's3', 10469, '[]', '{\"thumbnail\": true}', '[]', '[]', 282, '2021-11-08 07:33:38', '2021-11-08 07:33:38'), +(283, 'Marvel\\Database\\Models\\Attachment', 283, '8a0f738c-0227-40cc-8f60-32d388c5723b', 'default', 'Group 36180', 'Group-36180.png', 'image/png', 's3', 's3', 8576, '[]', '{\"thumbnail\": true}', '[]', '[]', 283, '2021-11-08 07:34:26', '2021-11-08 07:34:27'), +(284, 'Marvel\\Database\\Models\\Attachment', 284, '81f157de-7b12-4e5f-8504-ef05ef951b02', 'default', 'Group 36184', 'Group-36184.png', 'image/png', 's3', 's3', 8723, '[]', '{\"thumbnail\": true}', '[]', '[]', 284, '2021-11-08 07:35:08', '2021-11-08 07:35:08'), +(285, 'Marvel\\Database\\Models\\Attachment', 285, '44020116-1071-4476-bf65-04c48025294a', 'default', 'Group 36183', 'Group-36183.png', 'image/png', 's3', 's3', 8144, '[]', '{\"thumbnail\": true}', '[]', '[]', 285, '2021-11-08 07:35:40', '2021-11-08 07:35:40'), +(286, 'Marvel\\Database\\Models\\Attachment', 286, 'acd0d18e-3207-40eb-927c-7c5a7fc41abc', 'default', 'Group 36186', 'Group-36186.png', 'image/png', 's3', 's3', 12336, '[]', '{\"thumbnail\": true}', '[]', '[]', 286, '2021-11-08 07:36:06', '2021-11-08 07:36:06'), +(287, 'Marvel\\Database\\Models\\Attachment', 287, '7f2fbb19-13c1-4c84-b808-91ab80a74d83', 'default', 'Group 36185', 'Group-36185.png', 'image/png', 's3', 's3', 8009, '[]', '{\"thumbnail\": true}', '[]', '[]', 287, '2021-11-08 07:36:39', '2021-11-08 07:36:39'), +(288, 'Marvel\\Database\\Models\\Attachment', 288, 'fa22cc43-c253-467b-b91d-719c5b6e2305', 'default', 'Group 36182', 'Group-36182.png', 'image/png', 's3', 's3', 7958, '[]', '{\"thumbnail\": true}', '[]', '[]', 288, '2021-11-08 07:37:03', '2021-11-08 07:37:04'), +(289, 'Marvel\\Database\\Models\\Attachment', 289, 'f5fc0c6a-4c76-427a-bf00-d85acbfbc96d', 'default', 'Group 36181', 'Group-36181.png', 'image/png', 's3', 's3', 10841, '[]', '{\"thumbnail\": true}', '[]', '[]', 289, '2021-11-08 07:37:20', '2021-11-08 07:37:20'), +(290, 'Marvel\\Database\\Models\\Attachment', 290, 'aa4ded0c-3ce0-4e04-a8b9-3c0d134c38fd', 'default', 'blaze-fashion', 'blaze-fashion.png', 'image/png', 's3', 's3', 4396, '[]', '{\"thumbnail\": true}', '[]', '[]', 290, '2021-11-08 07:38:18', '2021-11-08 07:38:18'), +(291, 'Marvel\\Database\\Models\\Attachment', 291, '39e2b374-59ac-4685-9e4e-df815af59030', 'default', 'hunter-shoes', 'hunter-shoes.png', 'image/png', 's3', 's3', 4868, '[]', '{\"thumbnail\": true}', '[]', '[]', 291, '2021-11-08 07:38:41', '2021-11-08 07:38:41'), +(292, 'Marvel\\Database\\Models\\Attachment', 292, '6c571e48-7b98-442f-8794-5c1cba555d7d', 'default', '10', '10.png', 'image/png', 's3', 's3', 85139, '[]', '{\"thumbnail\": true}', '[]', '[]', 292, '2021-11-08 10:01:31', '2021-11-08 10:01:32'), +(293, 'Marvel\\Database\\Models\\Attachment', 293, '7f17adfc-ada9-456b-846d-1c023809dbdd', 'default', '50png', '50png.png', 'image/png', 's3', 's3', 74640, '[]', '{\"thumbnail\": true}', '[]', '[]', 293, '2021-11-08 10:02:00', '2021-11-08 10:02:01'), +(294, 'Marvel\\Database\\Models\\Attachment', 294, '6f9601e8-e831-464f-8375-5cad58493160', 'default', '30 (1)', '30-(1).png', 'image/png', 's3', 's3', 78032, '[]', '{\"thumbnail\": true}', '[]', '[]', 294, '2021-11-08 10:03:23', '2021-11-08 10:03:23'), +(295, 'Marvel\\Database\\Models\\Attachment', 295, '9be534af-5241-4ea7-b74c-cd51447f200b', 'default', '400', '400.png', 'image/png', 's3', 's3', 40011, '[]', '{\"thumbnail\": true}', '[]', '[]', 295, '2021-11-08 10:03:53', '2021-11-08 10:03:53'), +(296, 'Marvel\\Database\\Models\\Attachment', 296, '0314e081-3d0a-4fea-afc7-d396977106de', 'default', '2 0(1)', '2-0(1).png', 'image/png', 's3', 's3', 83535, '[]', '{\"thumbnail\": true}', '[]', '[]', 296, '2021-11-08 10:04:44', '2021-11-08 10:04:44'), +(297, 'Marvel\\Database\\Models\\Attachment', 297, '91ea6d36-e5c4-4a8f-955b-d78c4bdf92da', 'default', 'store_owner', 'store_owner.png', 'image/png', 's3', 's3', 100825, '[]', '{\"thumbnail\": true}', '[]', '[]', 297, '2021-11-25 06:21:27', '2021-11-25 06:21:27'), +(298, 'Marvel\\Database\\Models\\Attachment', 298, 'b9caaed6-e9af-4576-8a27-c7f8d6860851', 'default', 'pro pic 3', 'pro-pic-3.jpg', 'image/jpeg', 's3', 's3', 53425, '[]', '{\"thumbnail\": true}', '[]', '[]', 298, '2021-11-27 17:16:54', '2021-11-27 17:16:54'), +(299, 'Marvel\\Database\\Models\\Attachment', 299, '8a4aa6da-0792-4cdb-9b0f-05c61859649c', 'default', 'Footwear-15', 'Footwear-15.jpg', 'image/jpeg', 's3', 's3', 101509, '[]', '{\"thumbnail\": true}', '[]', '[]', 299, '2021-11-27 17:53:40', '2021-11-27 17:53:40'), +(300, 'Marvel\\Database\\Models\\Attachment', 300, '2a8c0202-978d-44e6-ba01-d55528197446', 'default', 'Footwear-14', 'Footwear-14.jpg', 'image/jpeg', 's3', 's3', 101268, '[]', '{\"thumbnail\": true}', '[]', '[]', 300, '2021-11-27 17:53:48', '2021-11-27 17:53:48'), +(301, 'Marvel\\Database\\Models\\Attachment', 301, '99fea1d1-b6ba-42d3-a53a-96681ec94b7e', 'default', 'Chawkbazar7', 'Chawkbazar7.png', 'image/png', 's3', 's3', 168959, '[]', '{\"thumbnail\": true}', '[]', '[]', 301, '2021-11-28 12:58:08', '2021-11-28 12:58:08'), +(302, 'Marvel\\Database\\Models\\Attachment', 302, '7025ca15-5cde-446c-b13d-208588a2fc38', 'default', 'Chawkbazar6', 'Chawkbazar6.png', 'image/png', 's3', 's3', 147835, '[]', '{\"thumbnail\": true}', '[]', '[]', 302, '2021-11-28 12:58:21', '2021-11-28 12:58:21'), +(303, 'Marvel\\Database\\Models\\Attachment', 303, '76ed22a1-c6b7-4724-afa7-4cd608f1ff80', 'default', 'Chawkbazar8', 'Chawkbazar8.png', 'image/png', 's3', 's3', 143537, '[]', '{\"thumbnail\": true}', '[]', '[]', 303, '2021-11-28 12:58:21', '2021-11-28 12:58:21'), +(304, 'Marvel\\Database\\Models\\Attachment', 304, '96d8c79a-e380-4f96-8958-b7f1d5faf7f7', 'default', 'women', 'women.png', 'image/png', 's3', 's3', 211997, '[]', '{\"thumbnail\": true}', '[]', '[]', 304, '2022-01-10 17:47:49', '2022-01-10 17:47:49'), +(305, 'Marvel\\Database\\Models\\Attachment', 305, '2f826614-79c1-43ba-b02f-47868540f9df', 'default', 'watch', 'watch.png', 'image/png', 's3', 's3', 66512, '[]', '{\"thumbnail\": true}', '[]', '[]', 305, '2022-01-10 17:48:06', '2022-01-10 17:48:06'), +(306, 'Marvel\\Database\\Models\\Attachment', 306, '72a82265-823a-4104-80f4-4e518cf98c05', 'default', 'sunglass', 'sunglass.png', 'image/png', 's3', 's3', 51428, '[]', '{\"thumbnail\": true}', '[]', '[]', 306, '2022-01-10 17:48:25', '2022-01-10 17:48:25'), +(307, 'Marvel\\Database\\Models\\Attachment', 307, 'dec42b05-efb2-44b5-9881-03ee8b0c1f53', 'default', 'sports', 'sports.png', 'image/png', 's3', 's3', 94018, '[]', '{\"thumbnail\": true}', '[]', '[]', 307, '2022-01-10 17:48:39', '2022-01-10 17:48:39'), +(308, 'Marvel\\Database\\Models\\Attachment', 308, 'd7eb0210-4815-41d6-b54b-0d24cfa0a9c2', 'default', 'Sneakers', 'Sneakers.png', 'image/png', 's3', 's3', 107699, '[]', '{\"thumbnail\": true}', '[]', '[]', 308, '2022-01-10 17:48:49', '2022-01-10 17:48:49'), +(309, 'Marvel\\Database\\Models\\Attachment', 309, '3769565a-6079-434e-a324-8407c48d2a20', 'default', 'Men', 'Men.png', 'image/png', 's3', 's3', 97423, '[]', '{\"thumbnail\": true}', '[]', '[]', 309, '2022-01-10 17:49:00', '2022-01-10 17:49:00'), +(310, 'Marvel\\Database\\Models\\Attachment', 310, '2040026e-9fa3-4cdb-97af-ecf63e9e9dcf', 'default', 'Kids', 'Kids.png', 'image/png', 's3', 's3', 258731, '[]', '{\"thumbnail\": true}', '[]', '[]', 310, '2022-01-10 17:49:12', '2022-01-10 17:49:12'), +(311, 'Marvel\\Database\\Models\\Attachment', 311, '55d1ca02-4df6-456c-a1ff-47fa249f2542', 'default', 'Bag', 'Bag.png', 'image/png', 's3', 's3', 58543, '[]', '{\"thumbnail\": true}', '[]', '[]', 311, '2022-01-10 17:49:22', '2022-01-10 17:49:22'), +(312, 'Marvel\\Database\\Models\\Attachment', 312, '7e2521e6-0313-4e7b-93c5-004ed6b2f49f', 'default', 'woman', 'woman.png', 'image/png', 's3', 's3', 1980, '[]', '{\"thumbnail\": true}', '[]', '[]', 312, '2022-03-01 05:02:27', '2022-03-01 05:02:27'), +(313, 'Marvel\\Database\\Models\\Attachment', 313, '8129bdf0-17b7-4ff5-848d-1983388283e0', 'default', 'watch', 'watch.png', 'image/png', 's3', 's3', 1295, '[]', '{\"thumbnail\": true}', '[]', '[]', 313, '2022-03-01 05:03:07', '2022-03-01 05:03:07'), +(314, 'Marvel\\Database\\Models\\Attachment', 314, '10f2ad49-6af9-4e90-baf6-e00e3fe3c13a', 'default', 'sunglass', 'sunglass.png', 'image/png', 's3', 's3', 1873, '[]', '{\"thumbnail\": true}', '[]', '[]', 314, '2022-03-01 05:03:17', '2022-03-01 05:03:17'), +(315, 'Marvel\\Database\\Models\\Attachment', 315, '91c2e5e5-fcc8-4fe1-b141-1752d1789712', 'default', 'sports', 'sports.png', 'image/png', 's3', 's3', 3394, '[]', '{\"thumbnail\": true}', '[]', '[]', 315, '2022-03-01 05:03:25', '2022-03-01 05:03:26'), +(316, 'Marvel\\Database\\Models\\Attachment', 316, '6c37309b-7fd6-4248-aef6-3c602d62f746', 'default', 'sneakers', 'sneakers.png', 'image/png', 's3', 's3', 2709, '[]', '{\"thumbnail\": true}', '[]', '[]', 316, '2022-03-01 05:03:33', '2022-03-01 05:03:34'), +(317, 'Marvel\\Database\\Models\\Attachment', 317, '77ceb54b-188f-47c6-96c3-60d2af661ec6', 'default', 'man', 'man.png', 'image/png', 's3', 's3', 2006, '[]', '{\"thumbnail\": true}', '[]', '[]', 317, '2022-03-01 05:03:45', '2022-03-01 05:03:45'), +(318, 'Marvel\\Database\\Models\\Attachment', 318, '47351507-46cd-47e2-9503-f0f2495d4d90', 'default', 'kids', 'kids.png', 'image/png', 's3', 's3', 2467, '[]', '{\"thumbnail\": true}', '[]', '[]', 318, '2022-03-01 05:03:52', '2022-03-01 05:03:53'), +(319, 'Marvel\\Database\\Models\\Attachment', 319, 'b1525c82-00ba-493f-a82f-93f89851a2cc', 'default', 'bags', 'bags.png', 'image/png', 's3', 's3', 1870, '[]', '{\"thumbnail\": true}', '[]', '[]', 319, '2022-03-01 05:04:01', '2022-03-01 05:04:01'), +(320, 'Marvel\\Database\\Models\\Attachment', 320, 'fd145aae-bbea-4561-979f-5a5747a4c511', 'default', 'Footwear-1', 'Footwear-1.png', 'image/png', 's3', 's3', 248495, '[]', '{\"thumbnail\": true}', '[]', '[]', 320, '2022-03-02 04:47:15', '2022-03-02 04:47:16'), +(321, 'Marvel\\Database\\Models\\Attachment', 321, '26ff42eb-91ae-4f55-a6aa-ac0937b441ff', 'default', 'Footwear-1', 'Footwear-1.png', 'image/png', 's3', 's3', 248495, '[]', '{\"thumbnail\": true}', '[]', '[]', 321, '2022-03-02 04:47:25', '2022-03-02 04:47:25'), +(322, 'Marvel\\Database\\Models\\Attachment', 322, '5be0e57b-6304-4847-8aba-c350e69cf92f', 'default', 'watch', 'watch.png', 'image/png', 's3', 's3', 276201, '[]', '{\"thumbnail\": true}', '[]', '[]', 322, '2022-03-02 04:47:48', '2022-03-02 04:47:48'), +(323, 'Marvel\\Database\\Models\\Attachment', 323, '10cf0e96-74a0-441c-a0d6-7ca5ef6727e3', 'default', 'Footwear', 'Footwear.png', 'image/png', 's3', 's3', 202102, '[]', '{\"thumbnail\": true}', '[]', '[]', 323, '2022-03-02 04:49:48', '2022-03-02 04:49:48'); diff --git a/packages/marvel/stubs/sql/chawkbazar/model_has_permissions.sql b/packages/marvel/stubs/sql/chawkbazar/model_has_permissions.sql new file mode 100644 index 0000000..2fb7daf --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/model_has_permissions.sql @@ -0,0 +1,7 @@ +INSERT INTO `model_has_permissions` (`permission_id`, `model_type`, `model_id`) +VALUES (2, 'Marvel\\Database\\Models\\User', 1), + (2, 'Marvel\\Database\\Models\\User', 2), + (2, 'Marvel\\Database\\Models\\User', 4), + (2, 'Marvel\\Database\\Models\\User', 5), + (3, 'Marvel\\Database\\Models\\User', 1), + (2, 'Marvel\\Database\\Models\\User', 3); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/model_has_roles.sql b/packages/marvel/stubs/sql/chawkbazar/model_has_roles.sql new file mode 100644 index 0000000..6a0a91d --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/model_has_roles.sql @@ -0,0 +1,5 @@ +INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) +VALUES (2, 'Marvel\\Database\\Models\\User', 1), + (4, 'Marvel\\Database\\Models\\User', 3), + (4, 'Marvel\\Database\\Models\\User', 4), + (4, 'Marvel\\Database\\Models\\User', 5); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/order_product.sql b/packages/marvel/stubs/sql/chawkbazar/order_product.sql new file mode 100644 index 0000000..92d0cfa --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/order_product.sql @@ -0,0 +1,420 @@ +INSERT INTO `order_product` ( + `id`, + `order_id`, + `product_id`, + `variation_option_id`, + `order_quantity`, + `unit_price`, + `subtotal`, + `deleted_at`, + `created_at`, + `updated_at` + ) +VALUES ( + 3, + 13, + 53, + 95, + '3', + 150, + 450, + NULL, + '2023-11-20 06:14:43', + '2023-11-20 06:14:43' + ), + ( + 4, + 13, + 31, + 117, + '2', + 1800, + 3600, + NULL, + '2023-11-20 06:14:43', + '2023-11-20 06:14:43' + ), + ( + 5, + 14, + 53, + 95, + '3', + 150, + 450, + NULL, + '2023-11-20 06:14:43', + '2023-11-20 06:14:43' + ), + ( + 6, + 15, + 31, + 117, + '2', + 1800, + 3600, + NULL, + '2023-11-20 06:14:43', + '2023-11-20 06:14:43' + ), + ( + 7, + 16, + 4, + NULL, + '1', + 300, + 300, + NULL, + '2023-11-20 16:13:23', + '2023-11-20 16:13:23' + ), + ( + 8, + 17, + 4, + NULL, + '1', + 300, + 300, + NULL, + '2023-11-20 16:13:23', + '2023-11-20 16:13:23' + ), + ( + 9, + 18, + 57, + 100, + '1', + 90, + 90, + NULL, + '2023-11-20 17:24:51', + '2023-11-20 17:24:51' + ), + ( + 10, + 19, + 57, + 100, + '1', + 90, + 90, + NULL, + '2023-11-20 17:24:51', + '2023-11-20 17:24:51' + ), + ( + 11, + 20, + 57, + 100, + '1', + 90, + 90, + NULL, + '2023-11-21 03:42:29', + '2023-11-21 03:42:29' + ), + ( + 12, + 21, + 57, + 100, + '1', + 90, + 90, + NULL, + '2023-11-21 03:42:29', + '2023-11-21 03:42:29' + ), + ( + 13, + 22, + 14, + 142, + '2', + 400, + 800, + NULL, + '2023-11-21 04:46:52', + '2023-11-21 04:46:52' + ), + ( + 14, + 23, + 14, + 142, + '2', + 400, + 800, + NULL, + '2023-11-21 04:46:52', + '2023-11-21 04:46:52' + ), + ( + 15, + 24, + 50, + 93, + '1', + 30, + 30, + NULL, + '2023-11-21 12:25:38', + '2023-11-21 12:25:38' + ), + ( + 16, + 25, + 50, + 93, + '1', + 30, + 30, + NULL, + '2023-11-21 12:25:38', + '2023-11-21 12:25:38' + ), + ( + 17, + 26, + 19, + NULL, + '1', + 120, + 120, + NULL, + '2023-11-21 12:26:01', + '2023-11-21 12:26:01' + ), + ( + 18, + 27, + 19, + NULL, + '1', + 120, + 120, + NULL, + '2023-11-21 12:26:01', + '2023-11-21 12:26:01' + ), + ( + 19, + 28, + 57, + 108, + '1', + 80, + 80, + NULL, + '2023-11-21 12:26:43', + '2023-11-21 12:26:43' + ), + ( + 20, + 29, + 57, + 108, + '1', + 80, + 80, + NULL, + '2023-11-21 12:26:43', + '2023-11-21 12:26:43' + ), + ( + 21, + 30, + 37, + NULL, + '1', + 2996, + 2996, + NULL, + '2023-11-21 12:26:45', + '2023-11-21 12:26:45' + ), + ( + 22, + 31, + 37, + NULL, + '1', + 2996, + 2996, + NULL, + '2023-11-21 12:26:45', + '2023-11-21 12:26:45' + ), + ( + 23, + 32, + 31, + 151, + '1', + 3500, + 3500, + NULL, + '2023-11-21 12:26:49', + '2023-11-21 12:26:49' + ), + ( + 24, + 33, + 31, + 151, + '1', + 3500, + 3500, + NULL, + '2023-11-21 12:26:49', + '2023-11-21 12:26:49' + ), + ( + 25, + 34, + 1, + 2, + '1', + 20, + 20, + NULL, + '2023-11-21 12:26:51', + '2023-11-21 12:26:51' + ), + ( + 26, + 35, + 1, + 2, + '1', + 20, + 20, + NULL, + '2023-11-21 12:26:51', + '2023-11-21 12:26:51' + ), + ( + 27, + 36, + 27, + 62, + '1', + 180, + 180, + NULL, + '2023-11-21 12:27:00', + '2023-11-21 12:27:00' + ), + ( + 28, + 37, + 27, + 62, + '1', + 180, + 180, + NULL, + '2023-11-21 12:27:00', + '2023-11-21 12:27:00' + ), + ( + 29, + 38, + 21, + 44, + '1', + 25, + 25, + NULL, + '2023-11-21 12:27:04', + '2023-11-21 12:27:04' + ), + ( + 30, + 39, + 21, + 44, + '1', + 25, + 25, + NULL, + '2023-11-21 12:27:04', + '2023-11-21 12:27:04' + ), + ( + 31, + 40, + 11, + NULL, + '1', + 1350, + 1350, + NULL, + '2023-11-21 12:43:04', + '2023-11-21 12:43:04' + ), + ( + 32, + 41, + 11, + NULL, + '1', + 1350, + 1350, + NULL, + '2023-11-21 12:43:04', + '2023-11-21 12:43:04' + ), + ( + 33, + 42, + 11, + NULL, + '1', + 1350, + 1350, + NULL, + '2023-11-21 12:44:38', + '2023-11-21 12:44:38' + ), + ( + 34, + 43, + 11, + NULL, + '1', + 1350, + 1350, + NULL, + '2023-11-21 12:44:38', + '2023-11-21 12:44:38' + ), + ( + 35, + 44, + 53, + 95, + '2', + 150, + 300, + NULL, + '2023-11-21 12:51:13', + '2023-11-21 12:51:13' + ), + ( + 36, + 45, + 53, + 95, + '2', + 150, + 300, + NULL, + '2023-11-21 12:51:13', + '2023-11-21 12:51:13' + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/orders.sql b/packages/marvel/stubs/sql/chawkbazar/orders.sql new file mode 100644 index 0000000..c2d13f8 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/orders.sql @@ -0,0 +1,1088 @@ +INSERT INTO `orders` ( + `id`, + `tracking_number`, + `customer_id`, + `customer_contact`, + `customer_name`, + `amount`, + `sales_tax`, + `paid_total`, + `total`, + `note`, + `cancelled_amount`, + `cancelled_tax`, + `cancelled_delivery_fee`, + `language`, + `coupon_id`, + `parent_id`, + `shop_id`, + `discount`, + `payment_gateway`, + `altered_payment_gateway`, + `shipping_address`, + `billing_address`, + `logistics_provider`, + `delivery_fee`, + `delivery_time`, + `order_status`, + `payment_status`, + `deleted_at`, + `created_at`, + `updated_at` + ) +VALUES ( + 13, + '20231120240869', + 3, + '19365141641631', + 'Customer', + 4050, + 81, + 4181, + 4181, + 'This is a order note. \n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-20 06:14:43', + '2023-11-20 06:15:05' + ), + ( + 14, + '20231120168783', + 3, + '19365141641631', + 'Customer', + 450, + 0, + 450, + 450, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 13, + 1, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-completed', + 'payment-success', + NULL, + '2023-11-20 06:14:43', + '2023-11-20 06:18:05' + ), + ( + 15, + '20231120866806', + 3, + '19365141641631', + 'Customer', + 3600, + 0, + 3600, + 3600, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 13, + 9, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-completed', + 'payment-success', + NULL, + '2023-11-20 06:14:43', + '2023-11-20 06:22:22' + ), + ( + 16, + '20231120549600', + 3, + '19365141641631', + 'Customer', + 300, + 6, + 356, + 356, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-20 16:13:23', + '2023-11-20 16:13:35' + ), + ( + 17, + '20231120730602', + 3, + '19365141641631', + 'Customer', + 300, + 0, + 300, + 300, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 16, + 2, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-20 16:13:23', + '2023-11-20 16:13:35' + ), + ( + 18, + '20231120879243', + 3, + '19365141641631', + 'Customer', + 90, + 1.8, + 141.8, + 141.8, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-completed', + 'payment-success', + NULL, + '2023-11-20 17:24:51', + '2023-11-20 17:26:00' + ), + ( + 19, + '20231120994480', + 3, + '19365141641631', + 'Customer', + 90, + 0, + 90, + 90, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 18, + 11, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-20 17:24:51', + '2023-11-20 17:25:02' + ), + ( + 20, + '20231121197985', + 3, + '19365141641631', + 'Customer', + 90, + 1.8, + 141.8, + 141.8, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-completed', + 'payment-success', + NULL, + '2023-11-21 03:42:29', + '2023-11-21 03:43:14' + ), + ( + 21, + '20231121698019', + 3, + '19365141641631', + 'Customer', + 90, + 0, + 90, + 90, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 20, + 11, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 03:42:29', + '2023-11-21 03:42:38' + ), + ( + 22, + '20231121820421', + 3, + '19365141641631', + 'Customer', + 800, + 16, + 866, + 866, + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'CASH_ON_DELIVERY', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-completed', + 'payment-cash-on-delivery', + NULL, + '2023-11-21 04:46:52', + '2023-11-21 04:47:37' + ), + ( + 23, + '20231121316572', + 3, + '19365141641631', + 'Customer', + 800, + 0, + 800, + 800, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 22, + 5, + 0, + 'CASH_ON_DELIVERY', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-completed', + 'payment-cash-on-delivery', + NULL, + '2023-11-21 04:46:52', + '2023-11-21 04:47:09' + ), + ( + 24, + '20231121773316', + 3, + '19365141641631', + 'Customer', + 30, + 1.6, + 81.6, + 81.6, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-completed', + 'payment-success', + NULL, + '2023-11-21 12:25:38', + '2023-11-21 12:37:46' + ), + ( + 25, + '20231121403368', + 3, + '19365141641631', + 'Customer', + 30, + 0, + 30, + 30, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 24, + 1, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:25:38', + '2023-11-21 12:26:59' + ), + ( + 26, + '20231121655602', + 3, + '19365141641631', + 'Customer', + 120, + 3.6, + 173.6, + 173.6, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:26:01', + '2023-11-21 12:27:14' + ), + ( + 27, + '20231121290528', + 3, + '19365141641631', + 'Customer', + 120, + 0, + 120, + 120, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 26, + 6, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:26:01', + '2023-11-21 12:27:14' + ), + ( + 28, + '20231121842836', + 3, + '19365141641631', + 'Customer', + 80, + 17.98, + 147.98, + 147.98, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:26:43', + '2023-11-21 12:28:01' + ), + ( + 29, + '20231121583084', + 3, + '19365141641631', + 'Customer', + 80, + 0, + 80, + 80, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 28, + 11, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:26:43', + '2023-11-21 12:28:01' + ), + ( + 30, + '20231121416277', + 3, + '19365141641631', + 'Customer', + 2996, + 17.98, + 3063.98, + 3063.98, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:26:45', + '2023-11-21 12:28:06' + ), + ( + 31, + '20231121284250', + 3, + '19365141641631', + 'Customer', + 2996, + 0, + 2996, + 2996, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 30, + 10, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:26:45', + '2023-11-21 12:28:06' + ), + ( + 32, + '20231121898606', + 3, + '19365141641631', + 'Customer', + 3500, + 17.98, + 3567.98, + 3567.98, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:26:49', + '2023-11-21 12:28:10' + ), + ( + 33, + '20231121805753', + 3, + '19365141641631', + 'Customer', + 3500, + 0, + 3500, + 3500, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 32, + 9, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:26:49', + '2023-11-21 12:28:10' + ), + ( + 34, + '20231121241917', + 3, + '19365141641631', + 'Customer', + 20, + 0, + 0, + 0, + NULL, + 87.98, + 17.98, + 50.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-cancelled', + 'payment-success', + NULL, + '2023-11-21 12:26:51', + '2023-11-21 12:38:24' + ), + ( + 35, + '20231121457017', + 3, + '19365141641631', + 'Customer', + 20, + 0, + 0, + 0, + NULL, + 20.00, + 0.00, + 0.00, + 'en', + NULL, + 34, + 2, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-cancelled', + 'payment-success', + NULL, + '2023-11-21 12:26:51', + '2023-11-21 12:38:24' + ), + ( + 36, + '20231121761430', + 3, + '19365141641631', + 'Customer', + 180, + 17.98, + 247.98, + 247.98, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:27:00', + '2023-11-21 12:30:31' + ), + ( + 37, + '20231121315754', + 3, + '19365141641631', + 'Customer', + 180, + 0, + 180, + 180, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 36, + 8, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:27:00', + '2023-11-21 12:30:31' + ), + ( + 38, + '20231121898061', + 3, + '19365141641631', + 'Customer', + 25, + 17.98, + 92.98, + 92.98, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-completed', + 'payment-success', + NULL, + '2023-11-21 12:27:04', + '2023-11-21 12:39:55' + ), + ( + 39, + '20231121200980', + 3, + '19365141641631', + 'Customer', + 25, + 0, + 25, + 25, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 38, + 7, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-processing', + 'payment-success', + NULL, + '2023-11-21 12:27:04', + '2023-11-21 12:30:42' + ), + ( + 40, + '20231121721451', + 3, + '19365141641631', + 'Customer', + 1350, + 27, + 1427, + 1427, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-at-local-facility', + 'payment-pending', + NULL, + '2023-11-21 12:43:04', + '2023-11-21 12:46:09' + ), + ( + 41, + '20231121278525', + 3, + '19365141641631', + 'Customer', + 1350, + 0, + 1350, + 1350, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 40, + 4, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-pending', + 'payment-pending', + NULL, + '2023-11-21 12:43:04', + '2023-11-21 12:43:04' + ), + ( + 42, + '20231121360684', + 3, + '19365141641631', + 'Customer', + 1350, + 27, + 1427, + 1427, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-pending', + 'payment-pending', + NULL, + '2023-11-21 12:44:38', + '2023-11-21 12:44:38' + ), + ( + 43, + '20231121673899', + 3, + '19365141641631', + 'Customer', + 1350, + 0, + 1350, + 1350, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 42, + 4, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-pending', + 'payment-pending', + NULL, + '2023-11-21 12:44:38', + '2023-11-21 12:44:38' + ), + ( + 44, + '20231121977270', + 3, + '19365141641631', + 'Customer', + 300, + 6, + 356, + 356, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + NULL, + NULL, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 50, + 'Express Delivery', + 'order-completed', + 'payment-pending', + NULL, + '2023-11-21 12:51:13', + '2023-11-21 13:55:27' + ), + ( + 45, + '20231121512622', + 3, + '19365141641631', + 'Customer', + 300, + 0, + 300, + 300, + NULL, + 0.00, + 0.00, + 0.00, + 'en', + NULL, + 44, + 1, + 0, + 'STRIPE', + NULL, + '{\"zip\":\"10022\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"1780 Angus Road\"}', + '{\"zip\":\"10001\",\"city\":\"New York\",\"state\":\"New York\",\"country\":\"US\",\"street_address\":\"260 Terry Lane\"}', + NULL, + 0, + 'Express Delivery', + 'order-completed', + 'payment-pending', + NULL, + '2023-11-21 12:51:13', + '2023-11-21 13:55:46' + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/permissions.sql b/packages/marvel/stubs/sql/chawkbazar/permissions.sql new file mode 100644 index 0000000..7da452f --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/permissions.sql @@ -0,0 +1,35 @@ +INSERT INTO `permissions` ( + `id`, + `name`, + `guard_name`, + `created_at`, + `updated_at` + ) +VALUES ( + 1, + 'super_admin', + 'api', + '2021-06-27 04:13:00', + '2021-06-27 04:13:00' + ), + ( + 2, + 'customer', + 'api', + '2021-06-27 04:13:00', + '2021-06-27 04:13:00' + ), + ( + 3, + 'store_owner', + 'api', + '2021-06-27 04:13:00', + '2021-06-27 04:13:00' + ), + ( + 4, + 'staff', + 'api', + '2021-06-27 04:13:00', + '2021-06-27 04:13:00' + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/product_tag.sql b/packages/marvel/stubs/sql/chawkbazar/product_tag.sql new file mode 100644 index 0000000..dd454c9 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/product_tag.sql @@ -0,0 +1,153 @@ +INSERT INTO `product_tag` (`id`, `product_id`, `tag_id`) VALUES +(1, 1, 13), +(2, 1, 14), +(3, 1, 7), +(4, 2, 2), +(5, 2, 12), +(6, 2, 13), +(7, 3, 5), +(9, 6, 9), +(10, 12, 10), +(11, 12, 9), +(12, 11, 9), +(13, 11, 10), +(14, 11, 8), +(15, 11, 7), +(16, 10, 5), +(17, 10, 12), +(18, 10, 14), +(19, 10, 9), +(20, 10, 10), +(21, 12, 6), +(22, 11, 4), +(23, 9, 12), +(24, 9, 9), +(25, 9, 7), +(26, 8, 13), +(27, 8, 9), +(28, 8, 7), +(29, 7, 14), +(30, 7, 9), +(31, 7, 7), +(32, 6, 5), +(33, 6, 8), +(34, 6, 7), +(35, 5, 13), +(36, 5, 12), +(37, 5, 9), +(38, 5, 7), +(39, 4, 11), +(40, 4, 9), +(41, 4, 4), +(42, 4, 2), +(43, 4, 8), +(44, 3, 9), +(45, 3, 7), +(46, 13, 10), +(47, 13, 2), +(48, 14, 12), +(49, 14, 8), +(50, 14, 10), +(51, 15, 13), +(52, 15, 12), +(53, 15, 7), +(54, 16, 13), +(55, 16, 8), +(56, 17, 14), +(57, 17, 8), +(59, 19, 12), +(60, 19, 8), +(61, 19, 2), +(63, 19, 7), +(64, 20, 5), +(65, 20, 13), +(66, 20, 7), +(67, 21, 13), +(68, 21, 12), +(69, 21, 8), +(70, 22, 13), +(71, 22, 12), +(72, 22, 7), +(73, 23, 6), +(74, 23, 11), +(75, 24, 12), +(76, 24, 6), +(77, 24, 7), +(78, 23, 9), +(79, 25, 13), +(80, 25, 12), +(81, 25, 8), +(82, 25, 2), +(83, 26, 12), +(84, 26, 6), +(85, 27, 13), +(86, 27, 12), +(87, 27, 2), +(88, 28, 12), +(89, 28, 8), +(90, 28, 7), +(91, 29, 13), +(92, 29, 11), +(93, 30, 12), +(94, 30, 6), +(95, 31, 12), +(96, 31, 8), +(97, 32, 12), +(98, 32, 13), +(99, 33, 7), +(100, 34, 7), +(101, 35, 11), +(102, 36, 13), +(103, 36, 7), +(104, 37, 8), +(105, 38, 14), +(106, 39, 12), +(107, 39, 2), +(108, 40, 13), +(109, 40, 12), +(110, 41, 14), +(111, 42, 12), +(112, 42, 8), +(113, 43, 13), +(114, 43, 8), +(115, 44, 12), +(116, 44, 6), +(117, 45, 13), +(118, 46, 12), +(119, 46, 2), +(120, 47, 13), +(121, 47, 8), +(122, 48, 8), +(123, 49, 13), +(124, 49, 12), +(125, 50, 13), +(126, 50, 7), +(128, 52, 4), +(130, 53, 13), +(131, 53, 7), +(132, 54, 8), +(133, 54, 7), +(134, 55, 13), +(135, 55, 7), +(136, 56, 2), +(137, 56, 7), +(138, 57, 13), +(139, 57, 11), +(140, 37, 15), +(141, 36, 15), +(142, 35, 15), +(143, 34, 15), +(144, 33, 15), +(145, 32, 15), +(146, 31, 15), +(147, 30, 15), +(148, 29, 15), +(149, 28, 15), +(150, 26, 15), +(151, 24, 15), +(152, 51, 6), +(153, 18, 8), +(154, 18, 13), +(155, 9, 10), +(157, 49, 10), +(158, 25, 10); diff --git a/packages/marvel/stubs/sql/chawkbazar/products.sql b/packages/marvel/stubs/sql/chawkbazar/products.sql new file mode 100644 index 0000000..b058978 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/products.sql @@ -0,0 +1,1682 @@ +INSERT INTO `products` ( + `id`, + `name`, + `slug`, + `description`, + `type_id`, + `price`, + `shop_id`, + `sale_price`, + `sku`, + `quantity`, + `in_stock`, + `is_taxable`, + `shipping_class_id`, + `status`, + `product_type`, + `unit`, + `height`, + `width`, + `length`, + `image`, + `gallery`, + `deleted_at`, + `created_at`, + `updated_at`, + `max_price`, + `min_price`, + `video` + ) +VALUES ( + 1, + 'Hoppister Tops', + 'hoppister-tops', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome. Despite growing into one of the world’s most renowned luxury labels, the business has retained its family feel, with a focus on fine detail, Italian craftsmanship and the support of local artisans.', + 13, + NULL, + 2, + NULL, + NULL, + 1000, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 301, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/301/Chawkbazar7.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/301/conversions/Chawkbazar7-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-10 15:08:54', + '2021-12-14 08:05:17', + 25.00, + 20.00, + NULL + ), + ( + 2, + 'Pike Green Thunder', + 'pike-green-thunder', + 'Footwear refers to garments worn on the feet, which originally serves to purpose of protection against adversities of the environment, usually regarding ground textures and temperature.', + 14, + NULL, + 2, + NULL, + NULL, + 2000, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 Pair', + NULL, + NULL, + NULL, + '{\"id\": 299, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/299/Footwear-15.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/299/conversions/Footwear-15-thumbnail.jpg\"}', + '[{\"id\": 300, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/300/Footwear-14.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/300/conversions/Footwear-14-thumbnail.jpg\"}]', + NULL, + '2021-10-10 15:17:39', + '2021-12-14 08:05:49', + 2000.00, + 599.00, + NULL + ), + ( + 3, + 'Levi Blue top', + 'levi-blue-top', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome. Despite growing into one of the world’s most renowned luxury labels, the business has retained its family feel, with a focus on fine detail, Italian craftsmanship and the support of local artisans.', + 16, + NULL, + 2, + NULL, + NULL, + 3500, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 97, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/97/A-2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/97/conversions/A-2-thumbnail.jpg\"}', + '[{\"id\": 99, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/99/A-1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/99/conversions/A-1-thumbnail.jpg\"}, {\"id\": 100, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/100/A-2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/100/conversions/A-2-thumbnail.jpg\"}, {\"id\": 106, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/106/A-3.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/106/conversions/A-3-thumbnail.jpg\"}]', + NULL, + '2021-10-10 18:57:17', + '2021-12-14 08:06:34', + 600.00, + 180.00, + NULL + ), + ( + 4, + 'Dido Pilot Glass', + 'dido-pilot-glass', + 'Polarized sunglasses reduce glare reflected off of roads, bodies of water, snow and other horizontal surfaces.Restore true color.Vision lenses are 400UV rated, meaning it can block UVA and UVB radiation.', + 15, + 350, + 2, + 300, + 'kjkjnjk894561230', + 500, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 107, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/107/H-1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/107/conversions/H-1-thumbnail.jpg\"}', + '[{\"id\": 108, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/108/H.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/108/conversions/H-thumbnail.jpg\"}, {\"id\": 109, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/109/H-1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/109/conversions/H-1-thumbnail.jpg\"}]', + NULL, + '2021-10-10 19:27:52', + '2021-12-14 08:06:41', + 350.00, + 350.00, + NULL + ), + ( + 5, + 'Hopister Yellow', + 'hopister-yellow', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome. Despite growing into one of the world’s most renowned luxury labels, the business has retained its family feel, with a focus on fine detail, Italian craftsmanship and the support of local artisans.', + 13, + NULL, + 3, + NULL, + NULL, + 1000, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 Pcs', + NULL, + NULL, + NULL, + '{\"id\": 110, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/110/B.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/110/conversions/B-thumbnail.jpg\"}', + '[{\"id\": 112, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/112/B-1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/112/conversions/B-1-thumbnail.jpg\"}, {\"id\": 113, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/113/B-2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/113/conversions/B-2-thumbnail.jpg\"}, {\"id\": 114, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/114/B-3.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/114/conversions/B-3-thumbnail.jpg\"}]', + NULL, + '2021-10-10 19:31:40', + '2021-12-14 08:06:49', + 100.00, + 80.00, + NULL + ), + ( + 6, + 'Tippot Classic', + 'tippot-classic', + 'The new-model Submariner now features Rolex’s powerhouse calibre 3235 Perpetual movement. An upgrade from the calibre 3135 movement,', + 1, + 1250, + 3, + 1200, + 'sdgiaogkdaovmalkm', + 500, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 115, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/115/B-3.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/115/conversions/B-3-thumbnail.jpg\"}', + '[{\"id\": 117, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/117/B-1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/117/conversions/B-1-thumbnail.jpg\"}, {\"id\": 118, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/118/B-2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/118/conversions/B-2-thumbnail.jpg\"}, {\"id\": 119, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/119/B-3.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/119/conversions/B-3-thumbnail.jpg\"}]', + NULL, + '2021-10-10 19:34:45', + '2021-12-14 08:06:55', + 1250.00, + 1250.00, + NULL + ), + ( + 7, + 'Darmani Woolen Comfort', + 'darmani-woolen-comfort', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome. Despite growing into one of the world’s most renowned luxury labels, the business has retained its family feel, with a focus on fine detail, Italian craftsmanship and the support of local artisans.', + 11, + NULL, + 3, + NULL, + NULL, + 4500, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 120, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/120/A.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/120/conversions/A-thumbnail.jpg\"}', + '[{\"id\": 123, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/123/A-2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/123/conversions/A-2-thumbnail.jpg\"}, {\"id\": 124, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/124/A-3.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/124/conversions/A-3-thumbnail.jpg\"}]', + NULL, + '2021-10-10 19:38:32', + '2021-12-14 08:07:33', + 800.00, + 500.00, + NULL + ), + ( + 8, + 'P & M Tokyo Talkies', + 'p-m-tokyo-talkies', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome. Despite growing into one of the world’s most renowned luxury labels, the business has retained its family feel, with a focus on fine detail, Italian craftsmanship and the support of local artisans.', + 3, + NULL, + 3, + NULL, + NULL, + 3000, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 125, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/125/E--1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/125/conversions/E--1-thumbnail.jpg\"}', + '[{\"id\": 128, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/128/E--3.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/128/conversions/E--3-thumbnail.jpg\"}, {\"id\": 129, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/129/E-4.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/129/conversions/E-4-thumbnail.jpg\"}]', + NULL, + '2021-10-10 19:45:43', + '2021-12-14 08:08:31', + 1500.00, + 50.00, + NULL + ), + ( + 9, + 'Pior Womes Bangles', + 'pior-womes-bangles', + 'Structured buffed nappa leather top handle bag in ‘scarlet’ red. Carry handle at top. Detachable and adjustable shoulder strap with lanyard clasp fastening.', + 6, + 1200, + 4, + 1150, + 'sdvvsdf4544ddfgh+', + 500, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pcs', + NULL, + NULL, + NULL, + '{\"id\": 130, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/130/D---2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/130/conversions/D---2-thumbnail.jpg\"}', + '[{\"id\": 132, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/132/D--1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/132/conversions/D--1-thumbnail.jpg\"}]', + NULL, + '2021-10-10 19:47:11', + '2021-12-14 08:09:06', + 1200.00, + 1200.00, + NULL + ), + ( + 10, + 'Tuma Style Cap', + 'tuma-style-cap', + 'Structured buffed nappa leather top handle bag in ‘scarlet’ red. Carry handle at top. Detachable and adjustable shoulder strap with lanyard clasp fastening.', + 12, + 170, + 4, + 150, + '+898998', + 500, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 Pc', + NULL, + NULL, + NULL, + '{\"id\": 296, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/296/2-0%281%29.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/296/conversions/2-0%281%29-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-10 19:50:30', + '2021-12-14 08:09:11', + 170.00, + 170.00, + NULL + ), + ( + 11, + 'Tay Ben Aviator', + 'tay-ben-aviator', + 'Polarized sunglasses reduce glare reflected off of roads, bodies of water, snow and other horizontal surfaces.Restore true color.Vision lenses are 400UV rated, meaning it can block UVA and UVB radiation.', + 3, + 1500, + 4, + 1350, + '1500654545', + 500, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 295, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/295/400.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/295/conversions/400-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-10 19:53:57', + '2021-12-14 08:09:16', + 1500.00, + 1500.00, + NULL + ), + ( + 12, + 'Zara Army Bag', + 'zara-army-bag', + 'Structured buffed nappa leather top handle bag in ‘scarlet’ red. Carry handle at top. Detachable and adjustable shoulder strap with lanyard clasp fastening.', + 8, + 300, + 4, + 260, + 'h3', + 500, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 292, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/292/10.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/292/conversions/10-thumbnail.jpg\"}', + '[{\"id\": 139, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/139/H-1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/139/conversions/H-1-thumbnail.jpg\"}, {\"id\": 140, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/140/H-2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/140/conversions/H-2-thumbnail.jpg\"}, {\"id\": 141, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/141/H-3.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/141/conversions/H-3-thumbnail.jpg\"}]', + NULL, + '2021-10-10 21:49:55', + '2021-12-14 08:09:37', + 300.00, + 300.00, + NULL + ), + ( + 13, + 'Pissot Super Dry', + 'pissot-super-dry', + 'The new-model Submariner now features Rolex’s powerhouse calibre 3235 Perpetual movement. An upgrade from the calibre 3135 movement, it now features a more efficient skeletonized Chronergy escapement and longer power reserve.', + 6, + 280, + 5, + 250, + '89657412330', + 500, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 322, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/322/watch.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/322/conversions/watch-thumbnail.jpg\"}', + '[{\"id\": 143, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/143/F.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/143/conversions/F-thumbnail.jpg\"}, {\"id\": 144, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/144/F-1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/144/conversions/F-1-thumbnail.jpg\"}]', + NULL, + '2021-10-11 13:14:25', + '2022-03-02 04:47:50', + 280.00, + 280.00, + NULL + ), + ( + 14, + 'Tuma Grey', + 'tuma-grey', + 'Footwear refers to garments worn on the feet, which originally serves to purpose of protection against adversities of the environment, usually regarding ground textures and temperature.', + 7, + NULL, + 5, + NULL, + NULL, + 3000, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pair', + NULL, + NULL, + NULL, + '{\"id\": 294, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/294/30-%281%29.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/294/conversions/30-%281%29-thumbnail.jpg\"}', + '[{\"id\": 147, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/147/E-1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/147/conversions/E-1-thumbnail.jpg\"}]', + NULL, + '2021-10-11 13:16:13', + '2021-12-14 08:10:38', + 1000.00, + 400.00, + NULL + ), + ( + 15, + 'Neutral Scoop Neck Top', + 'neutral-scoop-neck-top', + 'Casual wear (casual attire or clothing) may be a Western code that’s relaxed, occasional, spontaneous and fitted to everyday use', + 3, + NULL, + 5, + NULL, + NULL, + 3500, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 148, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/148/women5-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/148/conversions/women5-1-thumbnail.jpg\"}', + '[{\"id\": 150, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/150/women-14-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/150/conversions/women-14-1-thumbnail.jpg\"}, {\"id\": 151, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/151/women-17-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/151/conversions/women-17-1-thumbnail.jpg\"}, {\"id\": 152, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/152/women-18-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/152/conversions/women-18-1-thumbnail.jpg\"}]', + NULL, + '2021-10-11 13:24:46', + '2021-12-14 08:11:41', + 1000.00, + 30.00, + NULL + ), + ( + 16, + 'Paddidas Grey T shirt', + 'paddidas-grey-t-shirt', + 'Casual wear (casual attire or clothing) may be a Western code that’s relaxed, occasional, spontaneous and fitted to everyday use. Casual wear became popular within the Western world', + 13, + NULL, + 5, + NULL, + NULL, + 3500, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 153, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/153/G.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/153/conversions/G-thumbnail.jpg\"}', + '[{\"id\": 156, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/156/G-2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/156/conversions/G-2-thumbnail.jpg\"}, {\"id\": 157, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/157/G-3.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/157/conversions/G-3-thumbnail.jpg\"}]', + NULL, + '2021-10-11 13:56:12', + '2021-12-14 08:12:16', + 1000.00, + 20.00, + NULL + ), + ( + 17, + 'Vittione Highlander', + 'vittione-highlander', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome.', + 10, + NULL, + 6, + NULL, + NULL, + 1000, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 158, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/158/Chawkbazar13.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/158/conversions/Chawkbazar13-thumbnail.jpg\"}', + '[{\"id\": 160, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/160/Chawkbazar14.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/160/conversions/Chawkbazar14-thumbnail.jpg\"}, {\"id\": 161, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/161/Chawkbazar15.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/161/conversions/Chawkbazar15-thumbnail.jpg\"}, {\"id\": 162, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/162/Chawkbazar16.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/162/conversions/Chawkbazar16-thumbnail.jpg\"}]', + NULL, + '2021-10-11 14:30:59', + '2021-12-14 08:12:25', + 800.00, + 750.00, + NULL + ), + ( + 18, + 'Pucchi Fasion watch', + 'pucchi-fasion-watch', + 'The 2020 Submariner Rolex is now powered by the calibre 3230 Perpetual movement, a brand-new movement that incorporates a Chronergy escapement', + 1, + 1200, + 6, + 1000, + '/89465+21320', + 500, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 163, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/163/Watches-7.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/163/conversions/Watches-7-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-11 14:33:30', + '2021-12-14 08:15:17', + 1200.00, + 1200.00, + NULL + ), + ( + 19, + 'Parmani Submariner', + 'parmani-submariner', + 'The 2020 Submariner Rolex is now powered by the calibre 3230 Perpetual movement, a brand-new movement that incorporates a Chronergy escapement', + 12, + 1500, + 6, + 120, + '5/9784615', + 500, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 165, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/165/Watches-10.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/165/conversions/Watches-10-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-11 14:37:33', + '2021-12-14 08:15:23', + 1500.00, + 1500.00, + NULL + ), + ( + 20, + 'Black Crew V neck Tops', + 'black-crew-v-neck-tops', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome. Despite growing into one of the world’s most renowned luxury labels, the business has retained its family feel, with a focus on fine detail, Italian craftsmanship and the support of local artisans.', + 4, + NULL, + 6, + NULL, + NULL, + 1500, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 167, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/167/Women.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/167/conversions/Women-thumbnail.jpg\"}', + '[{\"id\": 169, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/169/Women-2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/169/conversions/Women-2-thumbnail.jpg\"}, {\"id\": 170, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/170/Women-3.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/170/conversions/Women-3-thumbnail.jpg\"}]', + NULL, + '2021-10-11 14:39:30', + '2021-12-14 08:15:29', + 30.00, + 22.00, + NULL + ), + ( + 21, + 'Pk Warm Stripes', + 'pk-warm-stripes', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome. Despite growing into one of the world’s most renowned luxury labels, the business has retained its family feel, with a focus on fine detail, Italian craftsmanship and the support of local artisans.', + 10, + NULL, + 7, + NULL, + NULL, + 1000, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 171, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/171/F-2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/171/conversions/F-2-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-11 14:41:08', + '2021-12-14 08:15:43', + 40.00, + 18.00, + NULL + ), + ( + 22, + 'Funder Armor Yellow Tops', + 'funder-armor-yellow-tops', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome. Despite growing into one of the world’s most renowned luxury labels, the business has retained its family feel, with a focus on fine detail, Italian craftsmanship and the support of local artisans.', + 16, + NULL, + 7, + NULL, + NULL, + 1500, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pcs', + NULL, + NULL, + NULL, + '{\"id\": 173, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/173/C.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/173/conversions/C-thumbnail.jpg\"}', + '[{\"id\": 175, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/175/C-2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/175/conversions/C-2-thumbnail.jpg\"}, {\"id\": 176, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/176/C-3.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/176/conversions/C-3-thumbnail.jpg\"}]', + NULL, + '2021-10-11 14:42:33', + '2021-12-14 08:15:50', + 35.00, + 30.00, + NULL + ), + ( + 23, + 'Tuma Kidsa bag', + 'tuma-kidsa-bag', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome. Despite growing into one of the world’s most renowned luxury labels, the business has retained its family feel, with a focus on fine detail, Italian craftsmanship and the support of local artisans.', + 3, + NULL, + 7, + NULL, + NULL, + 1500, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pcs', + NULL, + NULL, + NULL, + '{\"id\": 177, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/177/j.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/177/conversions/j-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-11 14:44:01', + '2021-12-14 08:15:58', + 50.00, + 40.00, + NULL + ), + ( + 24, + 'Chevis Womens Bag', + 'chevis-womens-bag', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome. Despite growing into one of the world’s most renowned luxury labels, the business has retained its family feel, with a focus on fine detail, Italian craftsmanship and the support of local artisans.', + 5, + NULL, + 7, + NULL, + NULL, + 1500, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 179, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/179/Backpack-4.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/179/conversions/Backpack-4-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-11 14:45:37', + '2021-12-14 08:16:05', + 80.00, + 75.00, + NULL + ), + ( + 25, + 'Addidas FuelCell Propel V2 Running Shoes', + 'addidas-fuelcell-propel-v2-running-shoes', + 'Footwear refers to garments worn on the feet, which originally serves to purpose of protection against adversities of the environment, usually regarding ground textures and temperature.', + 7, + NULL, + 8, + NULL, + NULL, + 2000, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pair', + NULL, + NULL, + NULL, + '{\"id\": 323, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/323/Footwear.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/323/conversions/Footwear-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 13:40:16', + '2022-03-02 04:49:59', + 50.00, + 45.00, + NULL + ), + ( + 26, + 'Alex Maqueeen Shoulder Bag', + 'alex-maqueeen-shoulder-bag', + 'Luxury British fashion house Alexander McQueen is famed for its exquisitely designed handbags and accessories, as showcased through this stunning black Box bag.', + 16, + 250, + 8, + 220, + '8468fas4d86f4asd8fsdafsdaf+', + 500, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 181, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/181/Backpack-8.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/181/conversions/Backpack-8-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 13:47:15', + '2021-12-14 08:16:21', + 250.00, + 250.00, + NULL + ), + ( + 27, + 'Armani Retaliate Shoes', + 'armani-retaliate-shoes', + 'Footwear refers to garments worn on the feet, which originally serves to purpose of protection against adversities of the environment, usually regarding ground textures and temperature.', + 7, + NULL, + 8, + NULL, + NULL, + 2000, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pair', + NULL, + NULL, + NULL, + '{\"id\": 182, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/182/Footwear-3-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/182/conversions/Footwear-3-1-thumbnail.jpg\"}', + '[{\"id\": 183, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/183/Footwear-2-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/183/conversions/Footwear-2-1-thumbnail.jpg\"}]', + NULL, + '2021-10-23 13:50:44', + '2021-12-14 08:16:30', + 200.00, + 180.00, + NULL + ), + ( + 28, + 'Armani 269S Sunglasses', + 'armani-269s-sunglasses', + 'Polarized sunglasses reduce glare reflected off of roads, bodies of water, snow and other horizontal surfaces.Restore true color.Vision lenses are 400UV rated, meaning it can block UVA and UVB radiation.', + 13, + 120, + 8, + 80, + 'asdaeq34234sdasdasd', + 500, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 184, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/184/Sunglasess-12-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/184/conversions/Sunglasess-12-1-thumbnail.jpg\"}', + '[{\"id\": 185, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/185/Sunglasess-13-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/185/conversions/Sunglasess-13-1-thumbnail.jpg\"}]', + NULL, + '2021-10-23 16:19:23', + '2021-12-14 08:16:38', + 120.00, + 120.00, + NULL + ), + ( + 29, + 'Armani Checked Shirt', + 'armani-checked-shirt', + 'Children’s clothing/ kids wear is usually more casual than adult clothing, fit play and rest. Hosiery is usually used. More recently, however, tons of childrenswear is heavily influenced by trends in adult fashion', + 16, + NULL, + 8, + NULL, + NULL, + 300, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 186, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/186/kids-11.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/186/conversions/kids-11-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 20:07:58', + '2022-03-02 04:49:24', + 900.00, + 500.00, + NULL + ), + ( + 30, + 'Chanel Shoulder Bag', + 'chanel-shoulder-bag', + '100% Authenticity Guaranteed Chanel Classic Jumbo Single Flap Black Caviar Shoulder Bag', + 12, + 1500, + 9, + 1300, + 'adsasfsdar34543654fddsfdsf', + 300, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 188, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/188/Backpack-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/188/conversions/Backpack-1-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 20:13:50', + '2021-12-14 08:16:52', + 1500.00, + 1500.00, + NULL + ), + ( + 31, + 'Converse Blazing Black', + 'converse-blazing-black', + 'Footwear refers to garments worn on the feet, which originally serves to purpose of protection against adversities of the environment, usually regarding ground textures and temperature.', + 14, + NULL, + 9, + NULL, + NULL, + 2650, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 189, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/189/Footwear-4-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/189/conversions/Footwear-4-1-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 20:18:14', + '2021-12-14 08:16:58', + 5000.00, + 1800.00, + NULL + ), + ( + 32, + 'Givenchy Shoulder Bag', + 'givenchy-shoulder-bag', + 'Established in 1952, Givenchy’s stance on contemporary elegance is perfectly captured through the brand’s premium accessory collections. Crafted from calf leather.', + 8, + 1500, + 9, + 1450, + 'sadasds342343fsdfsdf', + 100, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 191, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/191/Backpack-5.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/191/conversions/Backpack-5-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 20:21:20', + '2021-12-14 08:17:04', + 1500.00, + 1500.00, + NULL + ), + ( + 33, + 'Gucci Challenger', + 'gucci-challenger', + 'Casual wear (casual attire or clothing) may be a Western code that’s relaxed, occasional, spontaneous and fitted to everyday use', + 15, + NULL, + 9, + NULL, + NULL, + 200, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 192, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/192/women9-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/192/conversions/women9-1-thumbnail.jpg\"}', + '[{\"id\": 193, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/193/women-22-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/193/conversions/women-22-1-thumbnail.jpg\"}]', + NULL, + '2021-10-23 20:57:31', + '2021-12-14 08:17:10', + 1000.00, + 899.00, + NULL + ), + ( + 34, + 'H & Dri-FIT Fleece', + 'h-dri-fit-fleece', + 'Casual wear (casual attire or clothing) may be a Western code that’s relaxed, occasional, spontaneous and fitted to everyday use', + 13, + 650, + 9, + 550, + 'asadq24234sadasd', + 100, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 194, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/194/women10%402x-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/194/conversions/women10%402x-1-thumbnail.jpg\"}', + '[{\"id\": 195, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/195/women-13-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/195/conversions/women-13-1-thumbnail.jpg\"}]', + NULL, + '2021-10-23 21:10:22', + '2021-12-14 08:17:15', + 650.00, + 650.00, + NULL + ), + ( + 35, + 'H&M Boys Top', + 'h-m-boys-top', + 'Children’s clothing/ kids wear is usually more casual than adult clothing, fit play and rest. Hosiery is usually used. More recently, however, tons of childrenswear is heavily influenced by trends in adult fashion', + 9, + NULL, + 10, + NULL, + NULL, + 1100, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 196, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/196/kids-4.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/196/conversions/kids-4-thumbnail.jpg\"}', + '[{\"id\": 197, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/197/kids-5.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/197/conversions/kids-5-thumbnail.jpg\"}]', + NULL, + '2021-10-23 21:14:02', + '2021-12-14 08:17:20', + 1000.00, + 350.00, + NULL + ), + ( + 36, + 'Hermes Carlton London', + 'hermes-carlton-london', + 'Off-White self-striped knitted midi A-line dress, has a scoop neck, sleeveless, straight hem', + 6, + NULL, + 10, + NULL, + NULL, + 2700, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 198, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/198/Grid-14.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/198/conversions/Grid-14-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 21:17:24', + '2021-12-14 08:17:26', + 650.00, + 300.00, + NULL + ), + ( + 37, + 'Hermes Galaxy Watch 3', + 'hermes-galaxy-watch-3', + 'The Original watch featuring polished rose gold stainless steel case, black dial with minimalist rose gold markers, and a black genuine leather band. The Horse logo lettering on dial and at buckle closure.', + 4, + 3200, + 10, + 2996, + 'sadsafsr234234sdfsdsd', + 15, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 200, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/200/Watches-16.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/200/conversions/Watches-16-thumbnail.jpg\"}', + '[{\"id\": 201, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/201/Watches-16.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/201/conversions/Watches-16-thumbnail.jpg\"}]', + NULL, + '2021-10-23 21:19:15', + '2021-12-14 08:17:31', + 3200.00, + 3200.00, + NULL + ), + ( + 38, + 'Hermes Grey', + 'hermes-grey', + 'Children’s clothing/ kids wear is usually more casual than adult clothing, fit play and rest. Hosiery is usually used. More recently, however, tons of childrenswear is heavily influenced by trends in adult fashion', + 10, + 650, + 10, + 620, + 'adasds324234fdsfsdf', + 100, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 202, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/202/kids-17.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/202/conversions/kids-17-thumbnail.jpg\"}', + '[{\"id\": 203, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/203/kids-23.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/203/conversions/kids-23-thumbnail.jpg\"}]', + NULL, + '2021-10-23 21:20:55', + '2021-12-14 08:19:56', + 650.00, + 650.00, + NULL + ), + ( + 39, + 'Hermes179S Sunglasses', + 'hermes179s-sunglasses', + 'Polarized sunglasses reduce glare reflected off of roads, bodies of water, snow and other horizontal surfaces.Restore true color.Vision lenses are 400UV rated, meaning it can block UVA and UVB radiation.', + 15, + 250, + 10, + 230, + 'saffrwe435tgdfhdf', + 250, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 204, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/204/Sunglasess-15-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/204/conversions/Sunglasess-15-1-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 21:22:59', + '2021-12-14 08:19:51', + 250.00, + 250.00, + NULL + ), + ( + 40, + 'Hipster Hexagonal Polarized Sunglasses', + 'hipster-hexagonal-polarized-sunglasses', + 'The Original watch featuring polished rose gold stainless steel case, black dial with minimalist rose gold markers, and a black genuine leather band. The Horse logo lettering on dial and at buckle closure.', + 2, + 300, + 3, + 279, + 'dsafra453tgv', + 497, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 205, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/205/Sunglasess-5-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/205/conversions/Sunglasess-5-1-thumbnail.jpg\"}', + '[{\"id\": 206, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/206/Sunglasess-6.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/206/conversions/Sunglasess-6-thumbnail.jpg\"}]', + NULL, + '2021-10-23 21:25:08', + '2021-12-14 08:19:45', + 300.00, + 300.00, + NULL + ), + ( + 41, + 'Louise Vuitton Highlander', + 'louise-vuitton-highlander', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome.', + 11, + NULL, + 3, + NULL, + NULL, + 698, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 207, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/207/Chawkbazar13.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/207/conversions/Chawkbazar13-thumbnail.jpg\"}', + '[{\"id\": 208, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/208/Chawkbazar14.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/208/conversions/Chawkbazar14-thumbnail.jpg\"}]', + NULL, + '2021-10-23 21:30:19', + '2021-12-14 08:19:40', + 1150.00, + 950.00, + NULL + ), + ( + 42, + 'Louise Vutton Feel the Air', + 'louise-vutton-feel-the-air', + 'Footwear refers to garments worn on the feet, which originally serves to purpose of protection against adversities of the environment, usually regarding ground textures and temperature.', + 14, + NULL, + 11, + NULL, + NULL, + 1200, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 209, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/209/Footwear-17.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/209/conversions/Footwear-17-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 21:33:38', + '2021-12-14 08:19:34', + 260.00, + 240.00, + NULL + ), + ( + 43, + 'Louise Vutton Pure Black Shirt', + 'louise-vutton-pure-black-shirt', + 'Casual wear (casual attire or clothing) may be a Western code that’s relaxed, occasional, spontaneous and fitted to everyday use. Casual wear became popular within the Western world', + 1, + NULL, + 11, + NULL, + NULL, + 700, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 210, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/210/mens-9.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/210/conversions/mens-9-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 21:36:54', + '2021-12-14 08:19:28', + 90.00, + 75.00, + NULL + ), + ( + 44, + 'Mac Nordace Laptop Bag', + 'mac-nordace-laptop-bag', + 'Bewitching black, plush padding and faux-fur lining surround and cradle your 15.6 macbook™ in trendsetting luxury. It is the perfect accessory for every season and all occasions.', + 8, + 550, + 11, + 500, + 'sdfas4335sddasd', + 50, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 212, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/212/Backpack-6.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/212/conversions/Backpack-6-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 21:40:27', + '2021-12-14 08:19:23', + 550.00, + 550.00, + NULL + ), + ( + 45, + 'Maniac Red Boys', + 'maniac-red-boys', + 'Sporty essentials, these Under Armour athletic shorts are smooth and lightweight in moisture-wicking material.', + 3, + 15, + 1, + 12, + 'ghfhg765675fhgfhg', + 48, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 213, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/213/Chawkbazar17.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/213/conversions/Chawkbazar17-thumbnail.jpg\"}', + '[{\"id\": 214, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/214/Chawkbazar20.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/214/conversions/Chawkbazar20-thumbnail.jpg\"}]', + NULL, + '2021-10-23 21:42:55', + '2021-12-14 08:19:18', + 15.00, + 15.00, + NULL + ), + ( + 46, + 'Nike Aviator', + 'nike-aviator', + 'Footwear refers to garments worn on the feet, which originally serves to purpose of protection against adversities of the environment, usually regarding ground textures and temperature.', + 7, + NULL, + 1, + NULL, + NULL, + 650, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 215, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/215/Footwear-9.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/215/conversions/Footwear-9-thumbnail.jpg\"}', + '[{\"id\": 216, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/216/Footwear-8.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/216/conversions/Footwear-8-thumbnail.jpg\"}]', + NULL, + '2021-10-23 21:49:36', + '2021-12-14 08:19:13', + 180.00, + 160.00, + NULL + ), + ( + 47, + 'Nike Black', + 'nike-black', + 'Casual wear (casual attire or clothing) may be a Western code that’s relaxed, occasional, spontaneous and fitted to everyday use. Casual wear became popular within the Western world', + 12, + NULL, + 1, + NULL, + NULL, + 100, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 217, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/217/mens-2.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/217/conversions/mens-2-thumbnail.jpg\"}', + '[{\"id\": 218, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/218/mens-7.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/218/conversions/mens-7-thumbnail.jpg\"}]', + NULL, + '2021-10-23 21:53:15', + '2021-12-14 08:19:07', + 120.00, + 100.00, + NULL + ), + ( + 48, + 'Nike Car Wheel Watch', + 'nike-car-wheel-watch', + 'The Original watch featuring polished rose gold stainless steel case, black dial with minimalist rose gold markers, and a black genuine leather band. The Horse logo lettering on dial and at buckle closure.', + 6, + 250, + 1, + 230, + 'sfsdfdfg4354354sfdsdf', + 50, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 219, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/219/Watches-6-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/219/conversions/Watches-6-1-thumbnail.jpg\"}', + '[{\"id\": 220, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/220/Watches-7-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/220/conversions/Watches-7-1-thumbnail.jpg\"}]', + NULL, + '2021-10-23 21:56:11', + '2021-12-14 08:19:02', + 250.00, + 250.00, + NULL + ), + ( + 49, + 'Nike Comfy Vapor Maxpro', + 'nike-comfy-vapor-maxpro', + 'Footwear refers to garments worn on the feet, which originally serves to purpose of protection against adversities of the environment, usually regarding ground textures and temperature.', + 7, + NULL, + 1, + NULL, + 'sdfsdfsd43435dsdasd', + 2000, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 321, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/321/Footwear-1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/321/conversions/Footwear-1-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 21:59:10', + '2022-03-02 04:47:28', + 250.00, + 220.00, + NULL + ), + ( + 50, + 'Nike Pro Mesh Top with Leggins', + 'nike-pro-mesh-top-with-leggins', + 'Casual wear (casual attire or clothing) may be a Western code that’s relaxed, occasional, spontaneous and fitted to everyday use', + 2, + NULL, + 1, + NULL, + NULL, + 100, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 223, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/223/Casual-Wear-4-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/223/conversions/Casual-Wear-4-1-thumbnail.jpg\"}', + '[{\"id\": 224, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/224/Casual-Wear-5-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/224/conversions/Casual-Wear-5-1-thumbnail.jpg\"}]', + NULL, + '2021-10-23 22:03:36', + '2021-12-14 08:18:51', + 35.00, + 30.00, + NULL + ), + ( + 51, + 'Philip Lim Leather Shoulder Bag', + 'philip-lim-leather-shoulder-bag', + 'Structured buffed nappa leather top handle bag in ‘scarlet’ red. Carry handle at top. Detachable and adjustable shoulder strap with lanyard clasp fastening.', + 8, + 260, + 1, + 250, + 'sadsade3432435654gfdg', + 100, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 225, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/225/Backpack-7.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/225/conversions/Backpack-7-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 22:05:45', + '2021-12-14 08:18:46', + 260.00, + 260.00, + NULL + ), + ( + 52, + 'Reyban Havana Phantos Sunglasses', + 'reyban-havana-phantos-sunglasses', + 'Polarized sunglasses reduce glare reflected off of roads, bodies of water, snow and other horizontal surfaces.Restore true color.Vision lenses are 400UV rated, meaning it can block UVA and UVB radiation.', + 9, + 100, + 1, + 80, + 'ffgd56tgdfsd', + 50, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 226, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/226/Sunglasess-2-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/226/conversions/Sunglasess-2-1-thumbnail.jpg\"}', + '[{\"id\": 227, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/227/Sunglasess-3-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/227/conversions/Sunglasess-3-1-thumbnail.jpg\"}]', + NULL, + '2021-10-23 22:09:25', + '2021-12-14 08:18:41', + 100.00, + 100.00, + NULL + ), + ( + 53, + 'Roadster Women Round Neck', + 'roadster-women-round-neck', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome.', + 11, + NULL, + 1, + NULL, + NULL, + 100, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 228, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/228/Chawkbazar22.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/228/conversions/Chawkbazar22-thumbnail.jpg\"}', + '[{\"id\": 229, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/229/Chawkbazar21.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/229/conversions/Chawkbazar21-thumbnail.jpg\"}]', + NULL, + '2021-10-23 22:12:41', + '2021-12-14 08:18:36', + 200.00, + 150.00, + NULL + ), + ( + 54, + 'The Horse Original', + 'the-horse-original', + 'The Original watch featuring polished rose gold stainless steel case, black dial with minimalist rose gold markers, and a black genuine leather band. The Horse logo lettering on dial and at buckle closure.', + 4, + 200, + 11, + 190, + 'csdcsd77sdasda', + 250, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 230, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/230/Watches-4-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/230/conversions/Watches-4-1-thumbnail.jpg\"}', + '[{\"id\": 231, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/231/Watches-4-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/231/conversions/Watches-4-1-thumbnail.jpg\"}]', + NULL, + '2021-10-23 22:14:33', + '2021-12-14 08:18:31', + 200.00, + 200.00, + NULL + ), + ( + 55, + 'White Oxford Shirt', + 'white-oxford-shirt', + 'Casual wear (casual attire or clothing) may be a Western code that’s relaxed, occasional, spontaneous and fitted to everyday use', + 1, + NULL, + 11, + NULL, + NULL, + 1080, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 232, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/232/Casual-Wear-1-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/232/conversions/Casual-Wear-1-1-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 22:18:00', + '2021-12-14 08:18:27', + 40.00, + 10.00, + NULL + ), + ( + 56, + 'Zara Miss Chase', + 'zara-miss-chase', + 'Fendi began life in 1925 as a fur and leather speciality store in Rome.', + 2, + 100, + 11, + 90, + 'cscascas67789adasd', + 120, + 1, + 0, + NULL, + 'publish', + 'simple', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 234, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/234/Chawkbazar1.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/234/conversions/Chawkbazar1-thumbnail.jpg\"}', + '[{\"id\": 235, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/235/Chawkbazar2.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/235/conversions/Chawkbazar2-thumbnail.jpg\"}]', + NULL, + '2021-10-23 22:20:09', + '2021-12-14 08:18:21', + 100.00, + 100.00, + NULL + ), + ( + 57, + 'Zara Monte Carlo', + 'zara-monte-carlo', + 'Children’s clothing/ kids wear is usually more casual than adult clothing, fit play and rest. Hosiery is usually used. More recently, however, tons of childrenswear is heavily influenced by trends in adult fashion', + 10, + NULL, + 11, + NULL, + NULL, + 740, + 1, + 0, + NULL, + 'publish', + 'variable', + '1 pc', + NULL, + NULL, + NULL, + '{\"id\": 236, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/236/kids-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/236/conversions/kids-1-thumbnail.jpg\"}', + '[]', + NULL, + '2021-10-23 22:22:38', + '2021-12-14 08:18:15', + 100.00, + 80.00, + NULL + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/role_has_permissions.sql b/packages/marvel/stubs/sql/chawkbazar/role_has_permissions.sql new file mode 100644 index 0000000..fae86a1 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/role_has_permissions.sql @@ -0,0 +1,9 @@ +INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) +VALUES (1, 1), + (2, 1), + (2, 2), + (2, 3), + (2, 4), + (3, 1), + (3, 2), + (4, 3); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/roles.sql b/packages/marvel/stubs/sql/chawkbazar/roles.sql new file mode 100644 index 0000000..6073a88 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/roles.sql @@ -0,0 +1,35 @@ +INSERT INTO `roles` ( + `id`, + `name`, + `guard_name`, + `created_at`, + `updated_at` + ) +VALUES ( + 1, + 'super_admin', + 'api', + '2023-08-11 11:57:33', + '2023-08-11 11:57:33' + ), + ( + 2, + 'store_owner', + 'api', + '2023-08-11 11:57:33', + '2023-08-11 11:57:33' + ), + ( + 3, + 'staff', + 'api', + '2023-08-11 11:57:33', + '2023-08-11 11:57:33' + ), + ( + 4, + 'customer', + 'api', + '2023-08-11 11:57:33', + '2023-08-11 11:57:33' + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/settings.sql b/packages/marvel/stubs/sql/chawkbazar/settings.sql new file mode 100644 index 0000000..6c0ffb6 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/settings.sql @@ -0,0 +1,2 @@ +INSERT INTO `settings` (`id`, `options`, `created_at`, `updated_at`) VALUES +(1, '{\"seo\": {\"ogImage\": [], \"ogTitle\": null, \"metaTags\": null, \"metaTitle\": null, \"canonicalUrl\": null, \"ogDescription\": null, \"twitterHandle\": null, \"metaDescription\": null, \"twitterCardType\": null}, \"logo\": {\"id\": 258, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/258/logo-final2x.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/258/conversions/logo-final2x-thumbnail.jpg\"}, \"currency\": \"USD\", \"taxClass\": 1, \"siteTitle\": \"ChawkBazar\", \"deliveryTime\": [{\"title\": \"Express Delivery\", \"description\": \"90 min express delivery\"}, {\"title\": \"Morning\", \"description\": \"8.00 AM - 11.00 AM\"}, {\"title\": \"Noon\", \"description\": \"11.00 AM - 2.00 PM\"}, {\"title\": \"Afternoon\", \"description\": \"2.00 PM - 5.00 PM\"}, {\"title\": \"Evening\", \"description\": \"5.00 PM - 8.00 PM\"}], \"signupPoints\": 100, \"siteSubtitle\": \"Your next ecommerce\", \"shippingClass\": 1, \"contactDetails\": {\"email\": \"admin@chawkbazar.demo\", \"contact\": \"+129290122122\", \"socials\": [{\"url\": \"https://www.facebook.com/\", \"icon\": \"FacebookIcon\", \"label\": \"Facebook\"}, {\"url\": \"https://twitter.com/\", \"icon\": \"TwitterIcon\", \"label\": \"Twitter\"}, {\"url\": \"https://instagram.com/\", \"icon\": \"InstagramIcon\", \"label\": \"Instagram\"}], \"website\": \"https://redq.io\", \"location\": {\"lat\": 42.9585979, \"lng\": -76.90872019999999, \"state\": \"NY\", \"country\": \"United States\", \"formattedAddress\": \"NY State Thruway, New York, USA\"}}, \"minimumOrderAmount\": 0, \"currencyToWalletRatio\": 3, \"maximumQuestionLimit\": 5, "useCashOnDelivery": true, \"freeShipping\": false,\"freeShippingAmount\": 0, "paymentGateway": "stripe"}', '2021-10-12 06:20:14', '2021-11-08 06:44:43'); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/shipping_classes.sql b/packages/marvel/stubs/sql/chawkbazar/shipping_classes.sql new file mode 100644 index 0000000..9040344 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/shipping_classes.sql @@ -0,0 +1,3 @@ +INSERT INTO `shipping_classes` (`id`, `name`, `amount`, `is_global`, `type`, `created_at`, `updated_at`) VALUES +(1, 'Global', 50, '1', 'fixed', '2021-10-25 05:06:16', '2021-10-25 05:06:16'), +(2, 'Free Shippping To USA', 3, '1', 'free_shipping', '2021-11-28 07:36:37', '2021-11-28 07:37:22'); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/shops.sql b/packages/marvel/stubs/sql/chawkbazar/shops.sql new file mode 100644 index 0000000..3d15ab5 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/shops.sql @@ -0,0 +1,180 @@ +INSERT INTO `shops` ( + `id`, + `owner_id`, + `name`, + `slug`, + `description`, + `cover_image`, + `logo`, + `is_active`, + `address`, + `settings`, + `notifications`, + `created_at`, + `updated_at` + ) +VALUES ( + 1, + 1, + 'Blythe Knowles', + 'chic-haven-boutique', + 'Iste dolor quaerat u', + '{\"id\": 9, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/9/Untitled-4.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/9/conversions/Untitled-4-thumbnail.jpg\"}', + '{\"thumbnail\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/333\\/conversions\\/logo04-thumbnail.jpg\",\"original\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/333\\/logo04.png\",\"id\":333,\"file_name\":\"logo04.png\"}', + 1, + '{\"country\":\"Expedita tempora occ\",\"city\":\"Nisi esse voluptate\",\"state\":\"Voluptas natus et re\",\"zip\":\"50848\",\"street_address\":\"Qui vel non sunt as\"}', + '{\"notifications\":[],\"contact\":\"2779888888888\",\"website\":\"https:\\/\\/www.wypiceky.me\",\"socials\":[],\"location\":[]}', + NULL, + '2021-10-09 16:24:30', + '2023-11-22 12:01:47' + ), + ( + 2, + 1, + 'Urban Threads Emporium', + 'urban-threads-emporium', + 'Elevate your urban style at Urban Threads Emporium.From streetwear essentials to statement pieces, our emporium offers a diverse range of contemporary fashion.Unleash your individuality with our carefully curated selection.', + '{\"id\": 16, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/16/Untitled-3.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/16/conversions/Untitled-3-thumbnail.jpg\"}', + '{\"id\": 15, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/15/fashion.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/15/conversions/fashion-thumbnail.jpg\"}', + 1, + '{\"zip\": \"02210\", \"city\": \"Boston\", \"state\": \"Massachusetts\", \"country\": \"USA\", \"street_address\": \"4360 Hampton Meadows\"}', + '{\"contact\": \"01236547852\", \"socials\": [], \"website\": null, \"location\": []}', + NULL, + '2021-10-09 16:57:34', + '2023-11-21 12:19:36' + ), + ( + 3, + 1, + 'Anthony Dudley', + 'velvet-vogue-closet', + 'Quod aliquid et mini', + '{\"thumbnail\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/338\\/conversions\\/shop-banner011-thumbnail.jpg\",\"original\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/338\\/shop-banner011.png\",\"id\":338,\"file_name\":\"shop-banner011.png\"}', + '{\"thumbnail\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/342\\/conversions\\/logo08-thumbnail.jpg\",\"original\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/342\\/logo08.png\",\"id\":342,\"file_name\":\"logo08.png\"}', + 1, + '{\"country\":\"Veniam inventore od\",\"city\":\"Laboris officiis sun\",\"state\":\"Reprehenderit ipsum\",\"zip\":\"96275\",\"street_address\":\"Necessitatibus quia\"}', + '{\"notifications\":[],\"contact\":\"214876556\",\"website\":\"https:\\/\\/www.ketyky.org.au\",\"socials\":[{\"icon\":\"InstagramIcon\",\"url\":\"Iusto illum dolor o\"}],\"location\":[]}', + NULL, + '2021-06-27 03:46:14', + '2023-11-22 12:04:56' + ), + ( + 4, + 1, + 'Boho Bliss Emporium', + 'boho-bliss-emporium', + 'The clothing shop is the best shop around the city. This is being run under the store owner and our aim is to provide quality product and hassle free customer service.', + '{\"id\": \"886\", \"original\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/884/Untitled-4.jpg\", \"thumbnail\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/884/conversions/Untitled-4-thumbnail.jpg\"}', + '{\"id\": \"896\", \"original\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/894/fashion.png\", \"thumbnail\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/894/conversions/fashion-thumbnail.jpg\"}', + 1, + '{\"country\":\"USA\",\"city\":\"Lincoln\",\"state\":\"Illinois\",\"zip\":\"62656\",\"street_address\":\"4885 Spring Street\"}', + '{\"notifications\":{\"email\":null},\"contact\":\"212901921221\",\"website\":\"https:\\/\\/redq.io\",\"socials\":[{\"icon\":\"FacebookIcon\",\"url\":\"https:\\/\\/www.facebook.com\\/\"}],\"location\":{\"lat\":40.1576691,\"lng\":-89.38529779999999,\"city\":\"Lincoln\",\"state\":\"IL\",\"country\":\"United States\",\"formattedAddress\":\"IL-121, Lincoln, IL, USA\"}}', + NULL, + '2021-06-27 03:47:10', + '2023-11-21 12:19:51' + ), + ( + 5, + 1, + 'Sleek Streetwear Co.', + 'sleek-streetwear-co', + 'Step into urban sophistication with Sleek Streetwear Co. Our curated collection blends street style with sleek design, offering a range of contemporary streetwear. Redefine your urban wardrobe with our stylish essentials.', + '{\"id\": \"889\", \"original\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/887/Untitled-1-%281%29.jpg\", \"thumbnail\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/887/conversions/Untitled-1-%281%29-thumbnail.jpg\"}', + '{\"id\": \"888\", \"original\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/886/Backpack.png\", \"thumbnail\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/886/conversions/Backpack-thumbnail.jpg\"}', + 1, + '{\"country\":\"USA\",\"city\":\"Michigan\",\"state\":\"Alabama\",\"zip\":\"35203\",\"street_address\":\"1740 Bedford Street\"}', + '{\"notifications\":{\"email\":null},\"contact\":\"212901921221\",\"website\":\"https:\\/\\/redq.io\",\"socials\":[{\"icon\":\"FacebookIcon\",\"url\":\"https:\\/\\/www.facebook.com\\/\"},{\"icon\":\"InstagramIcon\",\"url\":\"https:\\/\\/www.instagram.com\\/\"}],\"location\":{\"lat\":-37.1374024,\"lng\":174.9685924,\"zip\":\"2579\",\"city\":\"Ramarama\",\"state\":\"Auckland\",\"country\":\"New Zealand\",\"formattedAddress\":\"Waharau Lane, Ramarama 2579, New Zealand\"}}', + NULL, + '2021-06-27 03:47:23', + '2023-11-21 12:19:48' + ), + ( + 6, + 1, + 'Ethereal Essence Boutique', + 'ethereal-essence-boutique', + 'Discover ethereal beauty at Ethereal Essence Boutique. Our collection of exquisite designs and delicate silhouettes transports you to a realm of timeless elegance. Embrace the enchantment of fashion with our ethereal pieces.', + '{\"id\": \"890\", \"original\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/888/Untitled-3.jpg\", \"thumbnail\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/888/conversions/Untitled-3-thumbnail.jpg\"}', + '{\"id\": \"891\", \"original\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/889/Makeup.png\", \"thumbnail\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/889/conversions/Makeup-thumbnail.jpg\"}', + 1, + '{\"country\":\"USA\",\"city\":\"Metairie\",\"state\":\"Louisiana\",\"zip\":\"70001\",\"street_address\":\"2960 Rose Avenue\"}', + '{\"notifications\":{\"email\":null},\"contact\":\"7196321822\",\"website\":\"https:\\/\\/redq.io\",\"socials\":[{\"icon\":\"InstagramIcon\",\"url\":\"https:\\/\\/www.instagram.com\\/\"},{\"icon\":\"TwitterIcon\",\"url\":\"https:\\/\\/www.twitter.com\\/\"}],\"location\":{\"lat\":51.5176117,\"lng\":-0.210149,\"state\":\"England\",\"country\":\"United Kingdom\",\"formattedAddress\":\"Ladbroke Grove, London, UK\"}}', + NULL, + '2021-06-27 03:47:49', + '2023-11-21 12:19:46' + ), + ( + 7, + 1, + 'Xena Ochoa', + 'casual-comfort-corner', + 'Explicabo Aut aliqu', + '{\"thumbnail\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/336\\/conversions\\/shop-banner07-thumbnail.jpg\",\"original\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/336\\/shop-banner07.png\",\"id\":336,\"file_name\":\"shop-banner07.png\"}', + '{\"thumbnail\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/344\\/conversions\\/logo4-thumbnail.jpg\",\"original\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/344\\/logo4.png\",\"id\":344,\"file_name\":\"logo4.png\"}', + 1, + '{\"country\":\"Ipsam enim elit acc\",\"city\":\"Aut perferendis haru\",\"state\":\"Voluptatem consequat\",\"zip\":\"97375\",\"street_address\":\"Quod accusantium pra\"}', + '{\"notifications\":[],\"contact\":\"743000007766\",\"website\":\"https:\\/\\/www.wohykulomiqin.cc\",\"socials\":[{\"icon\":\"FacebookIcon\",\"url\":\"Ipsam delectus occa\"},{\"icon\":\"InstagramIcon\",\"url\":\"Culpa corrupti qui\"}],\"location\":[]}', + NULL, + '2021-06-27 03:48:11', + '2023-11-23 03:57:48' + ), + ( + 8, + 1, + 'Lavinia Burch', + 'velvet-vibes-emporium', + 'Qui eum dicta asperi', + '{\"thumbnail\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/334\\/conversions\\/shop-banner04-thumbnail.jpg\",\"original\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/334\\/shop-banner04.png\",\"id\":334,\"file_name\":\"shop-banner04.png\"}', + '{\"id\": \"893\", \"original\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/891/Group-36321.png\", \"thumbnail\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/891/conversions/Group-36321-thumbnail.jpg\"}', + 1, + '{\"country\":\"Sint totam inventor\",\"city\":\"Provident do in del\",\"state\":\"Adipisci aliquip odi\",\"zip\":\"49970\",\"street_address\":\"Sed dolores sit des\"}', + '{\"notifications\":{\"email\":null},\"contact\":\"7399999999999\",\"website\":\"https:\\/\\/www.nog.ca\",\"socials\":[{\"icon\":\"FacebookIcon\",\"url\":\"Incidunt commodo vi\"},{\"icon\":\"InstagramIcon\",\"url\":\"Illum ut molestias\"},{\"icon\":\"TwitterIcon\",\"url\":\"Fuga Voluptas et qu\"}],\"location\":[]}', + NULL, + '2021-06-27 03:48:23', + '2023-11-22 12:02:32' + ), + ( + 9, + 1, + 'Claire Miranda', + 'denim-delight-co', + 'Et consequatur sunt', + '{\"thumbnail\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/332\\/conversions\\/shop-banner03-thumbnail.jpg\",\"original\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/332\\/shop-banner03.png\",\"id\":332,\"file_name\":\"shop-banner03.png\"}', + '{\"id\": 1613, \"original\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/1613/Publisher-logo.png\", \"thumbnail\": \"https://pickbazarlaravel.s3.ap-southeast-1.amazonaws.com/1613/conversions/Publisher-logo-thumbnail.jpg\"}', + 1, + '{\"country\":\"Officiis consectetur\",\"city\":\"Et eveniet omnis ad\",\"state\":\"Nobis et asperiores\",\"zip\":\"72091\",\"street_address\":\"Eum quisquam irure m\"}', + '{\"notifications\":{\"email\":null},\"contact\":\"5799789787\",\"website\":\"https:\\/\\/www.bawiwomanor.org\",\"socials\":[],\"location\":[]}', + NULL, + '2021-12-07 16:47:07', + '2023-11-22 12:01:11' + ), + ( + 10, + 1, + 'Drake Cain', + 'quirk-and-charm-boutique', + 'Lorem sapiente accus', + '{\"thumbnail\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/1723\\/conversions\\/Gadget-banner-thumbnail.jpg\",\"original\":\"https:\\/\\/pickbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/1723\\/Gadget-banner.png\",\"id\":1723,\"file_name\":\"Gadget-banner.png\"}', + '{\"thumbnail\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/343\\/conversions\\/logo5-thumbnail.jpg\",\"original\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/343\\/logo5.png\",\"id\":343,\"file_name\":\"logo5.png\"}', + 1, + '{\"country\":\"Occaecat ut excepteu\",\"city\":\"Voluptatem amet po\",\"state\":\"Odio aut ea neque re\",\"zip\":\"22395\",\"street_address\":\"Voluptatem deleniti\"}', + '{\"notifications\":{\"email\":null},\"contact\":\"78298867\",\"website\":\"https:\\/\\/www.puk.biz\",\"socials\":[],\"location\":[]}', + NULL, + '2023-10-02 08:38:16', + '2023-11-23 03:56:51' + ), + ( + 11, + 1, + 'Marny Rose', + 'cozy-couture-corner', + 'Voluptatem odio qui', + '{\"thumbnail\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/329\\/conversions\\/shop-banner010-thumbnail.jpg\",\"original\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/329\\/shop-banner010.png\",\"id\":329,\"file_name\":\"shop-banner010.png\"}', + '{\"thumbnail\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/328\\/conversions\\/logo01-thumbnail.jpg\",\"original\":\"https:\\/\\/chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com\\/328\\/logo01.png\",\"id\":328,\"file_name\":\"logo01.png\"}', + 1, + '{\"country\":\"Quae qui dolore ea s\",\"city\":\"Laboris voluptatibus\",\"state\":\"Ut rerum necessitati\",\"zip\":\"25196\",\"street_address\":\"Quis eligendi aliqua\"}', + '{\"notifications\":{\"email\":null},\"contact\":\"53290798686\",\"website\":\"https:\\/\\/www.wajok.mobi\",\"socials\":[],\"location\":[]}', + NULL, + '2023-10-02 17:42:55', + '2023-11-22 11:59:01' + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/tags.sql b/packages/marvel/stubs/sql/chawkbazar/tags.sql new file mode 100644 index 0000000..57e3653 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/tags.sql @@ -0,0 +1,90 @@ +INSERT INTO `tags` ( + `id`, `name`, `slug`, `icon`, `image`, + `details`, `created_at`, `updated_at`, + `deleted_at` +) +VALUES + ( + 2, 'Sports', 'new-sports', NULL, '{\"id\": 17, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/17/chawkb.sports.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/17/conversions/chawkb.sports-thumbnail.jpg\"}', + NULL, '2021-10-09 17:17:51', '2021-10-09 17:17:51', + NULL + ), + ( + 4, 'Sunglass', 'exclusive-sunglasses', + NULL, '{\"id\": 20, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/20/chawkbsunglass.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/20/conversions/chawkbsunglass-thumbnail.jpg\"}', + NULL, '2021-10-09 17:21:17', '2021-10-09 17:21:17', + NULL + ), + ( + 5, 'Coupons', 'product-coupons', NULL, + '{\"id\": 21, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/21/chawkbcoupond.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/21/conversions/chawkbcoupond-thumbnail.jpg\"}', + NULL, '2021-10-09 17:21:38', '2021-10-09 19:19:47', + NULL + ), + ( + 6, 'Backpack', 'new-backpack', 'HandBags', + '{\"id\": 22, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/22/chawkbbackpack.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/22/conversions/chawkbbackpack-thumbnail.jpg\"}', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + '2021-10-09 17:21:58', '2021-11-29 06:01:58', + NULL + ), + ( + 7, 'Women\'s Collection', 'womens-collection', + 'WomenDress', '{\"id\": 23, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/23/chawkbwomen.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/23/conversions/chawkbwomen-thumbnail.jpg\"}', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + '2021-10-09 17:22:18', '2021-11-29 06:02:04', + NULL + ), + ( + 8, 'Men\'s Collection', 'mens-collection', + 'Pants', '{\"id\": 25, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/25/Banner-5.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/25/conversions/Banner-5-thumbnail.jpg\"}', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + '2021-10-09 17:24:03', '2021-11-29 06:02:09', + NULL + ), + ( + 9, 'Flash Sale', 'flash-sale', 'Accessories', + '[]', 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + '2021-10-09 17:26:01', '2021-11-29 06:02:13', + NULL + ), + ( + 10, 'Featured Products', 'featured-products', + 'Accessories', '[]', 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + '2021-10-09 17:41:16', '2021-11-29 06:02:22', + NULL + ), + ( + 11, 'Kids Collection', 'kids-collection', + 'Skirts', '{\"id\": 34, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/34/banner-mobile-3.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/34/conversions/banner-mobile-3-thumbnail.jpg\"}', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + '2021-10-09 17:52:56', '2021-11-29 06:02:30', + NULL + ), + ( + 12, 'Winter Collection', 'winter-collection', + 'Accessories', '{\"id\": 35, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/35/banner-1.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/35/conversions/banner-1-thumbnail.jpg\"}', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + '2021-10-09 17:53:38', '2021-11-29 06:02:33', + NULL + ), + ( + 13, 'Gift Collection', 'gift-collection', + 'ShoulderBags', '{\"id\": 36, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/36/banner-2.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/36/conversions/banner-2-thumbnail.jpg\"}', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + '2021-10-09 17:54:07', '2021-11-29 06:02:43', + NULL + ), + ( + 14, 'Winter Offer', 'winter-offer', + 'Accessories', '{\"id\": 37, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/37/banner-3.jpg\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/37/conversions/banner-3-thumbnail.jpg\"}', + 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + '2021-10-09 17:54:24', '2021-11-29 06:02:47', + NULL + ), + ( + 15, 'On Sale', 'on-sale', 'Accessories', + '[]', 'A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.', + '2021-10-26 07:24:07', '2021-11-29 06:02:50', + NULL + ); diff --git a/packages/marvel/stubs/sql/chawkbazar/tax_classes.sql b/packages/marvel/stubs/sql/chawkbazar/tax_classes.sql new file mode 100644 index 0000000..2a1fe1e --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/tax_classes.sql @@ -0,0 +1,3 @@ +INSERT INTO `tax_classes` (`id`, `country`, `state`, `zip`, `city`, `rate`, `name`, `is_global`, `priority`, `on_shipping`, `created_at`, `updated_at`) VALUES +(1, 'United States', 'ny', '10001', 'ny', 2, 'Global', NULL, NULL, 1, '2021-10-25 05:05:58', '2021-11-28 07:25:09'), +(2, 'USA', 'NY', '1001', 'NY', 5, 'USA Tax', NULL, NULL, 1, '2021-11-28 07:38:04', '2021-11-28 07:38:04'); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/terms_and_conditions.sql b/packages/marvel/stubs/sql/chawkbazar/terms_and_conditions.sql new file mode 100644 index 0000000..a51f520 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/terms_and_conditions.sql @@ -0,0 +1,225 @@ +INSERT INTO `terms_and_conditions` ( + `id`, + `user_id`, + `shop_id`, + `title`, + `slug`, + `description`, + `type`, + `issued_by`, + `is_approved`, + `language`, + `deleted_at`, + `created_at`, + `updated_at` + ) +VALUES ( + 6, + 6, + 11, + 'Two driven jocks help fax my big quiz.', + 'two-driven-jocks-help-fax-my-big-quiz', + '

Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.

', + 'shop', + 'Marny Rose', + 1, + 'en', + NULL, + '2024-01-14 04:20:03', + '2024-01-14 04:33:42' + ), + ( + 7, + 6, + 11, + 'The bedding was hardly', + 'the-bedding-was-hardly-able-to-cover', + '

A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame.

', + 'shop', + 'Marny Rose', + 1, + 'en', + NULL, + '2024-01-14 04:34:16', + '2024-01-14 04:34:38' + ), + ( + 8, + 6, + 11, + 'A small river named Duden', + 'a-small-river-named-duden', + '

When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek, then

', + 'shop', + 'Marny Rose', + 1, + 'en', + NULL, + '2024-01-14 04:35:11', + '2024-01-14 04:35:17' + ), + ( + 9, + 6, + 10, + 'Lorem ipsum dolor sit amet', + 'lorem-ipsum-dolor-sit-amet', + '

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Aenean commodo ligula eget dolor. Aenean massa.

Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.

Nulla consequat massa quis enim.

Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.

In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.

Nullam dictum felis eu pede mollis pretium.

Integer tincidunt. Cras dapibus.

Vivamus elementum semper nisi. Aenean vulputate eleifend tellus.

Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim.

Aliquam lorem ante, dapibus in, viverra quis, feugiat a,

', + 'shop', + 'Drake Cain', + 1, + 'en', + NULL, + '2024-01-14 05:37:41', + '2024-01-14 11:58:32' + ), + ( + 10, + 6, + 9, + 'Nemo enim ipsam voluptatem quia', + 'nemo-enim-ipsam-voluptatem-quia', + '

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.

Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.

Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex

', + 'shop', + 'Claire Miranda', + 1, + 'en', + NULL, + '2024-01-14 05:38:26', + '2024-01-14 11:58:42' + ), + ( + 11, + 6, + 2, + 'To take a trivial example', + 'to-take-a-trivial-example', + '

But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness.

No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful.

Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure.

To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it?

But who has any right to find fault with a man who chooses to enjoy a pleasure

', + 'shop', + 'Urban Threads Emporium', + 1, + 'en', + NULL, + '2024-01-14 05:39:03', + '2024-01-14 11:58:53' + ), + ( + 12, + 6, + 1, + 'Lor separat existentie es un myth.', + 'lor-separat-existentie-es-un-myth', + '

Li Europan lingues es membres del sam familie.

Lor separat existentie es un myth.

Por scientie, musica, sport etc, litot Europa usa li sam vocabular.

Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules.

Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores.

At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.

Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues.

Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues.

It va esser tam simplic quam Occidental in fact, it va esser Occidental.

A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es.

Li Europan lingues es membres del sam familie.

Lor separat existentie es un myth.

Por scientie, musica,

', + 'shop', + 'Blythe Knowles', + 1, + 'en', + NULL, + '2024-01-14 05:39:34', + '2024-01-14 12:00:56' + ), + ( + 13, + 6, + 8, + 'Their separate existence is a myth.', + 'their-separate-existence-is-a-myth', + '

The European languages are members of the same family.

Their separate existence is a myth.

For science, music, sport, etc, Europe uses the same vocabulary.

The languages only differ in their grammar, their pronunciation and their most common words.

Everyone realizes why a new common language would be desirable: one could refuse to pay expensive translators.

To achieve this, it would be necessary to have uniform grammar, pronunciation and more common words.

If several languages coalesce, the grammar of the resulting language is more simple and regular than that of the individual languages.

The new common language will be more simple and regular than the existing European languages.

It will be as simple as Occidental; in fact, it will be Occidental.

To an English person, it will seem like simplified English, as a skeptical Cambridge friend of mine told me what Occidental is.

The European languages are members of the

', + 'shop', + 'Lavinia Burch', + 1, + 'en', + NULL, + '2024-01-14 05:41:25', + '2024-01-14 12:00:26' + ), + ( + 14, + 6, + 7, + 'It is a paradisematic country', + 'it-is-a-paradisematic-country', + '

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.

A small river named Duden flows by their place and supplies it with the necessary regelialia.

It is a paradisematic country, in which roasted parts of sentences fly into your mouth.

Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar.

The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen.

She packed her seven versalia, put her initial into the belt and made herself

', + 'shop', + 'Xena Ochoa', + 1, + 'en', + NULL, + '2024-01-14 05:42:00', + '2024-01-14 12:00:12' + ), + ( + 15, + 6, + 6, + 'I am alone, and feel the charm', + 'i-am-alone-and-feel-the-charm', + '

A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart.

I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.

I am so happy, my dear friend, so absorbed in the exquisite sense of mere tranquil existence, that I neglect my talents.

I should be incapable of drawing a single stroke at the present moment; and yet I feel that I never was a greater artist than now.

When, while the lovely valley teems with vapour around me, and the meridian sun strikes the upper surface of the impenetrable foliage of my trees, and but a few stray gleams steal into the inner sanctuary, I throw myself down among the tall grass by the trickling stream; and, as I lie close to the earth, a

', + 'shop', + 'Ethereal Essence Boutique', + 1, + 'en', + NULL, + '2024-01-14 05:42:31', + '2024-01-14 11:59:59' + ), + ( + 16, + 6, + 5, + 'The bedding was hardly able', + 'the-bedding-was-hardly-able', + '

One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin.

He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections.

The bedding was hardly able to cover it and seemed ready to slide off any moment.

His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked.

\"What\'s happened to me?

\" he thought. It wasn\'t a dream.

His room, a proper human room although a little too small, lay peacefully between its four familiar walls.

A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed

', + 'shop', + 'Sleek Streetwear Co.', + 1, + 'en', + NULL, + '2024-01-14 05:42:58', + '2024-01-14 11:59:48' + ), + ( + 17, + 6, + 4, + 'The quick, brown fox jumps over a lazy dog.', + 'the-quick-brown-fox-jumps-over-a-lazy-dog', + '

The quick, brown fox jumps over a lazy dog.

DJs flock by when MTV ax quiz prog.

Junk MTV quiz graced by fox whelps.

Bawds jog, flick quartz, vex nymphs.

Waltz, bad nymph, for quick jigs vex!

Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox.

Bright vixens jump; dozy fowl quack.

Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim.

Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.

Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs!

\"Now fax quiz Jack! \" my brave ghost pled.

Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W.

zaps Iraq. Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls.

Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig,

', + 'shop', + 'Boho Bliss Emporium', + 1, + 'en', + NULL, + '2024-01-14 05:43:36', + '2024-01-14 11:59:35' + ), + ( + 18, + 1, + NULL, + 'The Big Oxmox advised her', + 'the-big-oxmox-advised-her', + 'The Website is provided \"as is\" and \"as available\" without any warranties, either expressed or implied. Pickbazar shall not be liable for any direct, indirect, incidental, special, consequential, or punitive damages resulting from the use or inability to use the Website.', + 'global', + 'Super Admin', + 1, + 'en', + NULL, + '2024-01-14 11:52:22', + NULL + ), + ( + 23, + 1, + NULL, + 'Five quacking zephyrs jolt my', + 'five-quacking-zephyrs-jolt-my', + '

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.

A small river named Duden flows by their place and supplies it with the necessary regelialia.

It is a paradisematic country, in which roasted parts of sentences fly into your mouth.

Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar.

The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen.

She packed her seven versalia, put her initial into the belt and made herself

', + 'global', + 'Super Admin', + 1, + 'en', + NULL, + '2024-01-14 18:04:26', + '2024-01-14 18:12:29' + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/types.sql b/packages/marvel/stubs/sql/chawkbazar/types.sql new file mode 100644 index 0000000..09f0913 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/types.sql @@ -0,0 +1,17 @@ +INSERT INTO `types` (`id`, `name`, `settings`, `slug`, `icon`, `promotional_sliders`, `images`, `created_at`, `updated_at`) VALUES +(1, 'Fusion', '[]', 'fusion', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 41, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/41/adidas.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/41/conversions/adidas-thumbnail.jpg\"}, {\"id\": 42, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/42/fustion.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/42/conversions/fustion-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 284, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/284/Group-36184.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/284/conversions/Group-36184-thumbnail.jpg\"}]}]', '2021-10-10 13:31:55', '2021-11-29 05:59:03'), +(2, 'Vintgae', '[]', 'vintgae', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 43, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/43/puma-logo.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/43/conversions/puma-logo-thumbnail.jpg\"}, {\"id\": 44, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/44/vintege.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/44/conversions/vintege-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 285, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/285/Group-36183.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/285/conversions/Group-36183-thumbnail.jpg\"}]}]', '2021-10-10 13:50:14', '2021-11-29 05:58:59'), +(3, 'Masteriod', '[]', 'masteriod', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 45, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/45/dior.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/45/conversions/dior-thumbnail.jpg\"}, {\"id\": 46, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/46/logo3.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/46/conversions/logo3-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 286, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/286/Group-36186.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/286/conversions/Group-36186-thumbnail.jpg\"}]}]', '2021-10-10 13:50:57', '2021-11-29 05:58:56'), +(4, 'Hoppister', '[]', 'hoppister', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 47, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/47/levi-s.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/47/conversions/levi-s-thumbnail.jpg\"}, {\"id\": 48, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/48/logo4.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/48/conversions/logo4-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 287, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/287/Group-36185.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/287/conversions/Group-36185-thumbnail.jpg\"}]}]', '2021-10-10 13:51:31', '2021-11-29 05:58:53'), +(5, 'Klien Shoes', '[]', 'klien-shoes', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 53, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/53/Calvin-klein.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/53/conversions/Calvin-klein-thumbnail.jpg\"}, {\"id\": 54, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/54/logo5.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/54/conversions/logo5-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 288, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/288/Group-36182.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/288/conversions/Group-36182-thumbnail.jpg\"}]}]', '2021-10-10 13:56:53', '2021-11-29 05:58:49'), +(6, 'Ceseare', '[]', 'ceseare', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 55, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/55/tissot.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/55/conversions/tissot-thumbnail.jpg\"}, {\"id\": 56, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/56/logo6.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/56/conversions/logo6-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 289, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/289/Group-36181.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/289/conversions/Group-36181-thumbnail.jpg\"}]}]', '2021-10-10 13:57:58', '2021-11-29 05:58:45'), +(7, 'AB Shoes', '[]', 'ab-shoes', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 57, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/57/nike.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/57/conversions/nike-thumbnail.jpg\"}, {\"id\": 58, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/58/logo7.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/58/conversions/logo7-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 283, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/283/Group-36180.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/283/conversions/Group-36180-thumbnail.jpg\"}]}]', '2021-10-10 13:58:30', '2021-11-29 05:58:41'), +(8, 'Phonix Bags', '[]', 'phonix-bags', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 59, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/59/herschel.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/59/conversions/herschel-thumbnail.jpg\"}, {\"id\": 60, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/60/logo8.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/60/conversions/logo8-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 282, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/282/Group-36179.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/282/conversions/Group-36179-thumbnail.jpg\"}]}]', '2021-10-10 13:59:04', '2021-11-29 05:58:37'), +(9, 'Hipster', '[]', 'hipster', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 61, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/61/Hollister.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/61/conversions/Hollister-thumbnail.jpg\"}, {\"id\": 62, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/62/logo4.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/62/conversions/logo4-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 281, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/281/shovia.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/281/conversions/shovia-thumbnail.jpg\"}]}]', '2021-10-10 13:59:33', '2021-11-29 05:58:33'), +(10, 'Fania Fashion', '[]', 'fania-fashion', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 63, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/63/zara.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/63/conversions/zara-thumbnail.jpg\"}, {\"id\": 64, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/64/logo10.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/64/conversions/logo10-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 291, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/291/hunter-shoes.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/291/conversions/hunter-shoes-thumbnail.jpg\"}]}]', '2021-10-10 14:00:19', '2021-11-29 05:58:29'), +(11, 'Hairstore VIntage', '[]', 'hairstore-vintage', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 66, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/66/gucci.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/66/conversions/gucci-thumbnail.jpg\"}, {\"id\": 67, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/67/logo11.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/67/conversions/logo11-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 276, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/276/hoppister.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/276/conversions/hoppister-thumbnail.jpg\"}]}]', '2021-10-10 14:01:33', '2021-11-29 05:58:25'), +(12, 'T Fashion', '[]', 't-fashion', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 68, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/68/under-armour.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/68/conversions/under-armour-thumbnail.jpg\"}, {\"id\": 69, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/69/logo12.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/69/conversions/logo12-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 275, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/275/fusion.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/275/conversions/fusion-thumbnail.jpg\"}]}]', '2021-10-10 14:02:00', '2021-11-29 05:58:22'), +(13, 'Vintage Design', '[]', 'vintage-design', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 70, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/70/emporio-armani.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/70/conversions/emporio-armani-thumbnail.jpg\"}, {\"id\": 71, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/71/vintege.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/71/conversions/vintege-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 274, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/274/fashadil.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/274/conversions/fashadil-thumbnail.jpg\"}]}]', '2021-10-10 14:03:01', '2021-11-29 05:58:18'), +(14, 'Vint Shoes', '[]', 'vint-shoes', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 72, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/72/converse.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/72/conversions/converse-thumbnail.jpg\"}, {\"id\": 73, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/73/logo14.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/73/conversions/logo14-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 273, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/273/elegance.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/273/conversions/elegance-thumbnail.jpg\"}]}]', '2021-10-10 14:03:38', '2021-11-29 05:58:14'), +(15, 'Roseban', '[]', 'roseban', 'DressIcon', NULL, '[{\"key\": \"grid-layout\", \"image\": [{\"id\": 74, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/74/ray-ban.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/74/conversions/ray-ban-thumbnail.jpg\"}, {\"id\": 75, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/75/logo15.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/75/conversions/logo15-thumbnail.jpg\"}]}, {\"key\": \"slider-layout\", \"image\": [{\"id\": 272, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/272/club-shoes.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/272/conversions/club-shoes-thumbnail.jpg\"}]}]', '2021-10-10 14:04:02', '2021-11-29 05:58:10'), +(16, 'HM trades', '[]', 'hm-trades', 'DressIcon', NULL, '[{\"key\": \"slider-layout\", \"image\": [{\"id\": 290, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/290/blaze-fashion.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/290/conversions/blaze-fashion-thumbnail.jpg\"}]}, {\"key\": \"grid-layout\", \"image\": [{\"id\": 269, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/269/h%26m.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/269/conversions/h%26m-thumbnail.jpg\"}, {\"id\": 271, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/271/logo16.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/271/conversions/logo16-thumbnail.jpg\"}]}]', '2021-10-10 14:04:29', '2021-11-29 05:57:37'); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/user_profiles.sql b/packages/marvel/stubs/sql/chawkbazar/user_profiles.sql new file mode 100644 index 0000000..5618701 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/user_profiles.sql @@ -0,0 +1,30 @@ +INSERT INTO `user_profiles` ( + `id`, + `avatar`, + `bio`, + `socials`, + `contact`, + `customer_id`, + `created_at`, + `updated_at` + ) +VALUES ( + 2, + '{\"id\": 297, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/297/store_owner.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/297/conversions/store_owner-thumbnail.jpg\"}', + 'This is the store owner and we have 6 shops under our banner. We are running all the shops to give our customers hassle-free service and quality products. Our goal is to provide best possible customer service and products for our clients', + NULL, + '12365141641631', + 1, + '2021-08-18 13:17:53', + '2021-11-25 06:21:29' + ), + ( + 3, + '{\"id\": 326, \"original\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/326/man.png\", \"thumbnail\": \"https://chawkbazarlaravel.s3.ap-southeast-1.amazonaws.com/326/conversions/man-thumbnail.jpg\"}', + '', + NULL, + '19365141641631', + 3, + '2021-08-18 13:17:53', + '2021-08-18 13:17:53' + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/users.sql b/packages/marvel/stubs/sql/chawkbazar/users.sql new file mode 100644 index 0000000..968033a --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/users.sql @@ -0,0 +1,60 @@ +INSERT INTO `users` ( + `id`, + `name`, + `email`, + `email_verified_at`, + `password`, + `remember_token`, + `created_at`, + `updated_at`, + `is_active`, + `shop_id` + ) +VALUES ( + 1, + 'Shop Owner', + 'vendor@demo.com', + NULL, + '$2y$10$5l2e.NYkxAHFeZWMOqvFoew6GjT0/0bB42wukw3I1l.trTbN951kW', + NULL, + '2021-10-09 16:39:49', + '2021-11-25 06:21:22', + 1, + NULL + ), + ( + 3, + 'Customer', + 'customer@demo.com', + NULL, + '$2y$10$DeU1iilF9mg/BBqypizpZ.ysFjuIoHHIycxHmZrAvqTasTErs3P8G', + NULL, + '2021-11-25 06:22:18', + '2021-11-25 06:22:18', + 1, + NULL + ), + ( + 4, + 'customer2', + 'customer2@demo.com', + NULL, + '$2y$10$UVs.WftC2iIdLQsHz9Tbdu7OmUXG3P7wyjHvJqCunyJ7JE8ekyXr.', + NULL, + '2022-03-17 14:15:08', + '2022-03-17 14:15:08', + 1, + NULL + ), + ( + 5, + 'customer3', + 'customer3@demo.com', + NULL, + '$2y$10$UVs.WftC2iIdLQsHz9Tbdu7OmUXG3P7wyjHvJqCunyJ7JE8ekyXr.', + NULL, + '2022-03-17 16:25:39', + '2022-03-17 16:25:39', + 1, + NULL + ); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/variation_options.sql b/packages/marvel/stubs/sql/chawkbazar/variation_options.sql new file mode 100644 index 0000000..8aeb3df --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/variation_options.sql @@ -0,0 +1,101 @@ +INSERT INTO `variation_options` (`id`, `title`, `price`, `sale_price`, `quantity`, `is_disable`, `sku`, `options`, `product_id`, `created_at`, `updated_at`) VALUES +(1, 'Red', 25, 20, 500, 0, '156156654g654sf64', '[{\"name\": \"Color\", \"value\": \"Red\"}]', 1, '2021-10-10 15:08:54', '2021-12-14 08:05:17'), +(2, 'Blue', 25, 20, 500, 0, 'a5da6546afa', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 1, '2021-10-10 15:08:54', '2021-12-14 08:05:17'), +(14, 'Blue', 100, 80, 500, 0, '89456413', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 5, '2021-10-10 19:31:40', '2021-12-14 08:06:49'), +(15, 'Yellow', 100, 80, 500, 0, 'fdsgdfbdfsndhjkdfm', '[{\"name\": \"Color\", \"value\": \"Yellow\"}]', 5, '2021-10-10 19:31:40', '2021-12-14 08:06:49'), +(18, 'Yellow/Medium', 100, 80, 500, 0, '8964bdfhtzvcb', '[{\"name\": \"Color\", \"value\": \"Yellow\"}, {\"name\": \"Size\", \"value\": \"Medium\"}]', 5, '2021-10-10 19:31:40', '2021-10-10 21:54:50'), +(36, 'Red', 800, 750, 500, 0, '750755054654', '[{\"name\": \"Color\", \"value\": \"Red\"}]', 17, '2021-10-11 14:30:59', '2021-12-14 08:12:25'), +(37, 'Blue', 800, 750, 500, 0, '569874/*9', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 17, '2021-10-11 14:30:59', '2021-12-14 08:12:25'), +(40, 'Red', 30, 22, 500, 0, '9s874bd6515v', '[{\"name\": \"Color\", \"value\": \"Red\"}]', 20, '2021-10-11 14:39:30', '2021-12-14 08:15:29'), +(41, 'Blue', 30, 22, 500, 0, 'hs8456dfs+54sdfa6', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 20, '2021-10-11 14:39:30', '2021-12-14 08:15:29'), +(42, 'Yellow', 30, 22, 500, 0, 'd8g4a5fd6g4df564gdf', '[{\"name\": \"Color\", \"value\": \"Yellow\"}]', 20, '2021-10-11 14:39:30', '2021-12-14 08:15:29'), +(43, 'Red', 40, 18, 500, 0, '484512', '[{\"name\": \"Color\", \"value\": \"Red\"}]', 21, '2021-10-11 14:41:08', '2021-12-14 08:15:43'), +(44, 'Blue', 40, 25, 500, 0, '984fa5s6d1', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 21, '2021-10-11 14:41:08', '2021-12-14 08:15:43'), +(46, 'Red', 35, 30, 500, 0, '561s156sd1', '[{\"name\": \"Color\", \"value\": \"Red\"}]', 22, '2021-10-11 14:42:33', '2021-12-14 08:15:50'), +(47, 'Blue', 35, 30, 500, 0, '516as651f56sd1+', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 22, '2021-10-11 14:42:33', '2021-12-14 08:15:50'), +(48, 'Yellow', 35, 30, 500, 0, '56sa1fg5sdf156asd1f+', '[{\"name\": \"Color\", \"value\": \"Yellow\"}]', 22, '2021-10-11 14:42:33', '2021-12-14 08:15:50'), +(49, 'Red', 50, 40, 500, 0, '894a8sfd6598', '[{\"name\": \"Color\", \"value\": \"Red\"}]', 23, '2021-10-11 14:44:01', '2021-12-14 08:15:58'), +(50, 'Blue', 50, 40, 500, 0, '56a45sda64fas+', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 23, '2021-10-11 14:44:01', '2021-12-14 08:15:58'), +(51, 'Yellow', 50, 40, 500, 0, 'asd54f5s4afasd654', '[{\"name\": \"Color\", \"value\": \"Yellow\"}]', 23, '2021-10-11 14:44:01', '2021-12-14 08:15:58'), +(52, 'Red', 80, 75, 500, 0, '844f84sd8a++++', '[{\"name\": \"Color\", \"value\": \"Red\"}]', 24, '2021-10-11 14:45:37', '2021-12-14 08:16:05'), +(53, 'Blue', 80, 75, 500, 0, '5fa45sda4f56asdf+++', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 24, '2021-10-11 14:45:37', '2021-12-14 08:16:05'), +(54, 'Yellow', 80, 75, 500, 0, 's54fs64fsda564fsg894ga++++', '[{\"name\": \"Color\", \"value\": \"Yellow\"}]', 24, '2021-10-11 14:45:37', '2021-12-14 08:16:05'), +(55, '7', 50, 45, 500, 0, '56848+4+', '[{\"name\": \"Size\", \"value\": \"7\"}]', 25, '2021-10-23 13:40:16', '2021-12-14 08:16:14'), +(56, '8', 50, 45, 500, 0, '8514684156+++', '[{\"name\": \"Size\", \"value\": \"8\"}]', 25, '2021-10-23 13:40:16', '2021-12-14 08:16:14'), +(57, '9', 50, 45, 500, 0, '65afdss', '[{\"name\": \"Size\", \"value\": \"9\"}]', 25, '2021-10-23 13:40:16', '2021-12-14 08:16:14'), +(58, '10', 50, 45, 500, 0, '6541651+51651', '[{\"name\": \"Size\", \"value\": \"10\"}]', 25, '2021-10-23 13:40:16', '2021-12-14 08:16:14'), +(59, '7', 200, 180, 500, 0, '51d654sd65g4d65', '[{\"name\": \"Size\", \"value\": \"7\"}]', 27, '2021-10-23 13:50:44', '2021-12-14 08:16:30'), +(60, '8', 200, 180, 500, 0, 'asdfsdgasd4g56465', '[{\"name\": \"Size\", \"value\": \"8\"}]', 27, '2021-10-23 13:50:44', '2021-12-14 08:16:30'), +(61, '9', 200, 180, 500, 0, 'fadsfsda4a56', '[{\"name\": \"Size\", \"value\": \"9\"}]', 27, '2021-10-23 13:50:44', '2021-12-14 08:16:30'), +(62, '10', 200, 180, 500, 0, '5a165sdf56a4', '[{\"name\": \"Size\", \"value\": \"10\"}]', 27, '2021-10-23 13:50:44', '2021-12-14 08:16:30'), +(63, 'Red', 800, 500, 150, 0, 'asdasd3423432sdasdad', '[{\"name\": \"Color\", \"value\": \"Red\"}]', 29, '2021-10-23 20:07:58', '2021-12-14 08:16:45'), +(64, 'Yellow', 850, 550, 100, 0, 'asdasd3244234546nghjghj', '[{\"name\": \"Color\", \"value\": \"Yellow\"}]', 29, '2021-10-23 20:07:58', '2021-12-14 08:16:45'), +(65, 'Blue', 900, 600, 50, 0, 'hfghty7676yfghf', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 29, '2021-10-23 20:07:58', '2021-12-14 08:16:45'), +(74, '7', 2000, 1800, 150, 0, 'vcvcgd64564tgdfgdfgdf', '[{\"name\": \"Size\", \"value\": \"7\"}]', 31, '2021-10-23 20:18:14', '2021-12-14 08:16:58'), +(75, 'Red', 1000, 900, 100, 0, 'wdwqe324234fsfsfs', '[{\"name\": \"Color\", \"value\": \"Red\"}]', 33, '2021-10-23 20:57:31', '2021-12-14 08:17:10'), +(76, 'Blue', 1000, 899, 100, 0, 'sadasda897989879asda', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 33, '2021-10-23 20:57:31', '2021-12-14 08:17:10'), +(78, 'Small', 400, 350, 100, 0, 'sdfsdr34354fddsfs', '[{\"name\": \"Size\", \"value\": \"Small\"}]', 35, '2021-10-23 21:14:03', '2021-12-14 08:17:20'), +(81, 'Red', 1150, 950, 100, 0, 'czczc32423dadasda', '[{\"name\": \"Color\", \"value\": \"Red\"}]', 41, '2021-10-23 21:30:19', '2021-12-14 08:19:40'), +(82, 'Blue', 1150, 950, 98, 0, 'fgergtert544tffd', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 41, '2021-10-23 21:30:19', '2021-12-14 08:19:40'), +(83, '7', 260, 250, 100, 0, 'sfsdf3423dsfdsfsaf', '[{\"name\": \"Size\", \"value\": \"7\"}]', 42, '2021-10-23 21:33:38', '2021-12-14 08:19:34'), +(84, '8', 260, 250, 100, 0, 'dsfsdf435dsdfasd', '[{\"name\": \"Size\", \"value\": \"8\"}]', 42, '2021-10-23 21:33:38', '2021-12-14 08:19:34'), +(85, 'Small', 90, 75, 100, 0, 'fdger543rfsds', '[{\"name\": \"Size\", \"value\": \"Small\"}]', 43, '2021-10-23 21:36:54', '2021-12-14 08:19:28'), +(86, 'Medium', 90, 75, 100, 0, 'asdasd343232dsasd', '[{\"name\": \"Size\", \"value\": \"Medium\"}]', 43, '2021-10-23 21:36:54', '2021-12-14 08:19:28'), +(87, '7', 180, 160, 50, 0, 'gfdgd454sdfsdfs', '[{\"name\": \"Size\", \"value\": \"7\"}]', 46, '2021-10-23 21:49:36', '2021-12-14 08:19:13'), +(88, '8', 180, 160, 50, 0, 'gjgyt565hfghfgh', '[{\"name\": \"Size\", \"value\": \"8\"}]', 46, '2021-10-23 21:49:36', '2021-12-14 08:19:13'), +(89, '9', 180, 160, 50, 0, 'fddg546fgdfgd', '[{\"name\": \"Size\", \"value\": \"9\"}]', 46, '2021-10-23 21:49:36', '2021-12-14 08:19:13'), +(90, 'Medium', 120, 100, 50, 0, 'hgjgh565etgdfgd', '[{\"name\": \"Size\", \"value\": \"Medium\"}]', 47, '2021-10-23 21:53:15', '2021-12-14 08:19:07'), +(91, 'Large', 120, 100, 50, 0, 'kghjgh5464dfssf', '[{\"name\": \"Size\", \"value\": \"Large\"}]', 47, '2021-10-23 21:53:15', '2021-12-14 08:19:07'), +(92, 'Small', 35, 30, 50, 0, 'fhhf6565gbcvbvc', '[{\"name\": \"Size\", \"value\": \"Small\"}]', 50, '2021-10-23 22:03:36', '2021-12-14 08:18:51'), +(93, 'Medium', 35, 30, 50, 0, 'hvhjghj7756tgfdgdf', '[{\"name\": \"Size\", \"value\": \"Medium\"}]', 50, '2021-10-23 22:03:36', '2021-12-14 08:18:51'), +(94, 'Blue', 200, 150, 50, 0, 'ghjgy654645ygfhfg', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 53, '2021-10-23 22:12:41', '2021-12-14 08:18:36'), +(95, 'Yellow', 200, 150, 50, 0, 'vdfdvfdv786876dsasd', '[{\"name\": \"Color\", \"value\": \"Yellow\"}]', 53, '2021-10-23 22:12:41', '2021-12-14 08:18:36'), +(98, 'Small', 40, 35, 80, 0, 'sfsdfsy786sdfsd', '[{\"name\": \"Size\", \"value\": \"Small\"}]', 55, '2021-10-23 22:18:00', '2021-12-14 08:18:27'), +(99, 'Small', 100, 90, 120, 0, 'ghfh5645tgdfd', '[{\"name\": \"Size\", \"value\": \"Small\"}]', 57, '2021-10-23 22:22:38', '2021-12-14 08:18:15'), +(100, 'Medium', 100, 90, 120, 0, 'kjhk4564dfgfd', '[{\"name\": \"Size\", \"value\": \"Medium\"}]', 57, '2021-10-23 22:22:38', '2021-12-14 08:18:15'), +(101, '7', 250, 220, 500, 0, '8s4f6sdg8d45', '[{\"name\": \"Size\", \"value\": \"7\"}]', 49, '2021-10-24 07:10:20', '2021-12-14 08:18:57'), +(102, '8', 250, 220, 500, 0, '8dgsdf566', '[{\"name\": \"Size\", \"value\": \"8\"}]', 49, '2021-10-24 07:10:20', '2021-12-14 08:18:57'), +(103, '9', 250, 220, 500, 0, '4dsa6f4af5asd', '[{\"name\": \"Size\", \"value\": \"9\"}]', 49, '2021-10-24 07:10:20', '2021-12-14 08:18:57'), +(104, '10', 250, 220, 500, 0, 'f65a4sd56f4g8a4', '[{\"name\": \"Size\", \"value\": \"10\"}]', 49, '2021-10-24 07:10:20', '2021-12-14 08:18:57'), +(108, 'Large', 100, 80, 500, 0, '56sdf1g65151', '[{\"name\": \"Size\", \"value\": \"Large\"}]', 57, '2021-11-28 12:13:10', '2021-12-14 08:18:15'), +(109, 'Medium', 40, 30, 500, 0, '515xcz1v8d4ga489', '[{\"name\": \"Size\", \"value\": \"Medium\"}]', 55, '2021-11-28 12:14:10', '2021-12-14 08:18:27'), +(110, 'Large', 40, 10, 500, 0, 'ds5g4fd84gdr84b', '[{\"name\": \"Size\", \"value\": \"Large\"}]', 55, '2021-11-28 12:14:10', '2021-12-14 08:18:27'), +(112, '10', 180, 160, 500, 0, 's4f6sda84ds8951', '[{\"name\": \"Size\", \"value\": \"10\"}]', 46, '2021-11-28 12:41:02', '2021-12-14 08:19:13'), +(113, 'Large', 90, 75, 500, 0, 'tr7gs14x2.35+65v2', '[{\"name\": \"Size\", \"value\": \"Large\"}]', 43, '2021-11-28 12:41:28', '2021-12-14 08:19:28'), +(114, '9', 260, 240, 500, 0, '8d4fd8a4gwer/hge489b51', '[{\"name\": \"Size\", \"value\": \"9\"}]', 42, '2021-11-28 12:42:03', '2021-12-14 08:19:34'), +(115, '10', 260, 240, 500, 0, 'd4fgsdhsd7hsd/h984', '[{\"name\": \"Size\", \"value\": \"10\"}]', 42, '2021-11-28 12:42:03', '2021-12-14 08:19:34'), +(116, 'Yellow', 1150, 950, 500, 0, 'geebgsfv', '[{\"name\": \"Color\", \"value\": \"Yellow\"}]', 41, '2021-11-28 12:42:37', '2021-12-14 08:19:40'), +(117, '8', 2000, 1800, 500, 0, 'dgs4gd6f565fdb1fd5b165', '[{\"name\": \"Size\", \"value\": \"8\"}]', 31, '2021-11-28 12:55:46', '2021-12-14 08:16:58'), +(118, 'Red', 420, 350, 500, 0, '5g1s6dfg56sfd1g65d1', '[{\"name\": \"Color\", \"value\": \"Red\"}]', 36, '2021-11-28 12:56:55', '2021-12-14 08:17:26'), +(120, 'Red/Small', 200, 180, 500, 0, 'fa984v1 651651', '[{\"name\": \"Color\", \"value\": \"Red\"}, {\"name\": \"Size\", \"value\": \"Small\"}]', 3, '2021-11-28 12:59:08', '2021-12-14 08:06:34'), +(121, 'Red/Small', 650, 550, 500, 0, '9re74a1b2655v #02', '[{\"name\": \"Color\", \"value\": \"Red\"}, {\"name\": \"Size\", \"value\": \"Small\"}]', 7, '2021-11-28 13:00:22', '2021-12-14 08:07:33'), +(122, 'Red/Medium', 650, 580, 500, 0, '84fa8486dsa4f655sdf26', '[{\"name\": \"Color\", \"value\": \"Red\"}, {\"name\": \"Size\", \"value\": \"Medium\"}]', 7, '2021-11-28 13:00:22', '2021-12-14 08:07:33'), +(123, 'Red/Large', 650, 580, 500, 0, '5f56ad4f651503153250', '[{\"name\": \"Color\", \"value\": \"Red\"}, {\"name\": \"Size\", \"value\": \"Large\"}]', 7, '2021-11-28 13:00:22', '2021-12-14 08:07:33'), +(124, 'Red/Small', 65, 50, 500, 0, 'dage9gr8eg84f85484', '[{\"name\": \"Color\", \"value\": \"Red\"}, {\"name\": \"Size\", \"value\": \"Small\"}]', 8, '2021-11-28 13:00:52', '2021-12-14 08:08:31'), +(125, 'Red/Small', 30, NULL, 500, 0, 'wertyuiolp;[\'', '[{\"name\": \"Color\", \"value\": \"Red\"}, {\"name\": \"Size\", \"value\": \"Small\"}]', 15, '2021-11-28 13:09:00', '2021-12-14 08:11:41'), +(126, 'Red/Small', 25, 20, 500, 0, 'asdfghjk', '[{\"name\": \"Color\", \"value\": \"Red\"}, {\"name\": \"Size\", \"value\": \"Small\"}]', 16, '2021-11-28 13:09:28', '2021-12-14 08:12:16'), +(127, 'Blue', 350, 300, 1000, 0, '5g34fdfg56sfd1g65d1', '[{\"name\": \"Color\", \"value\": \"Blue\"}]', 36, '2021-12-14 08:01:12', '2021-12-14 08:17:26'), +(128, 'Yellow', 650, 500, 1200, 0, '5g1s6dfg56sfd1g45df', '[{\"name\": \"Color\", \"value\": \"Yellow\"}]', 36, '2021-12-14 08:01:12', '2021-12-14 08:17:26'), +(129, 'Medium', 1000, 899, 1000, 0, 'sdfsdr34354fd1fd3', '[{\"name\": \"Size\", \"value\": \"Medium\"}]', 35, '2021-12-14 08:01:40', '2021-12-14 08:17:20'), +(130, '7', 1000, 599, 1000, 0, 'sdfsdr34354ffsa', '[{\"name\": \"Size\", \"value\": \"7\"}]', 2, '2021-12-14 08:05:49', '2021-12-14 08:05:49'), +(131, '8', 2000, 1999, 1000, 0, 'sdfsdr34354fdlh', '[{\"name\": \"Size\", \"value\": \"8\"}]', 2, '2021-12-14 08:05:49', '2021-12-14 08:05:49'), +(132, 'Red/Medium', 300, 250, 1000, 0, 'sdfsdr3435443d', '[{\"name\": \"Color\", \"value\": \"Red\"}, {\"name\": \"Size\", \"value\": \"Medium\"}]', 3, '2021-12-14 08:06:34', '2021-12-14 08:06:34'), +(133, 'Blue/Small', 400, 387, 1000, 0, 'sdfsdr34354fd34j', '[{\"name\": \"Color\", \"value\": \"Blue\"}, {\"name\": \"Size\", \"value\": \"Small\"}]', 3, '2021-12-14 08:06:34', '2021-12-14 08:06:34'), +(134, 'Blue/Medium', 600, 500, 1000, 0, 'sdfsdr34354fdwer', '[{\"name\": \"Color\", \"value\": \"Blue\"}, {\"name\": \"Size\", \"value\": \"Medium\"}]', 3, '2021-12-14 08:06:34', '2021-12-14 08:06:34'), +(135, 'Yellow/Small', 600, 500, 1000, 0, 'sdfsdr34354fdlen', '[{\"name\": \"Color\", \"value\": \"Yellow\"}, {\"name\": \"Size\", \"value\": \"Small\"}]', 7, '2021-12-14 08:07:33', '2021-12-14 08:07:33'), +(136, 'Yellow/Medium', 700, 550, 1000, 0, 'sdfsdr34354fdlj', '[{\"name\": \"Color\", \"value\": \"Yellow\"}, {\"name\": \"Size\", \"value\": \"Medium\"}]', 7, '2021-12-14 08:07:33', '2021-12-14 08:07:33'), +(137, 'Yellow/Large', 800, 650, 1000, 0, 'sdfsdr34354fdmed', '[{\"name\": \"Color\", \"value\": \"Yellow\"}, {\"name\": \"Size\", \"value\": \"Large\"}]', 7, '2021-12-14 08:07:33', '2021-12-14 08:07:33'), +(138, 'Red/Large', 100, 75, 500, 0, 'sdfsdr34354fdfjr', '[{\"name\": \"Color\", \"value\": \"Red\"}, {\"name\": \"Size\", \"value\": \"Large\"}]', 8, '2021-12-14 08:08:31', '2021-12-14 08:08:31'), +(139, 'Blue/Small', 1000, 599, 1000, 0, 'sdfsdr34354f2fb', '[{\"name\": \"Color\", \"value\": \"Blue\"}, {\"name\": \"Size\", \"value\": \"Small\"}]', 8, '2021-12-14 08:08:31', '2021-12-14 08:08:31'), +(140, 'Blue/Large', 1500, 899, 1000, 0, 'sdfsdr34354f23fj', '[{\"name\": \"Color\", \"value\": \"Blue\"}, {\"name\": \"Size\", \"value\": \"Large\"}]', 8, '2021-12-14 08:08:31', '2021-12-14 08:08:31'), +(141, '7', 1000, 599, 1000, 0, 'sdfsdr34354dsf', '[{\"name\": \"Size\", \"value\": \"7\"}]', 14, '2021-12-14 08:10:38', '2021-12-14 08:10:38'), +(142, '8', 450, 400, 1000, 0, 'sdfsdr3435dfdds', '[{\"name\": \"Size\", \"value\": \"8\"}]', 14, '2021-12-14 08:10:38', '2021-12-14 08:10:38'), +(143, '9', 1000, 499, 1000, 0, 'sdfsdr343sdfsf', '[{\"name\": \"Size\", \"value\": \"9\"}]', 14, '2021-12-14 08:10:38', '2021-12-14 08:10:38'), +(144, 'Red/Medium', 100, 59, 1000, 0, 'dsfsdfsdfsdf', '[{\"name\": \"Color\", \"value\": \"Red\"}, {\"name\": \"Size\", \"value\": \"Medium\"}]', 15, '2021-12-14 08:11:41', '2021-12-14 08:11:41'), +(145, 'Blue/Small', 500, 399, 1000, 0, 'sdfjdshkjsdfhk', '[{\"name\": \"Color\", \"value\": \"Blue\"}, {\"name\": \"Size\", \"value\": \"Small\"}]', 15, '2021-12-14 08:11:41', '2021-12-14 08:11:41'), +(146, 'Blue/Medium', 1000, 599, 1000, 0, 'sdlfjdslifjsdf', '[{\"name\": \"Color\", \"value\": \"Blue\"}, {\"name\": \"Size\", \"value\": \"Medium\"}]', 15, '2021-12-14 08:11:41', '2021-12-14 08:11:41'), +(147, 'Red/Medium', 100, 99, 1000, 0, 'sdlkfjdslifj', '[{\"name\": \"Color\", \"value\": \"Red\"}, {\"name\": \"Size\", \"value\": \"Medium\"}]', 16, '2021-12-14 08:12:16', '2021-12-14 08:12:16'), +(148, 'Yellow/Small', 500, 200, 1000, 0, 'sdilfhjdliksjfh', '[{\"name\": \"Color\", \"value\": \"Yellow\"}, {\"name\": \"Size\", \"value\": \"Small\"}]', 16, '2021-12-14 08:12:16', '2021-12-14 08:12:16'), +(149, 'Yellow/Medium', 1000, 239, 1000, 0, 'sdlfjsldjsdf', '[{\"name\": \"Color\", \"value\": \"Yellow\"}, {\"name\": \"Size\", \"value\": \"Medium\"}]', 16, '2021-12-14 08:12:16', '2021-12-14 08:12:16'), +(150, '9', 4000, 3999, 1000, 0, 'adflkjsfljdsfs', '[{\"name\": \"Size\", \"value\": \"9\"}]', 31, '2021-12-14 08:13:54', '2021-12-14 08:16:58'), +(151, '10', 5000, 3500, 1000, 0, 'sdlkfjhsdlfj', '[{\"name\": \"Size\", \"value\": \"10\"}]', 31, '2021-12-14 08:13:54', '2021-12-14 08:16:58'); \ No newline at end of file diff --git a/packages/marvel/stubs/sql/chawkbazar/withdraws.sql b/packages/marvel/stubs/sql/chawkbazar/withdraws.sql new file mode 100644 index 0000000..139a448 --- /dev/null +++ b/packages/marvel/stubs/sql/chawkbazar/withdraws.sql @@ -0,0 +1,5 @@ +INSERT INTO `withdraws` (`id`, `shop_id`, `amount`, `payment_method`, `status`, `details`, `note`, `deleted_at`, `created_at`, `updated_at`) VALUES +(1, 2, 500.00, 'cash', 'approved', 'need to with draw 500', NULL, NULL, '2021-11-28 06:39:42', '2021-11-28 07:24:08'), +(2, 2, 250.00, 'cash', 'on_hold', 'Need to withdraw 250', 'urgently required', NULL, '2021-11-28 07:15:08', '2021-11-28 07:20:31'), +(3, 2, 6500.00, 'cash', 'rejected', 'need to withdraw', NULL, NULL, '2021-11-28 07:17:48', '2021-11-28 07:20:51'), +(4, 2, 600.00, 'cash', 'on_hold', 'need urgently', 'need payment', NULL, '2021-11-28 07:21:20', '2021-11-28 17:13:39'); \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..4ae4d97 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,31 @@ + + + + + ./tests/Unit + + + ./tests/Feature + + + + + ./app + + + + + + + + + + + + + + diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..3aec5e2 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,21 @@ + + + Options -MultiViews -Indexes + + + RewriteEngine On + + # Handle Authorization Header + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] + + # Send Requests To Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + diff --git a/public/css/app.css b/public/css/app.css new file mode 100644 index 0000000..e69de29 diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..a8137b1 --- /dev/null +++ b/public/index.php @@ -0,0 +1,55 @@ +make(Kernel::class); + +$response = tap($kernel->handle( + $request = Request::capture() +))->send(); + +$kernel->terminate($request, $response); diff --git a/public/js/app.js b/public/js/app.js new file mode 100644 index 0000000..8f2af3c --- /dev/null +++ b/public/js/app.js @@ -0,0 +1,19441 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/"; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./node_modules/axios/index.js": +/*!*************************************!*\ + !*** ./node_modules/axios/index.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js"); + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/xhr.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/adapters/xhr.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); +var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); +var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); +var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); +var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js"); +var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); +var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js"); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + // Listen for ready state + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + }; + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js"); + + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (config.responseType) { + try { + request.responseType = config.responseType; + } catch (e) { + // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. + // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. + if (config.responseType !== 'json') { + throw e; + } + } + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (requestData === undefined) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/axios.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/axios.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); +var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); +var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js"); +var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); +var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js"); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); +axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js"); +axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js"); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/Cancel.js": +/*!*************************************************!*\ + !*** ./node_modules/axios/lib/cancel/Cancel.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CancelToken.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/isCancel.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/cancel/isCancel.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/Axios.js": +/*!**********************************************!*\ + !*** ./node_modules/axios/lib/core/Axios.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); +var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); +var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js"); +var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js"); +var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + // Hook up interceptors middleware + var chain = [dispatchRequest, undefined]; + var promise = Promise.resolve(config); + + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + chain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + chain.push(interceptor.fulfilled, interceptor.rejected); + }); + + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/InterceptorManager.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/buildFullPath.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/buildFullPath.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); +var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js"); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/createError.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/core/createError.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/dispatchRequest.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); +var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js"); +var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); +var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js"); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData( + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData( + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData( + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/enhanceError.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/core/enhanceError.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/mergeConfig.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/core/mergeConfig.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'params', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy']; + var defaultToConfig2Keys = [ + 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', + 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath' + ]; + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (typeof config2[prop] !== 'undefined') { + config[prop] = config2[prop]; + } + }); + + utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) { + if (utils.isObject(config2[prop])) { + config[prop] = utils.deepMerge(config1[prop], config2[prop]); + } else if (typeof config2[prop] !== 'undefined') { + config[prop] = config2[prop]; + } else if (utils.isObject(config1[prop])) { + config[prop] = utils.deepMerge(config1[prop]); + } else if (typeof config1[prop] !== 'undefined') { + config[prop] = config1[prop]; + } + }); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (typeof config2[prop] !== 'undefined') { + config[prop] = config2[prop]; + } else if (typeof config1[prop] !== 'undefined') { + config[prop] = config1[prop]; + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys); + + var otherKeys = Object + .keys(config2) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) { + if (typeof config2[prop] !== 'undefined') { + config[prop] = config2[prop]; + } else if (typeof config1[prop] !== 'undefined') { + config[prop] = config1[prop]; + } + }); + + return config; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/settle.js": +/*!***********************************************!*\ + !*** ./node_modules/axios/lib/core/settle.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js"); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/transformData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/transformData.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn(data, headers); + }); + + return data; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults.js": +/*!********************************************!*\ + !*** ./node_modules/axios/lib/defaults.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); +var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js"); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js"); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js"); + } + return adapter; +} + +var defaults = { + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data)) { + setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); + return JSON.stringify(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + /*eslint no-param-reassign:0*/ + if (typeof data === 'string') { + try { + data = JSON.parse(data); + } catch (e) { /* Ignore */ } + } + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/bind.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/bind.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/buildURL.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/buildURL.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +function encode(val) { + return encodeURIComponent(val). + replace(/%40/gi, '@'). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/combineURLs.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/cookies.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/helpers/cookies.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": +/*!***************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/spread.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/helpers/spread.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/utils.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/utils.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); + +/*global toString:true*/ + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.replace(/^\s*/, '').replace(/\s*$/, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (typeof result[key] === 'object' && typeof val === 'object') { + result[key] = merge(result[key], val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Function equal to merge with the difference being that no reference + * to original objects is kept. + * + * @see merge + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function deepMerge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (typeof result[key] === 'object' && typeof val === 'object') { + result[key] = deepMerge(result[key], val); + } else if (typeof val === 'object') { + result[key] = deepMerge({}, val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + deepMerge: deepMerge, + extend: extend, + trim: trim +}; + + +/***/ }), + +/***/ "./node_modules/lodash/lodash.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/lodash.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.21'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function', + INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading whitespace. */ + var reTrimStart = /^\s+/; + + /** Used to match a single whitespace character. */ + var reWhitespace = /\s/; + + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** + * Used to validate the `validate` option in `_.template` variable. + * + * Forbids characters which could potentially change the meaning of the function argument definition: + * - "()," (modification of function parameters) + * - "=" (default value) + * - "[]{}" (destructuring of function parameters) + * - "/" (beginning of a comment) + * - whitespace + */ + var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = true && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ + function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ + function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + var low = 0, + high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } + + value = iteratee(value); + var valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + var lt = createRelationalOperation(baseLt); + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = baseTrim(value); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3.2); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 + */ + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ + var at = flatRest(baseAt); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = castPath(path, object); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + */ + var toPairsIn = createToPairs(keysIn); + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': '