From 97542f679de99a0fd781ce1eca1569da0c824350 Mon Sep 17 00:00:00 2001 From: Hazem-Ashraf-SE <157379336+Hazem-Ashraf-SE@users.noreply.github.com> Date: Sat, 24 May 2025 00:37:01 +0300 Subject: [PATCH 1/4] Last update with social login and registration --- .editorconfig => ClothingStore/.editorconfig | 0 .../.gitattributes | 0 .gitignore => ClothingStore/.gitignore | 0 README.md => ClothingStore/README.md | 0 .../app}/Console/Commands/FixAdminRole.php | 0 {app => ClothingStore/app}/Console/Kernel.php | 0 .../app}/Exceptions/Handler.php | 0 .../Controllers/Admin/DashboardController.php | 0 .../Auth/AuthenticatedSessionController.php | 0 .../Auth/ConfirmablePasswordController.php | 41 ++ ...mailVerificationNotificationController.php | 9 +- .../EmailVerificationPromptController.php | 22 + .../Auth/NewPasswordController.php | 61 +++ .../Controllers/Auth/PasswordController.php | 29 ++ .../Auth/PasswordResetLinkController.php | 44 ++ .../Auth/RegisteredUserController.php | 3 +- .../Controllers/Auth/SocialController.php | 82 ++++ .../Auth/VerifyEmailController.php | 28 ++ .../app}/Http/Controllers/AuthController.php | 0 .../app}/Http/Controllers/CartController.php | 0 .../Http/Controllers/CheckoutController.php | 0 .../Http/Controllers/ContactController.php | 0 .../app}/Http/Controllers/Controller.php | 0 .../app}/Http/Controllers/HomeController.php | 0 .../Manager/DashboardController.php | 119 +++++ .../app/Http/Controllers/OrderController.php | 244 ++++++++++ .../Http/Controllers/ProductController.php | 69 ++- .../Http/Controllers/ProfileController.php | 0 .../Http/Controllers/ReviewController.php | 0 .../app}/Http/Controllers/RoleController.php | 0 .../Controllers/SocialClearController.php | 0 .../Http/Controllers/SocialiteController.php | 65 ++- .../Controllers/Staff/DashboardController.php | 0 .../app}/Http/Controllers/StaffController.php | 0 .../Http/Controllers/TestDataController.php | 224 +++++++++ .../app}/Http/Controllers/UserController.php | 0 {app => ClothingStore/app}/Http/Kernel.php | 0 .../app}/Http/Middleware/AdminMiddleware.php | 0 .../app}/Http/Middleware/CheckPermission.php | 0 .../app}/Http/Middleware/CheckRole.php | 0 .../app}/Http/Middleware/VerifyCsrfToken.php | 0 .../app}/Http/Requests/Auth/LoginRequest.php | 0 .../app}/Mail/OrderConfirmation.php | 0 .../app}/Mail/OrderShipped.php | 0 .../app}/Mail/OrderStatusUpdate.php | 0 {app => ClothingStore/app}/Models/Cart.php | 0 {app => ClothingStore/app}/Models/Order.php | 0 .../app}/Models/OrderItem.php | 0 .../app}/Models/Permission.php | 0 {app => ClothingStore/app}/Models/Product.php | 0 {app => ClothingStore/app}/Models/Role.php | 0 {app => ClothingStore/app}/Models/User.php | 0 .../app}/Policies/OrderPolicy.php | 0 .../app}/Policies/UserPolicy.php | 0 .../app}/Providers/AppServiceProvider.php | 0 .../app}/Providers/AuthServiceProvider.php | 0 .../app}/Providers/EventServiceProvider.php | 0 .../app}/Providers/RoleServiceProvider.php | 0 .../app}/Providers/RouteServiceProvider.php | 2 +- {app => ClothingStore/app}/helpers.php | 0 artisan => ClothingStore/artisan | 0 .../bootstrap}/app.php | 0 .../bootstrap}/cache/.gitignore | 0 .../bootstrap}/providers.php | 0 composer.json => ClothingStore/composer.json | 1 + composer.lock => ClothingStore/composer.lock | 440 +++++++++++++++++- {config => ClothingStore/config}/app.php | 0 {config => ClothingStore/config}/auth.php | 0 {config => ClothingStore/config}/cache.php | 0 {config => ClothingStore/config}/database.php | 0 .../config}/filesystems.php | 0 {config => ClothingStore/config}/logging.php | 0 {config => ClothingStore/config}/mail.php | 0 {config => ClothingStore/config}/queue.php | 0 {config => ClothingStore/config}/services.php | 2 +- {config => ClothingStore/config}/session.php | 0 .../database}/.gitignore | 0 .../database}/factories/UserFactory.php | 0 .../0001_01_01_000000_create_users_table.php | 0 .../0001_01_01_000001_create_cache_table.php | 0 .../0001_01_01_000002_create_jobs_table.php | 0 .../2024_03_18_000000_create_roles_table.php | 0 ...24_03_18_000001_create_role_user_table.php | 0 ...024_03_19_000001_create_products_table.php | 0 .../2024_03_19_000002_create_orders_table.php | 0 ..._03_19_000003_create_order_items_table.php | 0 .../2024_03_21_000000_update_orders_table.php | 0 ..._03_21_000001_create_order_items_table.php | 0 ...4_03_21_add_featured_to_products_table.php | 0 ..._03_21_add_image_url_to_products_table.php | 0 .../2024_03_21_create_carts_table.php | 0 ...00000_add_social_fields_to_users_table.php | 0 .../database}/seeders/DatabaseSeeder.php | 0 .../seeders/RolePermissionSeeder.php | 0 .../database}/seeders/RoleSeeder.php | 0 .../database}/seeders/TestDataSeeder.php | 0 .../database}/seeders/UserSeeder.php | 0 .../database}/websec_project.sql | 72 ++- .../package-lock.json | 0 package.json => ClothingStore/package.json | 0 phpunit.xml => ClothingStore/phpunit.xml | 0 {public => ClothingStore/public}/.htaccess | 0 ClothingStore/public/clear-cache.php | 42 ++ .../public}/css/bootstrap.min.css | 0 .../public}/css/elegant-icons.css | 0 .../public}/css/font-awesome.min.css | 0 .../public}/css/magnific-popup.css | 0 .../public}/css/nice-select.css | 0 .../public}/css/owl.carousel.min.css | 0 .../public}/css/slicknav.min.css | 0 ClothingStore/public/css/social-login.css | 57 +++ .../public}/css/style.css | 0 .../public}/css/style.css.map | 0 .../public}/css/style2.css | 0 ClothingStore/public/debug-charts.php | 130 ++++++ ClothingStore/public/direct-charts.php | 316 +++++++++++++ {public => ClothingStore/public}/favicon.ico | 0 .../public}/fonts/ElegantIcons.eot | Bin .../public}/fonts/ElegantIcons.svg | 0 .../public}/fonts/ElegantIcons.ttf | Bin .../public}/fonts/ElegantIcons.woff | Bin .../public}/fonts/FontAwesome.otf | Bin .../public}/fonts/fontawesome-webfont.eot | Bin .../public}/fonts/fontawesome-webfont.svg | 0 .../public}/fonts/fontawesome-webfont.ttf | Bin .../public}/fonts/fontawesome-webfont.woff | Bin .../public}/fonts/fontawesome-webfont.woff2 | Bin .../public}/img/about/about-us.jpg | Bin .../public}/img/about/team-1.jpg | Bin .../public}/img/about/team-2.jpg | Bin .../public}/img/about/team-3.jpg | Bin .../public}/img/about/team-4.jpg | Bin .../public}/img/about/testimonial-author.jpg | Bin .../public}/img/about/testimonial-pic.jpg | Bin .../public}/img/banner/banner-1.jpg | Bin .../public}/img/banner/banner-2.jpg | Bin .../public}/img/banner/banner-3.jpg | Bin .../public}/img/blog/blog-1.jpg | Bin .../public}/img/blog/blog-2.jpg | Bin .../public}/img/blog/blog-3.jpg | Bin .../public}/img/blog/blog-4.jpg | Bin .../public}/img/blog/blog-5.jpg | Bin .../public}/img/blog/blog-6.jpg | Bin .../public}/img/blog/blog-7.jpg | Bin .../public}/img/blog/blog-8.jpg | Bin .../public}/img/blog/blog-9.jpg | Bin .../public}/img/blog/details/blog-author.jpg | Bin .../public}/img/blog/details/blog-details.jpg | Bin .../public}/img/breadcrumb-bg.jpg | Bin .../public}/img/clients/client-1.png | Bin .../public}/img/clients/client-2.png | Bin .../public}/img/clients/client-3.png | Bin .../public}/img/clients/client-4.png | Bin .../public}/img/clients/client-5.png | Bin .../public}/img/clients/client-6.png | Bin .../public}/img/clients/client-7.png | Bin .../public}/img/clients/client-8.png | Bin .../public}/img/coming-soon.jpg | Bin .../public}/img/footer-logo.png | Bin .../public}/img/hero/hero-1.jpg | Bin .../public}/img/hero/hero-2.jpg | Bin .../public}/img/icon/calendar.png | Bin .../public}/img/icon/cart.png | Bin .../public}/img/icon/compare.png | Bin .../public}/img/icon/heart.png | Bin .../public}/img/icon/search.png | Bin .../public}/img/instagram/instagram-1.jpg | Bin .../public}/img/instagram/instagram-2.jpg | Bin .../public}/img/instagram/instagram-3.jpg | Bin .../public}/img/instagram/instagram-4.jpg | Bin .../public}/img/instagram/instagram-5.jpg | Bin .../public}/img/instagram/instagram-6.jpg | Bin {public => ClothingStore/public}/img/logo.png | Bin .../public}/img/payment.png | Bin .../public}/img/product-sale.png | Bin .../public}/img/product/product-1.jpg | Bin .../public}/img/product/product-10.jpg | Bin .../public}/img/product/product-11.jpg | Bin .../public}/img/product/product-12.jpg | Bin .../public}/img/product/product-13.jpg | Bin .../public}/img/product/product-14.jpg | Bin .../public}/img/product/product-2.jpg | Bin .../public}/img/product/product-3.jpg | Bin .../public}/img/product/product-4.jpg | Bin .../public}/img/product/product-5.jpg | Bin .../public}/img/product/product-6.jpg | Bin .../public}/img/product/product-7.jpg | Bin .../public}/img/product/product-8.jpg | Bin .../public}/img/product/product-9.jpg | Bin .../img/shop-details/details-payment.png | Bin .../img/shop-details/product-big-2.png | Bin .../img/shop-details/product-big-3.png | Bin .../img/shop-details/product-big-4.png | Bin .../public}/img/shop-details/product-big.png | Bin .../public}/img/shop-details/thumb-1.png | Bin .../public}/img/shop-details/thumb-2.png | Bin .../public}/img/shop-details/thumb-3.png | Bin .../public}/img/shop-details/thumb-4.png | Bin .../public}/img/shopping-cart/cart-1.jpg | Bin .../public}/img/shopping-cart/cart-2.jpg | Bin .../public}/img/shopping-cart/cart-3.jpg | Bin .../public}/img/shopping-cart/cart-4.jpg | Bin {public => ClothingStore/public}/index.php | 0 .../public}/js/bootstrap.min.js | 0 .../public}/js/jquery-3.3.1.min.js | 0 .../public}/js/jquery.countdown.min.js | 0 .../public}/js/jquery.magnific-popup.min.js | 0 .../public}/js/jquery.nice-select.min.js | 0 .../public}/js/jquery.nicescroll.min.js | 0 .../public}/js/jquery.slicknav.js | 0 {public => ClothingStore/public}/js/main.js | 0 .../public}/js/mixitup.min.js | 0 .../public}/js/owl.carousel.min.js | 0 {public => ClothingStore/public}/robots.txt | 0 ClothingStore/public/test-charts.html | 171 +++++++ .../resources}/css/app.css | 0 .../resources}/js/app.js | 0 .../resources}/js/bootstrap.js | 0 .../views/admin/dashboard.blade.php | 0 .../resources}/views/admin/settings.blade.php | 0 .../views/admin/users/create.blade.php | 0 .../views/admin/users/index.blade.php | 0 .../views/auth/confirm-password.blade.php | 0 .../views/auth/forgot-password.blade.php | 0 .../resources}/views/auth/login.blade.php | 2 + .../auth/partials/social-buttons.blade.php | 16 + .../resources/views/auth/register.blade.php | 81 ++++ .../views/auth/reset-password.blade.php | 0 .../views/auth/verify-email.blade.php | 0 .../resources}/views/cart/index.blade.php | 0 .../resources}/views/checkout/index.blade.php | 0 .../components/application-logo.blade.php | 0 .../components/auth-session-status.blade.php | 0 .../views/components/dropdown-link.blade.php | 0 .../views/components/dropdown.blade.php | 0 .../views/components/input-error.blade.php | 0 .../views/components/input-label.blade.php | 0 .../views/components/primary-button.blade.php | 0 .../views/components/text-input.blade.php | 0 .../views/email/verification.blade.php | 0 .../emails/orders/confirmation.blade.php | 0 .../views/emails/orders/shipped.blade.php | 0 .../emails/orders/status-update.blade.php | 0 .../resources}/views/errors/419.blade.php | 0 .../resources}/views/layouts/app.blade.php | 0 .../resources}/views/layouts/guest.blade.php | 0 .../resources}/views/layouts/master.blade.php | 0 .../resources}/views/layouts/menu.blade.php | 0 .../views/manager/dashboard.blade.php | 0 .../views/manager/reports/inventory.blade.php | 0 .../views/manager/reports/sales.blade.php | 0 .../views/manager/staff/create.blade.php | 0 .../views/manager/staff/edit.blade.php | 0 .../views/manager/staff/index.blade.php | 0 .../views/manager/staff/show.blade.php | 0 .../resources}/views/orders/index.blade.php | 0 .../resources}/views/orders/show.blade.php | 0 .../views/pdfs/inventory_report.blade.php | 0 .../views/pdfs/sales_report.blade.php | 0 .../views/products/create.blade.php | 0 .../resources}/views/products/edit.blade.php | 0 .../resources}/views/products/index.blade.php | 0 .../resources}/views/profile/edit.blade.php | 0 .../resources}/views/profile/show.blade.php | 0 .../resources}/views/roles/create.blade.php | 0 .../resources}/views/roles/edit.blade.php | 0 .../resources}/views/roles/index.blade.php | 0 .../views/staff/customers/index.blade.php | 0 .../views/staff/customers/orders.blade.php | 0 .../views/staff/customers/show.blade.php | 0 .../views/staff/dashboard.blade.php | 0 .../views/staff/inventory/index.blade.php | 0 .../views/staff/orders/index.blade.php | 0 .../views/users/forgot-password.blade.php | 0 .../resources}/views/users/login.blade.php | 0 .../resources}/views/users/profile.blade.php | 0 .../resources}/views/users/register.blade.php | 0 .../views/users/reset-password.blade.php | 0 .../resources}/views/users/verified.blade.php | 0 .../views/users/verify-email.blade.php | 0 .../resources}/views/webfront/about.blade.php | 0 .../views/webfront/blog-details.blade.php | 0 .../resources}/views/webfront/blog.blade.php | 0 .../views/webfront/checkout.blade.php | 0 .../views/webfront/contact.blade.php | 0 .../views/webfront/contactform.blade.php | 0 .../resources}/views/webfront/home.blade.php | 0 .../views/webfront/shop-details.blade.php | 0 .../resources}/views/webfront/shop.blade.php | 0 .../views/webfront/shopping-cart.blade.php | 0 {routes => ClothingStore/routes}/api.php | 0 {routes => ClothingStore/routes}/auth.php | 0 {routes => ClothingStore/routes}/console.php | 0 {routes => ClothingStore/routes}/web.php | 113 +++-- .../storage}/app/.gitignore | 0 .../storage}/app/private/.gitignore | 0 .../storage}/app/public/.gitignore | 0 .../storage}/framework/.gitignore | 0 .../storage}/framework/cache/.gitignore | 0 .../storage}/framework/cache/data/.gitignore | 0 .../storage}/framework/sessions/.gitignore | 0 .../storage}/framework/testing/.gitignore | 0 .../storage}/framework/views/.gitignore | 0 .../storage}/logs/.gitignore | 0 .../tests}/Feature/ExampleTest.php | 0 {tests => ClothingStore/tests}/TestCase.php | 0 .../tests}/Unit/ExampleTest.php | 0 .../vite.config.js | 0 .../Manager/DashboardController.php | 17 - app/Http/Controllers/OrderController.php | 72 --- resources/views/auth/register.blade.php | Bin 11456 -> 0 bytes 311 files changed, 2411 insertions(+), 163 deletions(-) rename .editorconfig => ClothingStore/.editorconfig (100%) rename .gitattributes => ClothingStore/.gitattributes (100%) rename .gitignore => ClothingStore/.gitignore (100%) rename README.md => ClothingStore/README.md (100%) rename {app => ClothingStore/app}/Console/Commands/FixAdminRole.php (100%) rename {app => ClothingStore/app}/Console/Kernel.php (100%) rename {app => ClothingStore/app}/Exceptions/Handler.php (100%) rename {app => ClothingStore/app}/Http/Controllers/Admin/DashboardController.php (100%) rename {app => ClothingStore/app}/Http/Controllers/Auth/AuthenticatedSessionController.php (100%) create mode 100644 ClothingStore/app/Http/Controllers/Auth/ConfirmablePasswordController.php rename {app => ClothingStore/app}/Http/Controllers/Auth/EmailVerificationNotificationController.php (58%) create mode 100644 ClothingStore/app/Http/Controllers/Auth/EmailVerificationPromptController.php create mode 100644 ClothingStore/app/Http/Controllers/Auth/NewPasswordController.php create mode 100644 ClothingStore/app/Http/Controllers/Auth/PasswordController.php create mode 100644 ClothingStore/app/Http/Controllers/Auth/PasswordResetLinkController.php rename {app => ClothingStore/app}/Http/Controllers/Auth/RegisteredUserController.php (94%) create mode 100644 ClothingStore/app/Http/Controllers/Auth/SocialController.php create mode 100644 ClothingStore/app/Http/Controllers/Auth/VerifyEmailController.php rename {app => ClothingStore/app}/Http/Controllers/AuthController.php (100%) rename {app => ClothingStore/app}/Http/Controllers/CartController.php (100%) rename {app => ClothingStore/app}/Http/Controllers/CheckoutController.php (100%) rename {app => ClothingStore/app}/Http/Controllers/ContactController.php (100%) rename {app => ClothingStore/app}/Http/Controllers/Controller.php (100%) rename {app => ClothingStore/app}/Http/Controllers/HomeController.php (100%) create mode 100644 ClothingStore/app/Http/Controllers/Manager/DashboardController.php create mode 100644 ClothingStore/app/Http/Controllers/OrderController.php rename {app => ClothingStore/app}/Http/Controllers/ProductController.php (66%) rename {app => ClothingStore/app}/Http/Controllers/ProfileController.php (100%) rename {app => ClothingStore/app}/Http/Controllers/ReviewController.php (100%) rename {app => ClothingStore/app}/Http/Controllers/RoleController.php (100%) rename {app => ClothingStore/app}/Http/Controllers/SocialClearController.php (100%) rename {app => ClothingStore/app}/Http/Controllers/SocialiteController.php (73%) rename {app => ClothingStore/app}/Http/Controllers/Staff/DashboardController.php (100%) rename {app => ClothingStore/app}/Http/Controllers/StaffController.php (100%) create mode 100644 ClothingStore/app/Http/Controllers/TestDataController.php rename {app => ClothingStore/app}/Http/Controllers/UserController.php (100%) rename {app => ClothingStore/app}/Http/Kernel.php (100%) rename {app => ClothingStore/app}/Http/Middleware/AdminMiddleware.php (100%) rename {app => ClothingStore/app}/Http/Middleware/CheckPermission.php (100%) rename {app => ClothingStore/app}/Http/Middleware/CheckRole.php (100%) rename {app => ClothingStore/app}/Http/Middleware/VerifyCsrfToken.php (100%) rename {app => ClothingStore/app}/Http/Requests/Auth/LoginRequest.php (100%) rename {app => ClothingStore/app}/Mail/OrderConfirmation.php (100%) rename {app => ClothingStore/app}/Mail/OrderShipped.php (100%) rename {app => ClothingStore/app}/Mail/OrderStatusUpdate.php (100%) rename {app => ClothingStore/app}/Models/Cart.php (100%) rename {app => ClothingStore/app}/Models/Order.php (100%) rename {app => ClothingStore/app}/Models/OrderItem.php (100%) rename {app => ClothingStore/app}/Models/Permission.php (100%) rename {app => ClothingStore/app}/Models/Product.php (100%) rename {app => ClothingStore/app}/Models/Role.php (100%) rename {app => ClothingStore/app}/Models/User.php (100%) rename {app => ClothingStore/app}/Policies/OrderPolicy.php (100%) rename {app => ClothingStore/app}/Policies/UserPolicy.php (100%) rename {app => ClothingStore/app}/Providers/AppServiceProvider.php (100%) rename {app => ClothingStore/app}/Providers/AuthServiceProvider.php (100%) rename {app => ClothingStore/app}/Providers/EventServiceProvider.php (100%) rename {app => ClothingStore/app}/Providers/RoleServiceProvider.php (100%) rename {app => ClothingStore/app}/Providers/RouteServiceProvider.php (94%) rename {app => ClothingStore/app}/helpers.php (100%) rename artisan => ClothingStore/artisan (100%) rename {bootstrap => ClothingStore/bootstrap}/app.php (100%) rename {bootstrap => ClothingStore/bootstrap}/cache/.gitignore (100%) rename {bootstrap => ClothingStore/bootstrap}/providers.php (100%) rename composer.json => ClothingStore/composer.json (98%) rename composer.lock => ClothingStore/composer.lock (94%) rename {config => ClothingStore/config}/app.php (100%) rename {config => ClothingStore/config}/auth.php (100%) rename {config => ClothingStore/config}/cache.php (100%) rename {config => ClothingStore/config}/database.php (100%) rename {config => ClothingStore/config}/filesystems.php (100%) rename {config => ClothingStore/config}/logging.php (100%) rename {config => ClothingStore/config}/mail.php (100%) rename {config => ClothingStore/config}/queue.php (100%) rename {config => ClothingStore/config}/services.php (97%) rename {config => ClothingStore/config}/session.php (100%) rename {database => ClothingStore/database}/.gitignore (100%) rename {database => ClothingStore/database}/factories/UserFactory.php (100%) rename {database => ClothingStore/database}/migrations/0001_01_01_000000_create_users_table.php (100%) rename {database => ClothingStore/database}/migrations/0001_01_01_000001_create_cache_table.php (100%) rename {database => ClothingStore/database}/migrations/0001_01_01_000002_create_jobs_table.php (100%) rename {database => ClothingStore/database}/migrations/2024_03_18_000000_create_roles_table.php (100%) rename {database => ClothingStore/database}/migrations/2024_03_18_000001_create_role_user_table.php (100%) rename {database => ClothingStore/database}/migrations/2024_03_19_000001_create_products_table.php (100%) rename {database => ClothingStore/database}/migrations/2024_03_19_000002_create_orders_table.php (100%) rename {database => ClothingStore/database}/migrations/2024_03_19_000003_create_order_items_table.php (100%) rename {database => ClothingStore/database}/migrations/2024_03_21_000000_update_orders_table.php (100%) rename {database => ClothingStore/database}/migrations/2024_03_21_000001_create_order_items_table.php (100%) rename {database => ClothingStore/database}/migrations/2024_03_21_add_featured_to_products_table.php (100%) rename {database => ClothingStore/database}/migrations/2024_03_21_add_image_url_to_products_table.php (100%) rename {database => ClothingStore/database}/migrations/2024_03_21_create_carts_table.php (100%) rename {database => ClothingStore/database}/migrations/2025_04_30_000000_add_social_fields_to_users_table.php (100%) rename {database => ClothingStore/database}/seeders/DatabaseSeeder.php (100%) rename {database => ClothingStore/database}/seeders/RolePermissionSeeder.php (100%) rename {database => ClothingStore/database}/seeders/RoleSeeder.php (100%) rename {database => ClothingStore/database}/seeders/TestDataSeeder.php (100%) rename {database => ClothingStore/database}/seeders/UserSeeder.php (100%) rename {database => ClothingStore/database}/websec_project.sql (54%) rename package-lock.json => ClothingStore/package-lock.json (100%) rename package.json => ClothingStore/package.json (100%) rename phpunit.xml => ClothingStore/phpunit.xml (100%) rename {public => ClothingStore/public}/.htaccess (100%) create mode 100644 ClothingStore/public/clear-cache.php rename {public => ClothingStore/public}/css/bootstrap.min.css (100%) rename {public => ClothingStore/public}/css/elegant-icons.css (100%) rename {public => ClothingStore/public}/css/font-awesome.min.css (100%) rename {public => ClothingStore/public}/css/magnific-popup.css (100%) rename {public => ClothingStore/public}/css/nice-select.css (100%) rename {public => ClothingStore/public}/css/owl.carousel.min.css (100%) rename {public => ClothingStore/public}/css/slicknav.min.css (100%) create mode 100644 ClothingStore/public/css/social-login.css rename {public => ClothingStore/public}/css/style.css (100%) rename {public => ClothingStore/public}/css/style.css.map (100%) rename {public => ClothingStore/public}/css/style2.css (100%) create mode 100644 ClothingStore/public/debug-charts.php create mode 100644 ClothingStore/public/direct-charts.php rename {public => ClothingStore/public}/favicon.ico (100%) rename {public => ClothingStore/public}/fonts/ElegantIcons.eot (100%) rename {public => ClothingStore/public}/fonts/ElegantIcons.svg (100%) rename {public => ClothingStore/public}/fonts/ElegantIcons.ttf (100%) rename {public => ClothingStore/public}/fonts/ElegantIcons.woff (100%) rename {public => ClothingStore/public}/fonts/FontAwesome.otf (100%) rename {public => ClothingStore/public}/fonts/fontawesome-webfont.eot (100%) rename {public => ClothingStore/public}/fonts/fontawesome-webfont.svg (100%) rename {public => ClothingStore/public}/fonts/fontawesome-webfont.ttf (100%) rename {public => ClothingStore/public}/fonts/fontawesome-webfont.woff (100%) rename {public => ClothingStore/public}/fonts/fontawesome-webfont.woff2 (100%) rename {public => ClothingStore/public}/img/about/about-us.jpg (100%) rename {public => ClothingStore/public}/img/about/team-1.jpg (100%) rename {public => ClothingStore/public}/img/about/team-2.jpg (100%) rename {public => ClothingStore/public}/img/about/team-3.jpg (100%) rename {public => ClothingStore/public}/img/about/team-4.jpg (100%) rename {public => ClothingStore/public}/img/about/testimonial-author.jpg (100%) rename {public => ClothingStore/public}/img/about/testimonial-pic.jpg (100%) rename {public => ClothingStore/public}/img/banner/banner-1.jpg (100%) rename {public => ClothingStore/public}/img/banner/banner-2.jpg (100%) rename {public => ClothingStore/public}/img/banner/banner-3.jpg (100%) rename {public => ClothingStore/public}/img/blog/blog-1.jpg (100%) rename {public => ClothingStore/public}/img/blog/blog-2.jpg (100%) rename {public => ClothingStore/public}/img/blog/blog-3.jpg (100%) rename {public => ClothingStore/public}/img/blog/blog-4.jpg (100%) rename {public => ClothingStore/public}/img/blog/blog-5.jpg (100%) rename {public => ClothingStore/public}/img/blog/blog-6.jpg (100%) rename {public => ClothingStore/public}/img/blog/blog-7.jpg (100%) rename {public => ClothingStore/public}/img/blog/blog-8.jpg (100%) rename {public => ClothingStore/public}/img/blog/blog-9.jpg (100%) rename {public => ClothingStore/public}/img/blog/details/blog-author.jpg (100%) rename {public => ClothingStore/public}/img/blog/details/blog-details.jpg (100%) rename {public => ClothingStore/public}/img/breadcrumb-bg.jpg (100%) rename {public => ClothingStore/public}/img/clients/client-1.png (100%) rename {public => ClothingStore/public}/img/clients/client-2.png (100%) rename {public => ClothingStore/public}/img/clients/client-3.png (100%) rename {public => ClothingStore/public}/img/clients/client-4.png (100%) rename {public => ClothingStore/public}/img/clients/client-5.png (100%) rename {public => ClothingStore/public}/img/clients/client-6.png (100%) rename {public => ClothingStore/public}/img/clients/client-7.png (100%) rename {public => ClothingStore/public}/img/clients/client-8.png (100%) rename {public => ClothingStore/public}/img/coming-soon.jpg (100%) rename {public => ClothingStore/public}/img/footer-logo.png (100%) rename {public => ClothingStore/public}/img/hero/hero-1.jpg (100%) rename {public => ClothingStore/public}/img/hero/hero-2.jpg (100%) rename {public => ClothingStore/public}/img/icon/calendar.png (100%) rename {public => ClothingStore/public}/img/icon/cart.png (100%) rename {public => ClothingStore/public}/img/icon/compare.png (100%) rename {public => ClothingStore/public}/img/icon/heart.png (100%) rename {public => ClothingStore/public}/img/icon/search.png (100%) rename {public => ClothingStore/public}/img/instagram/instagram-1.jpg (100%) rename {public => ClothingStore/public}/img/instagram/instagram-2.jpg (100%) rename {public => ClothingStore/public}/img/instagram/instagram-3.jpg (100%) rename {public => ClothingStore/public}/img/instagram/instagram-4.jpg (100%) rename {public => ClothingStore/public}/img/instagram/instagram-5.jpg (100%) rename {public => ClothingStore/public}/img/instagram/instagram-6.jpg (100%) rename {public => ClothingStore/public}/img/logo.png (100%) rename {public => ClothingStore/public}/img/payment.png (100%) rename {public => ClothingStore/public}/img/product-sale.png (100%) rename {public => ClothingStore/public}/img/product/product-1.jpg (100%) rename {public => ClothingStore/public}/img/product/product-10.jpg (100%) rename {public => ClothingStore/public}/img/product/product-11.jpg (100%) rename {public => ClothingStore/public}/img/product/product-12.jpg (100%) rename {public => ClothingStore/public}/img/product/product-13.jpg (100%) rename {public => ClothingStore/public}/img/product/product-14.jpg (100%) rename {public => ClothingStore/public}/img/product/product-2.jpg (100%) rename {public => ClothingStore/public}/img/product/product-3.jpg (100%) rename {public => ClothingStore/public}/img/product/product-4.jpg (100%) rename {public => ClothingStore/public}/img/product/product-5.jpg (100%) rename {public => ClothingStore/public}/img/product/product-6.jpg (100%) rename {public => ClothingStore/public}/img/product/product-7.jpg (100%) rename {public => ClothingStore/public}/img/product/product-8.jpg (100%) rename {public => ClothingStore/public}/img/product/product-9.jpg (100%) rename {public => ClothingStore/public}/img/shop-details/details-payment.png (100%) rename {public => ClothingStore/public}/img/shop-details/product-big-2.png (100%) rename {public => ClothingStore/public}/img/shop-details/product-big-3.png (100%) rename {public => ClothingStore/public}/img/shop-details/product-big-4.png (100%) rename {public => ClothingStore/public}/img/shop-details/product-big.png (100%) rename {public => ClothingStore/public}/img/shop-details/thumb-1.png (100%) rename {public => ClothingStore/public}/img/shop-details/thumb-2.png (100%) rename {public => ClothingStore/public}/img/shop-details/thumb-3.png (100%) rename {public => ClothingStore/public}/img/shop-details/thumb-4.png (100%) rename {public => ClothingStore/public}/img/shopping-cart/cart-1.jpg (100%) rename {public => ClothingStore/public}/img/shopping-cart/cart-2.jpg (100%) rename {public => ClothingStore/public}/img/shopping-cart/cart-3.jpg (100%) rename {public => ClothingStore/public}/img/shopping-cart/cart-4.jpg (100%) rename {public => ClothingStore/public}/index.php (100%) rename {public => ClothingStore/public}/js/bootstrap.min.js (100%) rename {public => ClothingStore/public}/js/jquery-3.3.1.min.js (100%) rename {public => ClothingStore/public}/js/jquery.countdown.min.js (100%) rename {public => ClothingStore/public}/js/jquery.magnific-popup.min.js (100%) rename {public => ClothingStore/public}/js/jquery.nice-select.min.js (100%) rename {public => ClothingStore/public}/js/jquery.nicescroll.min.js (100%) rename {public => ClothingStore/public}/js/jquery.slicknav.js (100%) rename {public => ClothingStore/public}/js/main.js (100%) rename {public => ClothingStore/public}/js/mixitup.min.js (100%) rename {public => ClothingStore/public}/js/owl.carousel.min.js (100%) rename {public => ClothingStore/public}/robots.txt (100%) create mode 100644 ClothingStore/public/test-charts.html rename {resources => ClothingStore/resources}/css/app.css (100%) rename {resources => ClothingStore/resources}/js/app.js (100%) rename {resources => ClothingStore/resources}/js/bootstrap.js (100%) rename {resources => ClothingStore/resources}/views/admin/dashboard.blade.php (100%) rename {resources => ClothingStore/resources}/views/admin/settings.blade.php (100%) rename {resources => ClothingStore/resources}/views/admin/users/create.blade.php (100%) rename {resources => ClothingStore/resources}/views/admin/users/index.blade.php (100%) rename {resources => ClothingStore/resources}/views/auth/confirm-password.blade.php (100%) rename {resources => ClothingStore/resources}/views/auth/forgot-password.blade.php (100%) rename {resources => ClothingStore/resources}/views/auth/login.blade.php (97%) create mode 100644 ClothingStore/resources/views/auth/partials/social-buttons.blade.php create mode 100644 ClothingStore/resources/views/auth/register.blade.php rename {resources => ClothingStore/resources}/views/auth/reset-password.blade.php (100%) rename {resources => ClothingStore/resources}/views/auth/verify-email.blade.php (100%) rename {resources => ClothingStore/resources}/views/cart/index.blade.php (100%) rename {resources => ClothingStore/resources}/views/checkout/index.blade.php (100%) rename {resources => ClothingStore/resources}/views/components/application-logo.blade.php (100%) rename {resources => ClothingStore/resources}/views/components/auth-session-status.blade.php (100%) rename {resources => ClothingStore/resources}/views/components/dropdown-link.blade.php (100%) rename {resources => ClothingStore/resources}/views/components/dropdown.blade.php (100%) rename {resources => ClothingStore/resources}/views/components/input-error.blade.php (100%) rename {resources => ClothingStore/resources}/views/components/input-label.blade.php (100%) rename {resources => ClothingStore/resources}/views/components/primary-button.blade.php (100%) rename {resources => ClothingStore/resources}/views/components/text-input.blade.php (100%) rename {resources => ClothingStore/resources}/views/email/verification.blade.php (100%) rename {resources => ClothingStore/resources}/views/emails/orders/confirmation.blade.php (100%) rename {resources => ClothingStore/resources}/views/emails/orders/shipped.blade.php (100%) rename {resources => ClothingStore/resources}/views/emails/orders/status-update.blade.php (100%) rename {resources => ClothingStore/resources}/views/errors/419.blade.php (100%) rename {resources => ClothingStore/resources}/views/layouts/app.blade.php (100%) rename {resources => ClothingStore/resources}/views/layouts/guest.blade.php (100%) rename {resources => ClothingStore/resources}/views/layouts/master.blade.php (100%) rename {resources => ClothingStore/resources}/views/layouts/menu.blade.php (100%) rename {resources => ClothingStore/resources}/views/manager/dashboard.blade.php (100%) rename {resources => ClothingStore/resources}/views/manager/reports/inventory.blade.php (100%) rename {resources => ClothingStore/resources}/views/manager/reports/sales.blade.php (100%) rename {resources => ClothingStore/resources}/views/manager/staff/create.blade.php (100%) rename {resources => ClothingStore/resources}/views/manager/staff/edit.blade.php (100%) rename {resources => ClothingStore/resources}/views/manager/staff/index.blade.php (100%) rename {resources => ClothingStore/resources}/views/manager/staff/show.blade.php (100%) rename {resources => ClothingStore/resources}/views/orders/index.blade.php (100%) rename {resources => ClothingStore/resources}/views/orders/show.blade.php (100%) rename {resources => ClothingStore/resources}/views/pdfs/inventory_report.blade.php (100%) rename {resources => ClothingStore/resources}/views/pdfs/sales_report.blade.php (100%) rename {resources => ClothingStore/resources}/views/products/create.blade.php (100%) rename {resources => ClothingStore/resources}/views/products/edit.blade.php (100%) rename {resources => ClothingStore/resources}/views/products/index.blade.php (100%) rename {resources => ClothingStore/resources}/views/profile/edit.blade.php (100%) rename {resources => ClothingStore/resources}/views/profile/show.blade.php (100%) rename {resources => ClothingStore/resources}/views/roles/create.blade.php (100%) rename {resources => ClothingStore/resources}/views/roles/edit.blade.php (100%) rename {resources => ClothingStore/resources}/views/roles/index.blade.php (100%) rename {resources => ClothingStore/resources}/views/staff/customers/index.blade.php (100%) rename {resources => ClothingStore/resources}/views/staff/customers/orders.blade.php (100%) rename {resources => ClothingStore/resources}/views/staff/customers/show.blade.php (100%) rename {resources => ClothingStore/resources}/views/staff/dashboard.blade.php (100%) rename {resources => ClothingStore/resources}/views/staff/inventory/index.blade.php (100%) rename {resources => ClothingStore/resources}/views/staff/orders/index.blade.php (100%) rename {resources => ClothingStore/resources}/views/users/forgot-password.blade.php (100%) rename {resources => ClothingStore/resources}/views/users/login.blade.php (100%) rename {resources => ClothingStore/resources}/views/users/profile.blade.php (100%) rename {resources => ClothingStore/resources}/views/users/register.blade.php (100%) rename {resources => ClothingStore/resources}/views/users/reset-password.blade.php (100%) rename {resources => ClothingStore/resources}/views/users/verified.blade.php (100%) rename {resources => ClothingStore/resources}/views/users/verify-email.blade.php (100%) rename {resources => ClothingStore/resources}/views/webfront/about.blade.php (100%) rename {resources => ClothingStore/resources}/views/webfront/blog-details.blade.php (100%) rename {resources => ClothingStore/resources}/views/webfront/blog.blade.php (100%) rename {resources => ClothingStore/resources}/views/webfront/checkout.blade.php (100%) rename {resources => ClothingStore/resources}/views/webfront/contact.blade.php (100%) rename {resources => ClothingStore/resources}/views/webfront/contactform.blade.php (100%) rename {resources => ClothingStore/resources}/views/webfront/home.blade.php (100%) rename {resources => ClothingStore/resources}/views/webfront/shop-details.blade.php (100%) rename {resources => ClothingStore/resources}/views/webfront/shop.blade.php (100%) rename {resources => ClothingStore/resources}/views/webfront/shopping-cart.blade.php (100%) rename {routes => ClothingStore/routes}/api.php (100%) rename {routes => ClothingStore/routes}/auth.php (100%) rename {routes => ClothingStore/routes}/console.php (100%) rename {routes => ClothingStore/routes}/web.php (64%) rename {storage => ClothingStore/storage}/app/.gitignore (100%) rename {storage => ClothingStore/storage}/app/private/.gitignore (100%) rename {storage => ClothingStore/storage}/app/public/.gitignore (100%) rename {storage => ClothingStore/storage}/framework/.gitignore (100%) rename {storage => ClothingStore/storage}/framework/cache/.gitignore (100%) rename {storage => ClothingStore/storage}/framework/cache/data/.gitignore (100%) rename {storage => ClothingStore/storage}/framework/sessions/.gitignore (100%) rename {storage => ClothingStore/storage}/framework/testing/.gitignore (100%) rename {storage => ClothingStore/storage}/framework/views/.gitignore (100%) rename {storage => ClothingStore/storage}/logs/.gitignore (100%) rename {tests => ClothingStore/tests}/Feature/ExampleTest.php (100%) rename {tests => ClothingStore/tests}/TestCase.php (100%) rename {tests => ClothingStore/tests}/Unit/ExampleTest.php (100%) rename vite.config.js => ClothingStore/vite.config.js (100%) delete mode 100644 app/Http/Controllers/Manager/DashboardController.php delete mode 100644 app/Http/Controllers/OrderController.php delete mode 100644 resources/views/auth/register.blade.php diff --git a/.editorconfig b/ClothingStore/.editorconfig similarity index 100% rename from .editorconfig rename to ClothingStore/.editorconfig diff --git a/.gitattributes b/ClothingStore/.gitattributes similarity index 100% rename from .gitattributes rename to ClothingStore/.gitattributes diff --git a/.gitignore b/ClothingStore/.gitignore similarity index 100% rename from .gitignore rename to ClothingStore/.gitignore diff --git a/README.md b/ClothingStore/README.md similarity index 100% rename from README.md rename to ClothingStore/README.md diff --git a/app/Console/Commands/FixAdminRole.php b/ClothingStore/app/Console/Commands/FixAdminRole.php similarity index 100% rename from app/Console/Commands/FixAdminRole.php rename to ClothingStore/app/Console/Commands/FixAdminRole.php diff --git a/app/Console/Kernel.php b/ClothingStore/app/Console/Kernel.php similarity index 100% rename from app/Console/Kernel.php rename to ClothingStore/app/Console/Kernel.php diff --git a/app/Exceptions/Handler.php b/ClothingStore/app/Exceptions/Handler.php similarity index 100% rename from app/Exceptions/Handler.php rename to ClothingStore/app/Exceptions/Handler.php diff --git a/app/Http/Controllers/Admin/DashboardController.php b/ClothingStore/app/Http/Controllers/Admin/DashboardController.php similarity index 100% rename from app/Http/Controllers/Admin/DashboardController.php rename to ClothingStore/app/Http/Controllers/Admin/DashboardController.php diff --git a/app/Http/Controllers/Auth/AuthenticatedSessionController.php b/ClothingStore/app/Http/Controllers/Auth/AuthenticatedSessionController.php similarity index 100% rename from app/Http/Controllers/Auth/AuthenticatedSessionController.php rename to ClothingStore/app/Http/Controllers/Auth/AuthenticatedSessionController.php diff --git a/ClothingStore/app/Http/Controllers/Auth/ConfirmablePasswordController.php b/ClothingStore/app/Http/Controllers/Auth/ConfirmablePasswordController.php new file mode 100644 index 0000000..f101383 --- /dev/null +++ b/ClothingStore/app/Http/Controllers/Auth/ConfirmablePasswordController.php @@ -0,0 +1,41 @@ +validate([ + 'email' => $request->user()->email, + 'password' => $request->password, + ])) { + throw ValidationException::withMessages([ + 'password' => __('auth.password'), + ]); + } + + $request->session()->put('auth.password_confirmed_at', time()); + + return redirect()->intended(RouteServiceProvider::HOME); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Auth/EmailVerificationNotificationController.php b/ClothingStore/app/Http/Controllers/Auth/EmailVerificationNotificationController.php similarity index 58% rename from app/Http/Controllers/Auth/EmailVerificationNotificationController.php rename to ClothingStore/app/Http/Controllers/Auth/EmailVerificationNotificationController.php index 9b25c98..eb7dc56 100644 --- a/app/Http/Controllers/Auth/EmailVerificationNotificationController.php +++ b/ClothingStore/app/Http/Controllers/Auth/EmailVerificationNotificationController.php @@ -3,14 +3,19 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; +use App\Providers\RouteServiceProvider; +use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; class EmailVerificationNotificationController extends Controller { - public function store(Request $request) + /** + * Send a new email verification notification. + */ + public function store(Request $request): RedirectResponse { if ($request->user()->hasVerifiedEmail()) { - return redirect()->intended(route('dashboard')); + return redirect()->intended(RouteServiceProvider::HOME); } $request->user()->sendEmailVerificationNotification(); diff --git a/ClothingStore/app/Http/Controllers/Auth/EmailVerificationPromptController.php b/ClothingStore/app/Http/Controllers/Auth/EmailVerificationPromptController.php new file mode 100644 index 0000000..86f2de6 --- /dev/null +++ b/ClothingStore/app/Http/Controllers/Auth/EmailVerificationPromptController.php @@ -0,0 +1,22 @@ +user()->hasVerifiedEmail() + ? redirect()->intended(RouteServiceProvider::HOME) + : view('auth.verify-email'); + } +} \ No newline at end of file diff --git a/ClothingStore/app/Http/Controllers/Auth/NewPasswordController.php b/ClothingStore/app/Http/Controllers/Auth/NewPasswordController.php new file mode 100644 index 0000000..9b1b647 --- /dev/null +++ b/ClothingStore/app/Http/Controllers/Auth/NewPasswordController.php @@ -0,0 +1,61 @@ + $request]); + } + + /** + * Handle an incoming new password request. + * + * @throws \Illuminate\Validation\ValidationException + */ + public function store(Request $request): RedirectResponse + { + $request->validate([ + 'token' => ['required'], + 'email' => ['required', 'email'], + 'password' => ['required', 'confirmed', Rules\Password::defaults()], + ]); + + // Here we will attempt to reset the user's password. If it is successful we + // will update the password on an actual user model and persist it to the + // database. Otherwise we will parse the error and return the response. + $status = Password::reset( + $request->only('email', 'password', 'password_confirmation', 'token'), + function ($user) use ($request) { + $user->forceFill([ + 'password' => Hash::make($request->password), + 'remember_token' => Str::random(60), + ])->save(); + + event(new PasswordReset($user)); + } + ); + + // If the password was successfully reset, we will redirect the user back to + // the application's home authenticated view. If there is an error we can + // redirect them back to where they came from with their error message. + return $status == Password::PASSWORD_RESET + ? redirect()->route('login')->with('status', __($status)) + : back()->withInput($request->only('email')) + ->withErrors(['email' => __($status)]); + } +} \ No newline at end of file diff --git a/ClothingStore/app/Http/Controllers/Auth/PasswordController.php b/ClothingStore/app/Http/Controllers/Auth/PasswordController.php new file mode 100644 index 0000000..afad8d0 --- /dev/null +++ b/ClothingStore/app/Http/Controllers/Auth/PasswordController.php @@ -0,0 +1,29 @@ +validate([ + 'current_password' => ['required', 'current_password'], + 'password' => ['required', Password::defaults(), 'confirmed'], + ]); + + $request->user()->update([ + 'password' => Hash::make($validated['password']), + ]); + + return back()->with('status', 'password-updated'); + } +} \ No newline at end of file diff --git a/ClothingStore/app/Http/Controllers/Auth/PasswordResetLinkController.php b/ClothingStore/app/Http/Controllers/Auth/PasswordResetLinkController.php new file mode 100644 index 0000000..b98e422 --- /dev/null +++ b/ClothingStore/app/Http/Controllers/Auth/PasswordResetLinkController.php @@ -0,0 +1,44 @@ +validate([ + 'email' => ['required', 'email'], + ]); + + // We will send the password reset link to this user. Once we have attempted + // to send the link, we will examine the response then see the message we + // need to show to the user. Finally, we'll send out a proper response. + $status = Password::sendResetLink( + $request->only('email') + ); + + return $status == Password::RESET_LINK_SENT + ? back()->with('status', __($status)) + : back()->withInput($request->only('email')) + ->withErrors(['email' => __($status)]); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/ClothingStore/app/Http/Controllers/Auth/RegisteredUserController.php similarity index 94% rename from app/Http/Controllers/Auth/RegisteredUserController.php rename to ClothingStore/app/Http/Controllers/Auth/RegisteredUserController.php index 4f04cc7..c4ad57c 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/ClothingStore/app/Http/Controllers/Auth/RegisteredUserController.php @@ -41,6 +41,7 @@ public function store(Request $request): RedirectResponse 'name' => $request->name, 'email' => $request->email, 'password' => Hash::make($request->password), + // Email verification will be handled by the MustVerifyEmail interface ]); // Assign customer role by default @@ -52,7 +53,7 @@ public function store(Request $request): RedirectResponse event(new Registered($user)); Auth::login($user); - + return redirect(RouteServiceProvider::HOME); } } \ No newline at end of file diff --git a/ClothingStore/app/Http/Controllers/Auth/SocialController.php b/ClothingStore/app/Http/Controllers/Auth/SocialController.php new file mode 100644 index 0000000..f4d6835 --- /dev/null +++ b/ClothingStore/app/Http/Controllers/Auth/SocialController.php @@ -0,0 +1,82 @@ +redirect(); + } + + /** + * Obtain the user information from the provider. + * + * @param string $provider + * @return \Illuminate\Http\RedirectResponse + */ + public function handleProviderCallback($provider) + { + try { + $socialUser = Socialite::driver($provider)->user(); + + // Check if user already exists + $user = User::where('provider_id', $socialUser->getId()) + ->where('provider', $provider) + ->first(); + + if (!$user) { + // Check if user with same email exists + $existingUser = User::where('email', $socialUser->getEmail())->first(); + + if ($existingUser) { + // Update existing user with provider info + $existingUser->update([ + 'provider' => $provider, + 'provider_id' => $socialUser->getId(), + 'avatar' => $socialUser->getAvatar() + ]); + + $user = $existingUser; + } else { + // Create new user + $user = User::create([ + 'name' => $socialUser->getName(), + 'email' => $socialUser->getEmail(), + 'password' => Hash::make(Str::random(16)), // Random password + 'provider' => $provider, + 'provider_id' => $socialUser->getId(), + 'avatar' => $socialUser->getAvatar(), + 'email_verified_at' => now(), // Mark as verified since it's from a trusted provider + ]); + + // Assign default role if needed + // $user->roles()->attach(Role::where('slug', 'customer')->first()); + } + } + + // Login the user + Auth::login($user, true); + + return redirect()->intended('/dashboard'); + + } catch (Exception $e) { + return redirect('/login')->with('error', 'Something went wrong with ' . $provider . ' login: ' . $e->getMessage()); + } + } +} diff --git a/ClothingStore/app/Http/Controllers/Auth/VerifyEmailController.php b/ClothingStore/app/Http/Controllers/Auth/VerifyEmailController.php new file mode 100644 index 0000000..faa4484 --- /dev/null +++ b/ClothingStore/app/Http/Controllers/Auth/VerifyEmailController.php @@ -0,0 +1,28 @@ +user()->hasVerifiedEmail()) { + return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); + } + + if ($request->user()->markEmailAsVerified()) { + event(new Verified($request->user())); + } + + return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/AuthController.php b/ClothingStore/app/Http/Controllers/AuthController.php similarity index 100% rename from app/Http/Controllers/AuthController.php rename to ClothingStore/app/Http/Controllers/AuthController.php diff --git a/app/Http/Controllers/CartController.php b/ClothingStore/app/Http/Controllers/CartController.php similarity index 100% rename from app/Http/Controllers/CartController.php rename to ClothingStore/app/Http/Controllers/CartController.php diff --git a/app/Http/Controllers/CheckoutController.php b/ClothingStore/app/Http/Controllers/CheckoutController.php similarity index 100% rename from app/Http/Controllers/CheckoutController.php rename to ClothingStore/app/Http/Controllers/CheckoutController.php diff --git a/app/Http/Controllers/ContactController.php b/ClothingStore/app/Http/Controllers/ContactController.php similarity index 100% rename from app/Http/Controllers/ContactController.php rename to ClothingStore/app/Http/Controllers/ContactController.php diff --git a/app/Http/Controllers/Controller.php b/ClothingStore/app/Http/Controllers/Controller.php similarity index 100% rename from app/Http/Controllers/Controller.php rename to ClothingStore/app/Http/Controllers/Controller.php diff --git a/app/Http/Controllers/HomeController.php b/ClothingStore/app/Http/Controllers/HomeController.php similarity index 100% rename from app/Http/Controllers/HomeController.php rename to ClothingStore/app/Http/Controllers/HomeController.php diff --git a/ClothingStore/app/Http/Controllers/Manager/DashboardController.php b/ClothingStore/app/Http/Controllers/Manager/DashboardController.php new file mode 100644 index 0000000..3d01d6f --- /dev/null +++ b/ClothingStore/app/Http/Controllers/Manager/DashboardController.php @@ -0,0 +1,119 @@ +getSalesData(7); + + // Get order status distribution + $orderStatusData = $this->getOrderStatusData(); + + // Get top selling products + $topProducts = $this->getTopSellingProducts(5); + + // Get low stock products + $lowStockProducts = Product::where('stock', '<', 10) + ->orderBy('stock', 'asc') + ->take(5) + ->get(); + + return view('manager.dashboard', compact( + 'salesData', + 'orderStatusData', + 'topProducts', + 'lowStockProducts' + )); + } + + private function getSalesData($days = 7) + { + $startDate = Carbon::now()->subDays($days)->startOfDay(); + + $salesData = Order::where('created_at', '>=', $startDate) + ->select( + DB::raw('DATE(created_at) as date'), + DB::raw('SUM(total_amount) as total_amount'), + DB::raw('COUNT(*) as order_count') + ) + ->groupBy('date') + ->orderBy('date') + ->get(); + + // If no data, create sample data for the last $days + if ($salesData->isEmpty()) { + $sampleData = []; + $today = Carbon::now(); + for ($i = $days - 1; $i >= 0; $i--) { + $date = $today->copy()->subDays($i); + $sampleData[] = [ + 'date' => $date->format('Y-m-d'), + 'total_amount' => 0, + 'order_count' => 0 + ]; + } + $salesData = collect($sampleData); + } + + return $salesData; + } + + private function getOrderStatusData() + { + $statusCounts = [ + 'pending' => Order::where('status', 'pending')->count(), + 'processing' => Order::where('status', 'processing')->count(), + 'completed' => Order::where('status', 'completed')->count(), + 'cancelled' => Order::where('status', 'cancelled')->count() + ]; + + return $statusCounts; + } + + private function getTopSellingProducts($limit = 5) + { + // This query assumes you have OrderItem model with product_id and quantity + // If your database structure is different, adjust accordingly + return DB::table('order_items') + ->join('products', 'order_items.product_id', '=', 'products.id') + ->select( + 'products.id', + 'products.name', + DB::raw('SUM(order_items.quantity) as total_sold'), + DB::raw('SUM(order_items.quantity * order_items.price) as revenue') + ) + ->groupBy('products.id', 'products.name') + ->orderBy('total_sold', 'desc') + ->take($limit) + ->get(); + } + + public function getSalesDataForPeriod(Request $request) + { + $days = $request->days ?? 30; + $salesData = $this->getSalesData($days); + + // Format the dates for better display + $salesData = $salesData->map(function($item) { + $item->date = Carbon::parse($item->date)->format('M d'); + return $item; + }); + + // Log the data for debugging + Log::info('Dashboard sales data', ['data' => $salesData]); + + return response()->json(['data' => $salesData]); + } +} \ No newline at end of file diff --git a/ClothingStore/app/Http/Controllers/OrderController.php b/ClothingStore/app/Http/Controllers/OrderController.php new file mode 100644 index 0000000..4a81db3 --- /dev/null +++ b/ClothingStore/app/Http/Controllers/OrderController.php @@ -0,0 +1,244 @@ +user()->orders()->paginate(10); + return view('orders.index', compact('orders')); + } + + public function show(Order $order) + { + $this->authorize('view', $order); + return view('orders.show', compact('order')); + } + + public function staffIndex() + { + $this->authorize('viewAny', Order::class); + $orders = Order::with('user')->latest()->paginate(10); + return view('staff.orders.index', compact('orders')); + } + + public function updateStatus(Request $request, Order $order) + { + $this->authorize('update', $order); + + $validated = $request->validate([ + 'status' => 'required|in:pending,processing,completed,cancelled' + ]); + + $oldStatus = $order->status; + $order->update($validated); + + // Send status update email + Mail::to($order->user->email)->send(new OrderStatusUpdate($order, $oldStatus, $validated['status'])); + + // If order is shipped (status changed to processing), send shipping notification + if ($oldStatus === 'pending' && $validated['status'] === 'processing') { + Mail::to($order->user->email)->send(new OrderShipped($order)); + } + + return redirect()->route('staff.orders.index') + ->with('success', 'Order status updated successfully.'); + } + + public function salesReport(Request $request) + { + $this->authorize('viewAny', Order::class); + + // Date filtering + $query = Order::with('user', 'items.product'); + + if ($request->filled('start_date')) { + $query->whereDate('created_at', '>=', $request->start_date); + } + + if ($request->filled('end_date')) { + $query->whereDate('created_at', '<=', $request->end_date); + } + + $sales = $query->orderBy('created_at', 'desc')->get(); + + // Generate monthly sales data for chart + try { + $monthlySalesCollection = DB::table('orders') + ->select(DB::raw('DATE_FORMAT(created_at, "%Y-%m") as month'), DB::raw('SUM(total_amount) as total')) + ->groupBy('month') + ->orderBy('month') + ->get(); + + // Convert to array with proper formatting + $monthlySales = []; + foreach ($monthlySalesCollection as $item) { + try { + $date = Carbon::createFromFormat('Y-m', $item->month); + $monthlySales[] = [ + 'month' => $date->format('M Y'), + 'total' => (float)$item->total + ]; + } catch (\Exception $e) { + $monthlySales[] = [ + 'month' => $item->month, + 'total' => (float)$item->total + ]; + } + } + } catch (\Exception $e) { + Log::error("Error generating monthly sales data: " . $e->getMessage()); + $monthlySales = []; + } + + // If no monthly data, create sample data + if (empty($monthlySales)) { + $today = Carbon::now(); + for ($i = 6; $i >= 0; $i--) { + $date = $today->copy()->subMonths($i); + $monthlySales[] = [ + 'month' => $date->format('M Y'), + 'total' => 0 + ]; + } + } + + // Generate customer sales data for chart + try { + $customerSalesCollection = DB::table('orders') + ->join('users', 'orders.user_id', '=', 'users.id') + ->select('users.name', DB::raw('SUM(orders.total_amount) as total')) + ->groupBy('users.id', 'users.name') + ->orderBy('total', 'desc') + ->limit(10) + ->get(); + + // Convert to array with proper formatting + $customerSales = []; + foreach ($customerSalesCollection as $item) { + $customerSales[] = [ + 'name' => $item->name, + 'total' => (float)$item->total + ]; + } + } catch (\Exception $e) { + Log::error("Error generating customer sales data: " . $e->getMessage()); + $customerSales = []; + } + + // If no customer data, use the existing orders to create sample data + if (empty($customerSales) && $sales->isNotEmpty()) { + $customerMap = []; + foreach ($sales as $order) { + $userName = $order->user->name ?? 'Unknown Customer'; + if (!isset($customerMap[$userName])) { + $customerMap[$userName] = 0; + } + $customerMap[$userName] += $order->total_amount; + } + + // Convert to array format + foreach ($customerMap as $name => $total) { + $customerSales[] = [ + 'name' => $name, + 'total' => (float)$total + ]; + } + + // Sort by total amount + usort($customerSales, function($a, $b) { + return $b['total'] <=> $a['total']; + }); + + // Limit to 10 + $customerSales = array_slice($customerSales, 0, 10); + } + + // Order status distribution for pie chart + $statusCounts = [ + 'pending' => Order::where('status', 'pending')->count(), + 'processing' => Order::where('status', 'processing')->count(), + 'completed' => Order::where('status', 'completed')->count(), + 'cancelled' => Order::where('status', 'cancelled')->count() + ]; + + // Debug information to check data structure + Log::info('Monthly sales data', ['data' => $monthlySales]); + Log::info('Customer sales data', ['data' => $customerSales]); + Log::info('Status counts data', ['data' => $statusCounts]); + + return view('manager.reports.sales', compact('sales', 'monthlySales', 'customerSales', 'statusCounts')); + } + + public function salesReportPdf() + { + $this->authorize('viewAny', Order::class); + + $sales = Order::with('user', 'items.product') + ->orderBy('created_at', 'desc') + ->get(); + + // Add data for charts in PDF + $monthlySalesCollection = DB::table('orders') + ->select(DB::raw('DATE_FORMAT(created_at, "%Y-%m") as month'), DB::raw('SUM(total_amount) as total')) + ->groupBy('month') + ->orderBy('month') + ->get(); + + // Convert to array with proper formatting + $monthlySales = []; + foreach ($monthlySalesCollection as $item) { + try { + $date = Carbon::createFromFormat('Y-m', $item->month); + $monthlySales[] = [ + 'month' => $date->format('M Y'), + 'total' => (float)$item->total + ]; + } catch (\Exception $e) { + $monthlySales[] = [ + 'month' => $item->month, + 'total' => (float)$item->total + ]; + } + } + + // Customer sales data for chart + $customerSalesCollection = DB::table('orders') + ->join('users', 'orders.user_id', '=', 'users.id') + ->select('users.name', DB::raw('SUM(orders.total_amount) as total')) + ->groupBy('users.id', 'users.name') + ->orderBy('total', 'desc') + ->limit(10) + ->get(); + + // Convert to array with proper formatting + $customerSales = []; + foreach ($customerSalesCollection as $item) { + $customerSales[] = [ + 'name' => $item->name, + 'total' => (float)$item->total + ]; + } + + $statusCounts = [ + 'pending' => Order::where('status', 'pending')->count(), + 'processing' => Order::where('status', 'processing')->count(), + 'completed' => Order::where('status', 'completed')->count(), + 'cancelled' => Order::where('status', 'cancelled')->count() + ]; + + return view('pdfs.sales_report', compact('sales', 'monthlySales', 'customerSales', 'statusCounts')); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/ProductController.php b/ClothingStore/app/Http/Controllers/ProductController.php similarity index 66% rename from app/Http/Controllers/ProductController.php rename to ClothingStore/app/Http/Controllers/ProductController.php index d815aad..95427fc 100644 --- a/app/Http/Controllers/ProductController.php +++ b/ClothingStore/app/Http/Controllers/ProductController.php @@ -91,10 +91,75 @@ public function destroy(Product $product) ->with('success', 'Product deleted successfully.'); } - public function inventoryReport() + public function inventoryReport(Request $request) { + // Apply filters + $query = Product::query(); + + // Search filter + if ($request->filled('search')) { + $query->where('name', 'like', '%' . $request->search . '%'); + } + + // Remove category filter since the column doesn't exist + + // Stock status filter + if ($request->filled('stock_status')) { + switch ($request->stock_status) { + case 'out': + $query->where('stock', '<=', 0); + break; + case 'low': + $query->whereBetween('stock', [1, 9]); + break; + case 'normal': + $query->where('stock', '>=', 10); + break; + } + } + + $products = $query->get(); + + // Use a fixed list of categories instead of querying the database + $categories = ['Electronics', 'Clothing', 'Food', 'Other']; + + // Calculate category-based data for charts + // We'll use a default category for all products since the column doesn't exist + $categoryData = [ + 'Electronics' => [ + 'stock' => $products->sum('stock'), + 'value' => $products->sum(function($product) { + return $product->price * $product->stock; + }) + ] + ]; + + // Calculate stock status distribution + $stockStatus = [ + 'outOfStock' => $products->where('stock', '<=', 0)->count(), + 'critical' => $products->where('stock', '>', 0)->where('stock', '<', 5)->count(), + 'low' => $products->where('stock', '>=', 5)->where('stock', '<', 10)->count(), + 'normal' => $products->where('stock', '>=', 10)->count() + ]; + + return view('manager.reports.inventory', compact('products', 'categories', 'categoryData', 'stockStatus')); + } + + public function inventoryReportPdf() + { + // Recommend installing DomPDF package first if not already installed: + // composer require barryvdh/laravel-dompdf + $products = Product::all(); - return view('manager.reports.inventory', compact('products')); + + // If using barryvdh/laravel-dompdf package: + // return PDF::loadView('pdfs.inventory_report', compact('products')) + // ->setPaper('a4', 'landscape') + // ->download('inventory_report_' . date('Y-m-d') . '.pdf'); + + // Since we don't have the PDF package installed yet, we'll return a simplified HTML version + // that can be printed to PDF from the browser + return view('pdfs.inventory_report', compact('products')); } public function shop(Request $request) diff --git a/app/Http/Controllers/ProfileController.php b/ClothingStore/app/Http/Controllers/ProfileController.php similarity index 100% rename from app/Http/Controllers/ProfileController.php rename to ClothingStore/app/Http/Controllers/ProfileController.php diff --git a/app/Http/Controllers/ReviewController.php b/ClothingStore/app/Http/Controllers/ReviewController.php similarity index 100% rename from app/Http/Controllers/ReviewController.php rename to ClothingStore/app/Http/Controllers/ReviewController.php diff --git a/app/Http/Controllers/RoleController.php b/ClothingStore/app/Http/Controllers/RoleController.php similarity index 100% rename from app/Http/Controllers/RoleController.php rename to ClothingStore/app/Http/Controllers/RoleController.php diff --git a/app/Http/Controllers/SocialClearController.php b/ClothingStore/app/Http/Controllers/SocialClearController.php similarity index 100% rename from app/Http/Controllers/SocialClearController.php rename to ClothingStore/app/Http/Controllers/SocialClearController.php diff --git a/app/Http/Controllers/SocialiteController.php b/ClothingStore/app/Http/Controllers/SocialiteController.php similarity index 73% rename from app/Http/Controllers/SocialiteController.php rename to ClothingStore/app/Http/Controllers/SocialiteController.php index 10b7198..bca6854 100644 --- a/app/Http/Controllers/SocialiteController.php +++ b/ClothingStore/app/Http/Controllers/SocialiteController.php @@ -3,10 +3,12 @@ namespace App\Http\Controllers; use App\Models\User; +use App\Models\Role; use Exception; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Str; use Laravel\Socialite\Facades\Socialite; @@ -23,7 +25,7 @@ public function redirectToProvider($provider) try { // Special handling for LinkedIn if ($provider === 'linkedin') { - \Log::info("LinkedIn redirect initiated with client_id: " . config('services.linkedin.client_id')); + Log::info("LinkedIn redirect initiated with client_id: " . config('services.linkedin.client_id')); // Use OpenID Connect for LinkedIn return Socialite::driver($provider) @@ -37,7 +39,7 @@ public function redirectToProvider($provider) // Special handling for Twitter if ($provider === 'twitter') { // Log the Twitter configuration - \Log::info("Twitter redirect initiated with keys: " . json_encode([ + Log::info("Twitter redirect initiated with keys: " . json_encode([ 'consumer_key' => config('services.twitter.consumer_key'), 'has_secret' => !empty(config('services.twitter.consumer_secret')), 'redirect' => config('services.twitter.redirect') @@ -51,8 +53,8 @@ public function redirectToProvider($provider) // Return the redirect response return $driver->redirect(); } catch (\Exception $e) { - \Log::error("Twitter driver error: " . $e->getMessage()); - \Log::error("Twitter driver error trace: " . $e->getTraceAsString()); + Log::error("Twitter driver error: " . $e->getMessage()); + Log::error("Twitter driver error trace: " . $e->getTraceAsString()); // Return a more user-friendly error return redirect('/login')->with('error', 'Error connecting to Twitter: ' . $e->getMessage()); @@ -63,8 +65,8 @@ public function redirectToProvider($provider) return Socialite::driver($provider)->redirect(); } catch (\Exception $e) { // Log the error with more details - \Log::error("Error in redirectToProvider for {$provider}: " . $e->getMessage()); - \Log::error("Error trace: " . $e->getTraceAsString()); + Log::error("Error in redirectToProvider for {$provider}: " . $e->getMessage()); + Log::error("Error trace: " . $e->getTraceAsString()); return redirect('/login')->with('error', 'Error connecting to ' . $provider . ': ' . $e->getMessage()); } @@ -79,14 +81,14 @@ public function redirectToProvider($provider) public function handleProviderCallback($provider) { // Log the callback URL for debugging - \Log::info("Callback received for provider: {$provider}"); - \Log::info("Request URL: " . request()->fullUrl()); - \Log::info("Request method: " . request()->method()); + Log::info("Callback received for provider: {$provider}"); + Log::info("Request URL: " . request()->fullUrl()); + Log::info("Request method: " . request()->method()); try { // Special handling for LinkedIn if ($provider === 'linkedin') { - \Log::info("LinkedIn callback received with client_id: " . config('services.linkedin.client_id')); + Log::info("LinkedIn callback received with client_id: " . config('services.linkedin.client_id')); // Get the authorization code from the request $code = request()->input('code'); @@ -94,13 +96,13 @@ public function handleProviderCallback($provider) throw new \Exception('No authorization code provided'); } - \Log::info("LinkedIn authorization code received: " . substr($code, 0, 10) . '...'); + Log::info("LinkedIn authorization code received: " . substr($code, 0, 10) . '...'); // Get the user $socialUser = Socialite::driver($provider)->user(); // Log user data for debugging - \Log::info("LinkedIn user data: " . json_encode([ + Log::info("LinkedIn user data: " . json_encode([ 'id' => $socialUser->getId(), 'name' => $socialUser->getName(), 'email' => $socialUser->getEmail(), @@ -109,7 +111,7 @@ public function handleProviderCallback($provider) } // Special handling for Twitter else if ($provider === 'twitter') { - \Log::info("Twitter callback received with client_id: " . config('services.twitter.client_id')); + Log::info("Twitter callback received with client_id: " . config('services.twitter.client_id')); // Check for denied access if (request()->has('denied')) { @@ -120,7 +122,7 @@ public function handleProviderCallback($provider) $socialUser = Socialite::driver($provider)->user(); // Log user data for debugging - \Log::info("Twitter user data: " . json_encode([ + Log::info("Twitter user data: " . json_encode([ 'id' => $socialUser->getId(), 'name' => $socialUser->getName(), 'nickname' => $socialUser->getNickname(), @@ -146,7 +148,20 @@ public function handleProviderCallback($provider) ->first(); if (!$user) { + // Try to find user by email $user = User::where('email', $email)->first(); + + // If user exists but doesn't have provider info, update their record + if ($user) { + $user->update([ + 'provider' => $provider, + 'provider_id' => $socialUser->getId(), + 'avatar' => $socialUser->getAvatar(), + 'email_verified_at' => now(), // Ensure the email is verified + ]); + + Log::info("Updated existing user with provider info: {$user->email}"); + } } if (!$user) { @@ -158,7 +173,17 @@ public function handleProviderCallback($provider) 'provider' => $provider, 'provider_id' => $socialUser->getId(), 'avatar' => $socialUser->getAvatar(), + 'email_verified_at' => now(), // Verify email for social logins as they come from trusted providers ]); + + // Assign customer role by default + $customerRole = Role::where('slug', 'customer')->first(); + if ($customerRole) { + $user->roles()->attach($customerRole); + Log::info("Assigned customer role to new social login user: {$user->email}"); + } else { + Log::warning("Could not find customer role to assign to new social login user: {$user->email}"); + } } else { // Update existing user with provider info if needed $user->update([ @@ -175,19 +200,19 @@ public function handleProviderCallback($provider) } catch (Exception $e) { // Log the error for debugging with more details - \Log::error("Social login error with {$provider}: " . $e->getMessage()); - \Log::error("Exception trace: " . $e->getTraceAsString()); + Log::error("Social login error with {$provider}: " . $e->getMessage()); + Log::error("Exception trace: " . $e->getTraceAsString()); if ($provider === 'linkedin') { // Log LinkedIn specific configuration for debugging - \Log::error("LinkedIn configuration: " . json_encode([ + Log::error("LinkedIn configuration: " . json_encode([ 'client_id' => config('services.linkedin.client_id'), 'redirect' => config('services.linkedin.redirect'), 'api_version' => config('services.linkedin.api_version'), ])); // Log request details - \Log::error("LinkedIn callback request: " . json_encode([ + Log::error("LinkedIn callback request: " . json_encode([ 'code' => request()->input('code') ? 'present' : 'missing', 'state' => request()->input('state') ? 'present' : 'missing', 'error' => request()->input('error'), @@ -197,14 +222,14 @@ public function handleProviderCallback($provider) if ($provider === 'twitter') { // Log Twitter specific configuration for debugging - \Log::error("Twitter configuration: " . json_encode([ + Log::error("Twitter configuration: " . json_encode([ 'consumer_key' => config('services.twitter.consumer_key'), 'has_secret' => !empty(config('services.twitter.consumer_secret')), 'redirect' => config('services.twitter.redirect'), ])); // Log request details - \Log::error("Twitter callback request: " . json_encode([ + Log::error("Twitter callback request: " . json_encode([ 'oauth_token' => request()->input('oauth_token') ? 'present' : 'missing', 'oauth_verifier' => request()->input('oauth_verifier') ? 'present' : 'missing', 'denied' => request()->input('denied'), diff --git a/app/Http/Controllers/Staff/DashboardController.php b/ClothingStore/app/Http/Controllers/Staff/DashboardController.php similarity index 100% rename from app/Http/Controllers/Staff/DashboardController.php rename to ClothingStore/app/Http/Controllers/Staff/DashboardController.php diff --git a/app/Http/Controllers/StaffController.php b/ClothingStore/app/Http/Controllers/StaffController.php similarity index 100% rename from app/Http/Controllers/StaffController.php rename to ClothingStore/app/Http/Controllers/StaffController.php diff --git a/ClothingStore/app/Http/Controllers/TestDataController.php b/ClothingStore/app/Http/Controllers/TestDataController.php new file mode 100644 index 0000000..72dbe41 --- /dev/null +++ b/ClothingStore/app/Http/Controllers/TestDataController.php @@ -0,0 +1,224 @@ +count(); + $productCount = DB::table('products')->count(); + $orderCount = DB::table('orders')->count(); + $orderItemCount = DB::table('order_items')->count(); + + // Check if DATE_FORMAT works in your MySQL version + try { + $testDate = DB::select("SELECT DATE_FORMAT(NOW(), '%Y-%m') as formatted_date"); + $dateFormatWorks = !empty($testDate); + } catch (\Exception $e) { + $dateFormatWorks = false; + } + + // Get sample data that would be used for charts + $monthlySales = $this->getMonthlySalesData(); + $customerSales = $this->getCustomerSalesData(); + $statusCounts = $this->getStatusData(); + + return response()->json([ + 'database_info' => [ + 'users' => $userCount, + 'products' => $productCount, + 'orders' => $orderCount, + 'order_items' => $orderItemCount, + 'date_format_works' => $dateFormatWorks + ], + 'chart_data' => [ + 'monthly_sales' => $monthlySales, + 'customer_sales' => $customerSales, + 'status_counts' => $statusCounts + ] + ]); + } + + public function generateData() + { + // Check if we already have data + if (Order::count() > 0) { + return response()->json(['message' => 'Data already exists, skipping generation']); + } + + // Create users if needed + if (User::count() < 5) { + for ($i = 1; $i <= 5; $i++) { + User::create([ + 'name' => "Test User {$i}", + 'email' => "test{$i}@example.com", + 'password' => bcrypt('password'), + 'email_verified_at' => now() + ]); + } + } + + // Create products if needed + if (Product::count() < 5) { + $products = [ + ['name' => 'Smartphone', 'price' => 999.99, 'stock' => 50], + ['name' => 'Laptop', 'price' => 1299.99, 'stock' => 25], + ['name' => 'Headphones', 'price' => 199.99, 'stock' => 100], + ['name' => 'Tablet', 'price' => 499.99, 'stock' => 30], + ['name' => 'Smartwatch', 'price' => 299.99, 'stock' => 45] + ]; + + foreach ($products as $product) { + Product::create([ + 'name' => $product['name'], + 'description' => "This is a {$product['name']}", + 'price' => $product['price'], + 'stock' => $product['stock'], + 'image' => 'products/default.jpg' + ]); + } + } + + // Get IDs for reference + $userIds = User::pluck('id')->toArray(); + $productIds = Product::pluck('id')->toArray(); + + // Create orders with different statuses and dates + $statuses = ['pending', 'processing', 'completed', 'cancelled']; + + for ($i = 1; $i <= 20; $i++) { + // Create orders spread across the last 6 months + $date = Carbon::now()->subDays(rand(1, 180))->format('Y-m-d H:i:s'); + $status = $statuses[array_rand($statuses)]; + $userId = $userIds[array_rand($userIds)]; + + // Random total between $50 and $5000 + $total = rand(5000, 500000) / 100; + + $order = Order::create([ + 'user_id' => $userId, + 'status' => $status, + 'total_amount' => $total, + 'created_at' => $date, + 'updated_at' => $date + ]); + + // Add order items + $itemCount = rand(1, 3); + $itemTotal = 0; + + for ($j = 0; $j < $itemCount; $j++) { + $productId = $productIds[array_rand($productIds)]; + $product = Product::find($productId); + + $quantity = rand(1, 5); + $price = $product->price; + + DB::table('order_items')->insert([ + 'order_id' => $order->id, + 'product_id' => $productId, + 'quantity' => $quantity, + 'price' => $price, + 'created_at' => $date, + 'updated_at' => $date + ]); + + $itemTotal += $price * $quantity; + } + + // Update order with correct total from items + $order->update([ + 'total_amount' => $itemTotal + ]); + } + + return response()->json([ + 'success' => true, + 'message' => 'Test data generated successfully', + 'counts' => [ + 'users' => User::count(), + 'products' => Product::count(), + 'orders' => Order::count(), + 'order_items' => DB::table('order_items')->count() + ] + ]); + } + + private function getMonthlySalesData() + { + try { + $data = DB::table('orders') + ->select(DB::raw('DATE_FORMAT(created_at, "%Y-%m") as month'), DB::raw('SUM(total_amount) as total')) + ->groupBy('month') + ->orderBy('month') + ->get() + ->map(function($item) { + try { + $date = Carbon::createFromFormat('Y-m', $item->month); + return [ + 'month' => $date->format('M Y'), + 'total' => (float)$item->total + ]; + } catch (\Exception $e) { + return [ + 'month' => $item->month, + 'total' => (float)$item->total, + 'error' => $e->getMessage() + ]; + } + }) + ->toArray(); + return $data; + } catch (\Exception $e) { + return ['error' => $e->getMessage()]; + } + } + + private function getCustomerSalesData() + { + try { + $data = DB::table('orders') + ->join('users', 'orders.user_id', '=', 'users.id') + ->select('users.name', DB::raw('SUM(orders.total_amount) as total')) + ->groupBy('users.id', 'users.name') + ->orderBy('total', 'desc') + ->limit(10) + ->get() + ->map(function($item) { + return [ + 'name' => $item->name, + 'total' => (float)$item->total + ]; + }) + ->toArray(); + return $data; + } catch (\Exception $e) { + return ['error' => $e->getMessage()]; + } + } + + private function getStatusData() + { + try { + $data = [ + 'pending' => Order::where('status', 'pending')->count(), + 'processing' => Order::where('status', 'processing')->count(), + 'completed' => Order::where('status', 'completed')->count(), + 'cancelled' => Order::where('status', 'cancelled')->count() + ]; + return $data; + } catch (\Exception $e) { + return ['error' => $e->getMessage()]; + } + } +} \ No newline at end of file diff --git a/app/Http/Controllers/UserController.php b/ClothingStore/app/Http/Controllers/UserController.php similarity index 100% rename from app/Http/Controllers/UserController.php rename to ClothingStore/app/Http/Controllers/UserController.php diff --git a/app/Http/Kernel.php b/ClothingStore/app/Http/Kernel.php similarity index 100% rename from app/Http/Kernel.php rename to ClothingStore/app/Http/Kernel.php diff --git a/app/Http/Middleware/AdminMiddleware.php b/ClothingStore/app/Http/Middleware/AdminMiddleware.php similarity index 100% rename from app/Http/Middleware/AdminMiddleware.php rename to ClothingStore/app/Http/Middleware/AdminMiddleware.php diff --git a/app/Http/Middleware/CheckPermission.php b/ClothingStore/app/Http/Middleware/CheckPermission.php similarity index 100% rename from app/Http/Middleware/CheckPermission.php rename to ClothingStore/app/Http/Middleware/CheckPermission.php diff --git a/app/Http/Middleware/CheckRole.php b/ClothingStore/app/Http/Middleware/CheckRole.php similarity index 100% rename from app/Http/Middleware/CheckRole.php rename to ClothingStore/app/Http/Middleware/CheckRole.php diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/ClothingStore/app/Http/Middleware/VerifyCsrfToken.php similarity index 100% rename from app/Http/Middleware/VerifyCsrfToken.php rename to ClothingStore/app/Http/Middleware/VerifyCsrfToken.php diff --git a/app/Http/Requests/Auth/LoginRequest.php b/ClothingStore/app/Http/Requests/Auth/LoginRequest.php similarity index 100% rename from app/Http/Requests/Auth/LoginRequest.php rename to ClothingStore/app/Http/Requests/Auth/LoginRequest.php diff --git a/app/Mail/OrderConfirmation.php b/ClothingStore/app/Mail/OrderConfirmation.php similarity index 100% rename from app/Mail/OrderConfirmation.php rename to ClothingStore/app/Mail/OrderConfirmation.php diff --git a/app/Mail/OrderShipped.php b/ClothingStore/app/Mail/OrderShipped.php similarity index 100% rename from app/Mail/OrderShipped.php rename to ClothingStore/app/Mail/OrderShipped.php diff --git a/app/Mail/OrderStatusUpdate.php b/ClothingStore/app/Mail/OrderStatusUpdate.php similarity index 100% rename from app/Mail/OrderStatusUpdate.php rename to ClothingStore/app/Mail/OrderStatusUpdate.php diff --git a/app/Models/Cart.php b/ClothingStore/app/Models/Cart.php similarity index 100% rename from app/Models/Cart.php rename to ClothingStore/app/Models/Cart.php diff --git a/app/Models/Order.php b/ClothingStore/app/Models/Order.php similarity index 100% rename from app/Models/Order.php rename to ClothingStore/app/Models/Order.php diff --git a/app/Models/OrderItem.php b/ClothingStore/app/Models/OrderItem.php similarity index 100% rename from app/Models/OrderItem.php rename to ClothingStore/app/Models/OrderItem.php diff --git a/app/Models/Permission.php b/ClothingStore/app/Models/Permission.php similarity index 100% rename from app/Models/Permission.php rename to ClothingStore/app/Models/Permission.php diff --git a/app/Models/Product.php b/ClothingStore/app/Models/Product.php similarity index 100% rename from app/Models/Product.php rename to ClothingStore/app/Models/Product.php diff --git a/app/Models/Role.php b/ClothingStore/app/Models/Role.php similarity index 100% rename from app/Models/Role.php rename to ClothingStore/app/Models/Role.php diff --git a/app/Models/User.php b/ClothingStore/app/Models/User.php similarity index 100% rename from app/Models/User.php rename to ClothingStore/app/Models/User.php diff --git a/app/Policies/OrderPolicy.php b/ClothingStore/app/Policies/OrderPolicy.php similarity index 100% rename from app/Policies/OrderPolicy.php rename to ClothingStore/app/Policies/OrderPolicy.php diff --git a/app/Policies/UserPolicy.php b/ClothingStore/app/Policies/UserPolicy.php similarity index 100% rename from app/Policies/UserPolicy.php rename to ClothingStore/app/Policies/UserPolicy.php diff --git a/app/Providers/AppServiceProvider.php b/ClothingStore/app/Providers/AppServiceProvider.php similarity index 100% rename from app/Providers/AppServiceProvider.php rename to ClothingStore/app/Providers/AppServiceProvider.php diff --git a/app/Providers/AuthServiceProvider.php b/ClothingStore/app/Providers/AuthServiceProvider.php similarity index 100% rename from app/Providers/AuthServiceProvider.php rename to ClothingStore/app/Providers/AuthServiceProvider.php diff --git a/app/Providers/EventServiceProvider.php b/ClothingStore/app/Providers/EventServiceProvider.php similarity index 100% rename from app/Providers/EventServiceProvider.php rename to ClothingStore/app/Providers/EventServiceProvider.php diff --git a/app/Providers/RoleServiceProvider.php b/ClothingStore/app/Providers/RoleServiceProvider.php similarity index 100% rename from app/Providers/RoleServiceProvider.php rename to ClothingStore/app/Providers/RoleServiceProvider.php diff --git a/app/Providers/RouteServiceProvider.php b/ClothingStore/app/Providers/RouteServiceProvider.php similarity index 94% rename from app/Providers/RouteServiceProvider.php rename to ClothingStore/app/Providers/RouteServiceProvider.php index bcd8867..0767329 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/ClothingStore/app/Providers/RouteServiceProvider.php @@ -12,7 +12,7 @@ class RouteServiceProvider extends ServiceProvider * * @var string */ - public const HOME = '/dashboard'; // Change this to your desired redirect path + public const HOME = '/home'; /** * Define your route model bindings, pattern filters, etc. diff --git a/app/helpers.php b/ClothingStore/app/helpers.php similarity index 100% rename from app/helpers.php rename to ClothingStore/app/helpers.php diff --git a/artisan b/ClothingStore/artisan similarity index 100% rename from artisan rename to ClothingStore/artisan diff --git a/bootstrap/app.php b/ClothingStore/bootstrap/app.php similarity index 100% rename from bootstrap/app.php rename to ClothingStore/bootstrap/app.php diff --git a/bootstrap/cache/.gitignore b/ClothingStore/bootstrap/cache/.gitignore similarity index 100% rename from bootstrap/cache/.gitignore rename to ClothingStore/bootstrap/cache/.gitignore diff --git a/bootstrap/providers.php b/ClothingStore/bootstrap/providers.php similarity index 100% rename from bootstrap/providers.php rename to ClothingStore/bootstrap/providers.php diff --git a/composer.json b/ClothingStore/composer.json similarity index 98% rename from composer.json rename to ClothingStore/composer.json index 130bcd0..6a583d3 100644 --- a/composer.json +++ b/ClothingStore/composer.json @@ -9,6 +9,7 @@ "php": "^8.2", "laravel/framework": "^12.0", "laravel/sanctum": "^4.1", + "laravel/socialite": "^5.20", "laravel/tinker": "^2.10.1" }, "require-dev": { diff --git a/composer.lock b/ClothingStore/composer.lock similarity index 94% rename from composer.lock rename to ClothingStore/composer.lock index 24fa497..5f923be 100644 --- a/composer.lock +++ b/ClothingStore/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "015e02e23a490fcf9d86230851cba120", + "content-hash": "d0d7e1e4d77aef2968ad5521d663c53a", "packages": [ { "name": "brick/math", @@ -510,6 +510,69 @@ ], "time": "2025-03-06T22:45:56+00:00" }, + { + "name": "firebase/php-jwt", + "version": "v6.11.1", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.4", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "psr/cache": "^2.0||^3.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.11.1" + }, + "time": "2025-04-09T20:32:01+00:00" + }, { "name": "fruitcake/php-cors", "version": "v1.3.0", @@ -1453,6 +1516,78 @@ }, "time": "2025-03-19T13:51:03+00:00" }, + { + "name": "laravel/socialite", + "version": "v5.20.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/socialite.git", + "reference": "30972c12a41f71abeb418bc9ff157da8d9231519" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/socialite/zipball/30972c12a41f71abeb418bc9ff157da8d9231519", + "reference": "30972c12a41f71abeb418bc9ff157da8d9231519", + "shasum": "" + }, + "require": { + "ext-json": "*", + "firebase/php-jwt": "^6.4", + "guzzlehttp/guzzle": "^6.0|^7.0", + "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0", + "illuminate/http": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0", + "league/oauth1-client": "^1.11", + "php": "^7.2|^8.0", + "phpseclib/phpseclib": "^3.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0|^9.0|^10.0", + "phpstan/phpstan": "^1.12.23", + "phpunit/phpunit": "^8.0|^9.3|^10.4|^11.5" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "Socialite": "Laravel\\Socialite\\Facades\\Socialite" + }, + "providers": [ + "Laravel\\Socialite\\SocialiteServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "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": "2025-04-21T14:21:34+00:00" + }, { "name": "laravel/tinker", "version": "v2.10.1", @@ -1896,6 +2031,82 @@ ], "time": "2024-09-21T08:32:55+00:00" }, + { + "name": "league/oauth1-client", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/oauth1-client.git", + "reference": "f9c94b088837eb1aae1ad7c4f23eb65cc6993055" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/f9c94b088837eb1aae1ad7c4f23eb65cc6993055", + "reference": "f9c94b088837eb1aae1ad7c4f23eb65cc6993055", + "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.11.0" + }, + "time": "2024-12-10T19:59:05+00:00" + }, { "name": "league/uri", "version": "7.5.1", @@ -2572,6 +2783,123 @@ ], "time": "2024-11-21T10:39:51+00:00" }, + { + "name": "paragonie/constant_time_encoding", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "df1e7fde177501eee2037dd159cf04f5f301a512" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/df1e7fde177501eee2037dd159cf04f5f301a512", + "reference": "df1e7fde177501eee2037dd159cf04f5f301a512", + "shasum": "" + }, + "require": { + "php": "^8" + }, + "require-dev": { + "phpunit/phpunit": "^9", + "vimeo/psalm": "^4|^5" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "time": "2024-05-08T12:36:18+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": "phpoption/phpoption", "version": "1.9.3", @@ -2647,6 +2975,116 @@ ], "time": "2024-07-20T21:41:07+00:00" }, + { + "name": "phpseclib/phpseclib", + "version": "3.0.43", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "709ec107af3cb2f385b9617be72af8cf62441d02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/709ec107af3cb2f385b9617be72af8cf62441d02", + "reference": "709ec107af3cb2f385b9617be72af8cf62441d02", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "^1|^2|^3", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": ">=5.6.1" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-dom": "Install the DOM extension to load XML formatted public keys.", + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + }, + "type": "library", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib3\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.43" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2024-12-14T21:12:59+00:00" + }, { "name": "psr/clock", "version": "1.0.0", diff --git a/config/app.php b/ClothingStore/config/app.php similarity index 100% rename from config/app.php rename to ClothingStore/config/app.php diff --git a/config/auth.php b/ClothingStore/config/auth.php similarity index 100% rename from config/auth.php rename to ClothingStore/config/auth.php diff --git a/config/cache.php b/ClothingStore/config/cache.php similarity index 100% rename from config/cache.php rename to ClothingStore/config/cache.php diff --git a/config/database.php b/ClothingStore/config/database.php similarity index 100% rename from config/database.php rename to ClothingStore/config/database.php diff --git a/config/filesystems.php b/ClothingStore/config/filesystems.php similarity index 100% rename from config/filesystems.php rename to ClothingStore/config/filesystems.php diff --git a/config/logging.php b/ClothingStore/config/logging.php similarity index 100% rename from config/logging.php rename to ClothingStore/config/logging.php diff --git a/config/mail.php b/ClothingStore/config/mail.php similarity index 100% rename from config/mail.php rename to ClothingStore/config/mail.php diff --git a/config/queue.php b/ClothingStore/config/queue.php similarity index 100% rename from config/queue.php rename to ClothingStore/config/queue.php diff --git a/config/services.php b/ClothingStore/config/services.php similarity index 97% rename from config/services.php rename to ClothingStore/config/services.php index fcc8c2e..477b110 100644 --- a/config/services.php +++ b/ClothingStore/config/services.php @@ -64,7 +64,7 @@ 'client_id' => env('LINKEDIN_CLIENT_ID'), 'client_secret' => env('LINKEDIN_CLIENT_SECRET'), 'redirect' => env('LINKEDIN_REDIRECT_URI', 'http://127.0.0.1:8000/auth/linkedin/callback'), - 'api_version' => 'v2', + 'api_version' => env('LINKEDIN_API_VERSION', 'v2'), 'scopes' => ['openid', 'profile', 'email'], ], ]; diff --git a/config/session.php b/ClothingStore/config/session.php similarity index 100% rename from config/session.php rename to ClothingStore/config/session.php diff --git a/database/.gitignore b/ClothingStore/database/.gitignore similarity index 100% rename from database/.gitignore rename to ClothingStore/database/.gitignore diff --git a/database/factories/UserFactory.php b/ClothingStore/database/factories/UserFactory.php similarity index 100% rename from database/factories/UserFactory.php rename to ClothingStore/database/factories/UserFactory.php diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/ClothingStore/database/migrations/0001_01_01_000000_create_users_table.php similarity index 100% rename from database/migrations/0001_01_01_000000_create_users_table.php rename to ClothingStore/database/migrations/0001_01_01_000000_create_users_table.php diff --git a/database/migrations/0001_01_01_000001_create_cache_table.php b/ClothingStore/database/migrations/0001_01_01_000001_create_cache_table.php similarity index 100% rename from database/migrations/0001_01_01_000001_create_cache_table.php rename to ClothingStore/database/migrations/0001_01_01_000001_create_cache_table.php diff --git a/database/migrations/0001_01_01_000002_create_jobs_table.php b/ClothingStore/database/migrations/0001_01_01_000002_create_jobs_table.php similarity index 100% rename from database/migrations/0001_01_01_000002_create_jobs_table.php rename to ClothingStore/database/migrations/0001_01_01_000002_create_jobs_table.php diff --git a/database/migrations/2024_03_18_000000_create_roles_table.php b/ClothingStore/database/migrations/2024_03_18_000000_create_roles_table.php similarity index 100% rename from database/migrations/2024_03_18_000000_create_roles_table.php rename to ClothingStore/database/migrations/2024_03_18_000000_create_roles_table.php diff --git a/database/migrations/2024_03_18_000001_create_role_user_table.php b/ClothingStore/database/migrations/2024_03_18_000001_create_role_user_table.php similarity index 100% rename from database/migrations/2024_03_18_000001_create_role_user_table.php rename to ClothingStore/database/migrations/2024_03_18_000001_create_role_user_table.php diff --git a/database/migrations/2024_03_19_000001_create_products_table.php b/ClothingStore/database/migrations/2024_03_19_000001_create_products_table.php similarity index 100% rename from database/migrations/2024_03_19_000001_create_products_table.php rename to ClothingStore/database/migrations/2024_03_19_000001_create_products_table.php diff --git a/database/migrations/2024_03_19_000002_create_orders_table.php b/ClothingStore/database/migrations/2024_03_19_000002_create_orders_table.php similarity index 100% rename from database/migrations/2024_03_19_000002_create_orders_table.php rename to ClothingStore/database/migrations/2024_03_19_000002_create_orders_table.php diff --git a/database/migrations/2024_03_19_000003_create_order_items_table.php b/ClothingStore/database/migrations/2024_03_19_000003_create_order_items_table.php similarity index 100% rename from database/migrations/2024_03_19_000003_create_order_items_table.php rename to ClothingStore/database/migrations/2024_03_19_000003_create_order_items_table.php diff --git a/database/migrations/2024_03_21_000000_update_orders_table.php b/ClothingStore/database/migrations/2024_03_21_000000_update_orders_table.php similarity index 100% rename from database/migrations/2024_03_21_000000_update_orders_table.php rename to ClothingStore/database/migrations/2024_03_21_000000_update_orders_table.php diff --git a/database/migrations/2024_03_21_000001_create_order_items_table.php b/ClothingStore/database/migrations/2024_03_21_000001_create_order_items_table.php similarity index 100% rename from database/migrations/2024_03_21_000001_create_order_items_table.php rename to ClothingStore/database/migrations/2024_03_21_000001_create_order_items_table.php diff --git a/database/migrations/2024_03_21_add_featured_to_products_table.php b/ClothingStore/database/migrations/2024_03_21_add_featured_to_products_table.php similarity index 100% rename from database/migrations/2024_03_21_add_featured_to_products_table.php rename to ClothingStore/database/migrations/2024_03_21_add_featured_to_products_table.php diff --git a/database/migrations/2024_03_21_add_image_url_to_products_table.php b/ClothingStore/database/migrations/2024_03_21_add_image_url_to_products_table.php similarity index 100% rename from database/migrations/2024_03_21_add_image_url_to_products_table.php rename to ClothingStore/database/migrations/2024_03_21_add_image_url_to_products_table.php diff --git a/database/migrations/2024_03_21_create_carts_table.php b/ClothingStore/database/migrations/2024_03_21_create_carts_table.php similarity index 100% rename from database/migrations/2024_03_21_create_carts_table.php rename to ClothingStore/database/migrations/2024_03_21_create_carts_table.php diff --git a/database/migrations/2025_04_30_000000_add_social_fields_to_users_table.php b/ClothingStore/database/migrations/2025_04_30_000000_add_social_fields_to_users_table.php similarity index 100% rename from database/migrations/2025_04_30_000000_add_social_fields_to_users_table.php rename to ClothingStore/database/migrations/2025_04_30_000000_add_social_fields_to_users_table.php diff --git a/database/seeders/DatabaseSeeder.php b/ClothingStore/database/seeders/DatabaseSeeder.php similarity index 100% rename from database/seeders/DatabaseSeeder.php rename to ClothingStore/database/seeders/DatabaseSeeder.php diff --git a/database/seeders/RolePermissionSeeder.php b/ClothingStore/database/seeders/RolePermissionSeeder.php similarity index 100% rename from database/seeders/RolePermissionSeeder.php rename to ClothingStore/database/seeders/RolePermissionSeeder.php diff --git a/database/seeders/RoleSeeder.php b/ClothingStore/database/seeders/RoleSeeder.php similarity index 100% rename from database/seeders/RoleSeeder.php rename to ClothingStore/database/seeders/RoleSeeder.php diff --git a/database/seeders/TestDataSeeder.php b/ClothingStore/database/seeders/TestDataSeeder.php similarity index 100% rename from database/seeders/TestDataSeeder.php rename to ClothingStore/database/seeders/TestDataSeeder.php diff --git a/database/seeders/UserSeeder.php b/ClothingStore/database/seeders/UserSeeder.php similarity index 100% rename from database/seeders/UserSeeder.php rename to ClothingStore/database/seeders/UserSeeder.php diff --git a/database/websec_project.sql b/ClothingStore/database/websec_project.sql similarity index 54% rename from database/websec_project.sql rename to ClothingStore/database/websec_project.sql index ba7ec1d..37ffb3a 100644 --- a/database/websec_project.sql +++ b/ClothingStore/database/websec_project.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 --- Generation Time: May 16, 2025 at 07:34 PM +-- Generation Time: May 23, 2025 at 10:15 PM -- Server version: 10.4.32-MariaDB -- PHP Version: 8.2.12 @@ -38,8 +38,30 @@ CREATE TABLE `cache` ( -- INSERT INTO `cache` (`key`, `value`, `expiration`) VALUES -('laravel_cache_customer1@example.com|127.0.0.1', 'i:1;', 1747408962), -('laravel_cache_customer1@example.com|127.0.0.1:timer', 'i:1747408962;', 1747408962); +('laravel_cache_0ade7c2cf97f75d009975f4d720d1fa6c19f4897', 'i:1;', 1748023310), +('laravel_cache_0ade7c2cf97f75d009975f4d720d1fa6c19f4897:timer', 'i:1748023310;', 1748023310), +('laravel_cache_12c6fc06c99a462375eeb3f43dfd832b08ca9e17', 'i:2;', 1748029655), +('laravel_cache_12c6fc06c99a462375eeb3f43dfd832b08ca9e17:timer', 'i:1748029655;', 1748029655), +('laravel_cache_1574bddb75c78a6fd2251d61e2993b5146201319', 'i:1;', 1748026853), +('laravel_cache_1574bddb75c78a6fd2251d61e2993b5146201319:timer', 'i:1748026853;', 1748026853), +('laravel_cache_17ba0791499db908433b80f37c5fbc89b870084b', 'i:2;', 1748024866), +('laravel_cache_17ba0791499db908433b80f37c5fbc89b870084b:timer', 'i:1748024866;', 1748024866), +('laravel_cache_472b07b9fcf2c2451e8781e944bf5f77cd8457c8', 'i:1;', 1748028982), +('laravel_cache_472b07b9fcf2c2451e8781e944bf5f77cd8457c8:timer', 'i:1748028982;', 1748028982), +('laravel_cache_4d134bc072212ace2df385dae143139da74ec0ef', 'i:2;', 1748030228), +('laravel_cache_4d134bc072212ace2df385dae143139da74ec0ef:timer', 'i:1748030228;', 1748030228), +('laravel_cache_887309d048beef83ad3eabf2a79a64a389ab1c9f', 'i:1;', 1748031056), +('laravel_cache_887309d048beef83ad3eabf2a79a64a389ab1c9f:timer', 'i:1748031056;', 1748031056), +('laravel_cache_91032ad7bbcb6cf72875e8e8207dcfba80173f7c', 'i:2;', 1748028387), +('laravel_cache_91032ad7bbcb6cf72875e8e8207dcfba80173f7c:timer', 'i:1748028387;', 1748028387), +('laravel_cache_b1d5781111d84f7b3fe45a0852e59758cd7a87e5', 'i:1;', 1748024629), +('laravel_cache_b1d5781111d84f7b3fe45a0852e59758cd7a87e5:timer', 'i:1748024629;', 1748024629), +('laravel_cache_bd307a3ec329e10a2cff8fb87480823da114f8f4', 'i:2;', 1748026269), +('laravel_cache_bd307a3ec329e10a2cff8fb87480823da114f8f4:timer', 'i:1748026269;', 1748026269), +('laravel_cache_d435a6cdd786300dff204ee7c2ef942d3e9034e2', 'i:2;', 1748029957), +('laravel_cache_d435a6cdd786300dff204ee7c2ef942d3e9034e2:timer', 'i:1748029957;', 1748029957), +('laravel_cache_f6e1126cedebf23e1463aee73f9df08783640400', 'i:1;', 1748030560), +('laravel_cache_f6e1126cedebf23e1463aee73f9df08783640400:timer', 'i:1748030560;', 1748030560); -- -------------------------------------------------------- @@ -179,7 +201,9 @@ CREATE TABLE `orders` ( INSERT INTO `orders` (`id`, `user_id`, `total_amount`, `status`, `tracking_number`, `shipping_address`, `shipping_city`, `shipping_state`, `shipping_zipcode`, `shipping_country`, `payment_method`, `created_at`, `updated_at`) VALUES (1, 4, 99.99, 'completed', NULL, 'wsdfrvgtujh', 'Cairo', 'qswdavfbgvn', '555', 'CA', 'credit_card', '2025-05-15 11:53:46', '2025-05-15 19:20:03'), -(2, 4, 2000.00, 'completed', NULL, 'Al Mehwar', 'Cairo', 'qswdavfbgvn', '555', 'CA', 'credit_card', '2025-05-16 12:26:16', '2025-05-16 12:30:38'); +(2, 4, 2000.00, 'completed', NULL, 'Al Mehwar', 'Cairo', 'qswdavfbgvn', '555', 'CA', 'credit_card', '2025-05-16 12:26:16', '2025-05-16 12:30:38'), +(3, 4, 45050.00, 'pending', NULL, 'cierp', 'nnnn', 'nnnnn', 'vvvv', 'GB', 'credit_card', '2025-05-16 18:42:39', '2025-05-16 18:42:39'), +(4, 4, 57500.00, 'pending', NULL, 'a', 'aa', 'a', 'a', 'BR', 'credit_card', '2025-05-16 18:47:14', '2025-05-16 18:47:14'); -- -------------------------------------------------------- @@ -202,7 +226,10 @@ CREATE TABLE `order_items` ( -- INSERT INTO `order_items` (`id`, `order_id`, `product_id`, `quantity`, `price`, `created_at`, `updated_at`) VALUES -(2, 2, 16, 1, 2000.00, '2025-05-16 12:26:16', '2025-05-16 12:26:16'); +(2, 2, 16, 1, 2000.00, '2025-05-16 12:26:16', '2025-05-16 12:26:16'), +(3, 3, 19, 18, 2500.00, '2025-05-16 18:42:39', '2025-05-16 18:42:39'), +(4, 3, 18, 1, 50.00, '2025-05-16 18:42:39', '2025-05-16 18:42:39'), +(5, 4, 19, 23, 2500.00, '2025-05-16 18:47:14', '2025-05-16 18:47:14'); -- -------------------------------------------------------- @@ -270,8 +297,9 @@ CREATE TABLE `products` ( -- INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image`, `created_at`, `updated_at`, `is_featured`, `is_sale`, `image_url`) VALUES -(16, 'Laptop Prooooo', 'sdsvfbgnjm,k', 2000.00, 5, 'products/LdS35de0gQL8PnviSAVkDHWzN2eLTeGRXQFcv8JG.jpg', '2025-05-15 18:01:54', '2025-05-15 18:23:23', 0, 0, NULL), -(18, 'Address', 'SWDEFRGTHYUJKILO;P\'[', 50.00, 33, 'products/m8rvdSBmF5244g6aQnVDJW9EEkuBFmUTen5IfAX5.jpg', '2025-05-15 18:16:07', '2025-05-15 18:16:07', 0, 0, NULL); +(16, 'Laptop Prooooo', 'sdsvfbgnjm,k', 2000.00, 1, 'products/r6Fwn7D0e37d5LeykTZhnXWihK9wG9991U2y2hH1.jpg', '2025-05-15 18:01:54', '2025-05-21 19:40:45', 0, 0, NULL), +(18, 'Address', 'SWDEFRGTHYUJKILO;P\'[', 50.00, 33, 'products/m8rvdSBmF5244g6aQnVDJW9EEkuBFmUTen5IfAX5.jpg', '2025-05-15 18:16:07', '2025-05-15 18:16:07', 0, 0, NULL), +(19, 'iphone 17 air pro', 'the best phone for you the best phone for you the best phone for you the best phone for you the best phone for you the best phone for you the best phone for you the best phone for you the best phone for you the best phone for you the best phone for you the best phone for you the best phone for you the best phone for you the best phone for you', 2500.00, 50, 'products/1Nvauex5u2KeIezIYRxLnhLCfV6IEFvfZJ55W5wz.jpg', '2025-05-16 16:43:08', '2025-05-16 16:43:08', 0, 0, NULL); -- -------------------------------------------------------- @@ -342,7 +370,25 @@ CREATE TABLE `sessions` ( -- INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES -('yCzCldKrNmaUC5vSns4vf566j7gqX76NgS05gKaE', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiZ0VoaTZQUFdMQW5adkZ5eDRsYXdzcWJnN2VGbHVsR3JGQk1PM3dmVyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MjE6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMCI7fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjE7fQ==', 1747409968); +('0kCnDiYwwth3WsNob8DhretV0diYxISWUDNrp0qA', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoic2ZyczdqbEsxUnA0TUtmcU5TRXo2WEl4NWR3d1JnemJDOWp5Z1hSTCI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748026434), +('5aubDZ6OY7OqA5fyI1ysErTLqOunP3oNr4VuWFEA', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiRWxlSHEzNHpCRXU5dVJHVzlpYlkxTDZFSnpmSnp0NVFHbllTQ1RsRyI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748027040), +('6SQYTiMNLB8FAPiTFlLu4NliInIEAqyIIVSNZujs', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoia2dVSXhWYmtaOVR1REJ4NENSbXJnM1B3RXEwbDFDbDF1b0tLR2tqaCI7czo1OiJlcnJvciI7czo0MDoiU29tZXRoaW5nIHdlbnQgd3Jvbmcgd2l0aCBnb29nbGUgbG9naW46ICI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJuZXciO2E6MDp7fXM6Mzoib2xkIjthOjE6e2k6MDtzOjU6ImVycm9yIjt9fXM6OToiX3ByZXZpb3VzIjthOjE6e3M6MzoidXJsIjtzOjM1NzoiaHR0cDovL2Nsb3RoaW5nc3RvcmUubG9jYWxob3N0LmNvbS9hdXRoL2dvb2dsZS9jYWxsYmFjaz9hdXRodXNlcj0wJmNvZGU9NCUyRjBBVUpSLXg2VVA5eElReHFmZmdyWVBkSGVxTHBsTmdvVVhObUFaR05fcmRjTk00UmdjMjZVdWFqamkyU3k2U1FoeEdlWHl3JnByb21wdD1ub25lJnNjb3BlPWVtYWlsJTIwcHJvZmlsZSUyMGh0dHBzJTNBJTJGJTJGd3d3Lmdvb2dsZWFwaXMuY29tJTJGYXV0aCUyRnVzZXJpbmZvLmVtYWlsJTIwaHR0cHMlM0ElMkYlMkZ3d3cuZ29vZ2xlYXBpcy5jb20lMkZhdXRoJTJGdXNlcmluZm8ucHJvZmlsZSUyMG9wZW5pZCZzdGF0ZT1tbmZaWHN2d3N5cGgyZVh0ZndpYjZRakRhbHVucldpaTJndTdNdXh6Ijt9fQ==', 1748026509), +('6V2OyviMtIME4naaQZyWR0dNNxSI8d6vMA2OSlbA', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiNEVVUENHUG1IV1N6cVRtc2VXRE9leTVzcjlRVWVmbVJpZ1ZBVnQ4SCI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748027910), +('81OuuegyNL5G9BlM3alCAyqrLtAR5SRdLYLKF0hp', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiSDhDaXRwZ0dpOHppUThoVjJqNmRrVDJWV1ZUNFZKRTFlUnFwdkRaVyI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748027074), +('AbLIknpZ8VBnq8dac4a5XKbKoGqHsxkry5vaJ2Al', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiQmZIQnhTTkJNVGhiOWhPNlN3OEc1Z3JTOHZMTHc2MlBWemtzdFlneSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748027058), +('KDoupAu1XyQhcWL0A4zq0WJyLM21ZkcLzxis2iDP', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoid052UEx1dmVpWUZ1bndRRTk3MjZVTE5yOW5BSHdyR1JUSW9VNTM0VSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748026438), +('knmegcnstWo6hPHSZ0JBxhIynaYsPqOFXxFTQ5Hi', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoidEFTbjgzYmRRN1dzQncxSmlvb29IVTZCUld2bFpnZFk4bHVoQlZ4dSI7czo1OiJlcnJvciI7czo0MDoiU29tZXRoaW5nIHdlbnQgd3Jvbmcgd2l0aCBnb29nbGUgbG9naW46ICI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJuZXciO2E6MDp7fXM6Mzoib2xkIjthOjE6e2k6MDtzOjU6ImVycm9yIjt9fXM6OToiX3ByZXZpb3VzIjthOjE6e3M6MzoidXJsIjtzOjM1NzoiaHR0cDovL2Nsb3RoaW5nc3RvcmUubG9jYWxob3N0LmNvbS9hdXRoL2dvb2dsZS9jYWxsYmFjaz9hdXRodXNlcj0wJmNvZGU9NCUyRjBBVUpSLXg2YndzdVlXZ0o3QkJ3WnZfVUl6T1hGWThmaENkWmFFOWR2LTl1UGM0WXlURHpwSUdDdmU5M09jczJPT2s0OTF3JnByb21wdD1ub25lJnNjb3BlPWVtYWlsJTIwcHJvZmlsZSUyMG9wZW5pZCUyMGh0dHBzJTNBJTJGJTJGd3d3Lmdvb2dsZWFwaXMuY29tJTJGYXV0aCUyRnVzZXJpbmZvLmVtYWlsJTIwaHR0cHMlM0ElMkYlMkZ3d3cuZ29vZ2xlYXBpcy5jb20lMkZhdXRoJTJGdXNlcmluZm8ucHJvZmlsZSZzdGF0ZT1uM2ZIWVQ5M203WlRWT0pJaUZ2TlhSeGxwcHB4N29oT25GM2ZtdU45Ijt9fQ==', 1748026426), +('KvcKhaTkAVLBpOeBpzIeQWTE5Ry76v5JAknGiwhm', 26, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiOHF0NHdvZVN2TnptRUoxV3ZFNmZ1NmV0RXU4eFU0ZHVIN3dOc0hjWCI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDg6Imh0dHBzOi8vY2xvdGhpbmdzdG9yZS5sb2NhbGhvc3QuY29tL3ZlcmlmeS1lbWFpbCI7fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjI2O3M6MzoidXJsIjthOjE6e3M6ODoiaW50ZW5kZWQiO3M6NDA6Imh0dHBzOi8vY2xvdGhpbmdzdG9yZS5sb2NhbGhvc3QuY29tL2hvbWUiO319', 1748031045), +('nfuFrspz2IDQK2GYxck80Cjzj6syMEzAg3GSkukK', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoieE1WRUg5R0pHb2d4MXc0b2ZjNGNvTUlaMHNYdG5TM3JUb2hRNlJ0MCI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748026426), +('QHqXbhL859lUKc4g2Rg5Xngh1rfWF4LwaKo2nON1', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoidXhwNnZsMzlhZExieVloUm5PMHo5aXU5dUFPT2JGM094UXo0UUxVMCI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748027059), +('T5rFSS71tkTU4z6yUcBkiAAlPJ9z7icnbDnrLBIj', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiSmxYcjFVTkR0ejBORnV5OTkyaEJwa1ExS1c5MjVqOWdzN1dvNWNpMyI7czo1OiJzdGF0ZSI7czo0MDoiTW1MVjlKeG9PT0diTnpQakkzUWY1a3NOVDBPSW9DM2gxT1FQMFpIdSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NTU6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vYXV0aC9nb29nbGUvcmVkaXJlY3QiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748026437), +('T7vc6IE42kKQdibCpYTOPqCPHPmx9fKKCbeuhrq3', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiV1BoMmEwaGZMRTRzT3FuZ3FCZXFpTFVQb2psN21rZzZtVURzbmVJTyI7czo1OiJzdGF0ZSI7czo0MDoiUDluQjEzSGwxODNuVW5EUmhaNnRMTktuTnZWZjBGcDJUVDc1Tk1JRCI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NTU6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vYXV0aC9nb29nbGUvcmVkaXJlY3QiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748027076), +('tAMf8X7qU83AQVn1oaXP1ShTiQBt11cypcznluUm', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiRFc0TU16WmhBTVJVRGM4Vjd1MndQSUxOZDdiRXNGY1dFV1hhZ1JSNCI7czo1OiJlcnJvciI7czo0MDoiU29tZXRoaW5nIHdlbnQgd3Jvbmcgd2l0aCBnb29nbGUgbG9naW46ICI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJuZXciO2E6MDp7fXM6Mzoib2xkIjthOjE6e2k6MDtzOjU6ImVycm9yIjt9fXM6OToiX3ByZXZpb3VzIjthOjE6e3M6MzoidXJsIjtzOjM1NzoiaHR0cDovL2Nsb3RoaW5nc3RvcmUubG9jYWxob3N0LmNvbS9hdXRoL2dvb2dsZS9jYWxsYmFjaz9hdXRodXNlcj0wJmNvZGU9NCUyRjBBVUpSLXg1blRXb1gzQmhacGRZaVNlTmk3Nk9pWjNnM05hRHc5U3NGSkFUWkhXdVpmUjBtSEhpOWlwVTBRYndRR2RBU0hBJnByb21wdD1ub25lJnNjb3BlPWVtYWlsJTIwcHJvZmlsZSUyMGh0dHBzJTNBJTJGJTJGd3d3Lmdvb2dsZWFwaXMuY29tJTJGYXV0aCUyRnVzZXJpbmZvLnByb2ZpbGUlMjBodHRwcyUzQSUyRiUyRnd3dy5nb29nbGVhcGlzLmNvbSUyRmF1dGglMkZ1c2VyaW5mby5lbWFpbCUyMG9wZW5pZCZzdGF0ZT1NbUxWOUp4b09PR2JOelBqSTNRZjVrc05UME9Jb0MzaDFPUVAwWkh1Ijt9fQ==', 1748026437), +('tOtZTxRpe8jb9W92arrbfXssd20FVjtZnKrqNHRq', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiMjNyV1EwYXUxUlk1Z2FnMWQ2UU1CVVo1Q1dhcjM5eUQ5RExzeGFucCI7czo1OiJlcnJvciI7czo0MDoiU29tZXRoaW5nIHdlbnQgd3Jvbmcgd2l0aCBnb29nbGUgbG9naW46ICI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJuZXciO2E6MDp7fXM6Mzoib2xkIjthOjE6e2k6MDtzOjU6ImVycm9yIjt9fXM6OToiX3ByZXZpb3VzIjthOjE6e3M6MzoidXJsIjtzOjM1NzoiaHR0cDovL2Nsb3RoaW5nc3RvcmUubG9jYWxob3N0LmNvbS9hdXRoL2dvb2dsZS9jYWxsYmFjaz9hdXRodXNlcj0wJmNvZGU9NCUyRjBBVUpSLXg3eFJsdEhQc0x1NkZHSzR2Q09MOXdVRmtENk0tU25nYnd6U1ZUM1NoMG9BU2JlbFZPSzd1REZkakZmcWZLZjlRJnByb21wdD1ub25lJnNjb3BlPWVtYWlsJTIwcHJvZmlsZSUyMGh0dHBzJTNBJTJGJTJGd3d3Lmdvb2dsZWFwaXMuY29tJTJGYXV0aCUyRnVzZXJpbmZvLmVtYWlsJTIwaHR0cHMlM0ElMkYlMkZ3d3cuZ29vZ2xlYXBpcy5jb20lMkZhdXRoJTJGdXNlcmluZm8ucHJvZmlsZSUyMG9wZW5pZCZzdGF0ZT1ockJ0NzRKQnBEZDlJUHVzM202VjFyR3RIVGxvSWdCVVhXSUFvTzRsIjt9fQ==', 1748027909), +('uaBor0tr1UM7FQUd8Jxyc8GCUzmwbHVL9hPiKN5N', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoic2VoSGs2a29ycHEyVlYwWWswYmNJMGlZT2JNZ05QYTFCdDJ5VlZTVSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748026510), +('uOWLUBFdLtqQKGA8d0xtA5nw2tioQUJecOrwM3Q2', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoibmxvTVRBVkFmY0gzRkRwTDhzNmFqc2FSWWdtbFlhc1M0R1o2ZHNFZCI7czo1OiJlcnJvciI7czo0MDoiU29tZXRoaW5nIHdlbnQgd3Jvbmcgd2l0aCBnb29nbGUgbG9naW46ICI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJuZXciO2E6MDp7fXM6Mzoib2xkIjthOjE6e2k6MDtzOjU6ImVycm9yIjt9fXM6OToiX3ByZXZpb3VzIjthOjE6e3M6MzoidXJsIjtzOjM1NzoiaHR0cDovL2Nsb3RoaW5nc3RvcmUubG9jYWxob3N0LmNvbS9hdXRoL2dvb2dsZS9jYWxsYmFjaz9hdXRodXNlcj0wJmNvZGU9NCUyRjBBVUpSLXg0Qm1SNWlwM0o4cmxlNDY5bmVaSVNGc1hhTFdzeDVMd3pkSnphdmZRQWJSRENxMGd1S2VLZzRfNUhFYldZdFBBJnByb21wdD1ub25lJnNjb3BlPWVtYWlsJTIwcHJvZmlsZSUyMGh0dHBzJTNBJTJGJTJGd3d3Lmdvb2dsZWFwaXMuY29tJTJGYXV0aCUyRnVzZXJpbmZvLmVtYWlsJTIwaHR0cHMlM0ElMkYlMkZ3d3cuZ29vZ2xlYXBpcy5jb20lMkZhdXRoJTJGdXNlcmluZm8ucHJvZmlsZSUyMG9wZW5pZCZzdGF0ZT1nczRJandEckk1RGJMVHdFemZ6aWtCRGRxQnlkVVFTT3lzUUQyeVBiIjt9fQ==', 1748027040), +('y5zBryCPPLcbpJH1xLz7ZkpIseBJbLHAbCJp2uyY', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoieVBVOUVFQ0xtM2d0MVBxaWJnSTlDVXVZODdMV09yUkYxd1ROUWc2TSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748027054), +('ZR8HZRHbGrGaX5YcQ3YTeiohkVgWULbx0a1XuIMc', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiMzVVWFhkeWRRc1pIUmpTQ3JsM2VxVHZFYnE5bDV6a2ZkR3MzZlF3MSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly9jbG90aGluZ3N0b3JlLmxvY2FsaG9zdC5jb20vbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1748027086); -- -------------------------------------------------------- @@ -528,13 +574,13 @@ ALTER TABLE `migrations` -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; + MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `order_items` -- ALTER TABLE `order_items` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; + MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `permissions` @@ -552,7 +598,7 @@ ALTER TABLE `permission_role` -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; + MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -- -- AUTO_INCREMENT for table `roles` @@ -564,13 +610,13 @@ ALTER TABLE `roles` -- AUTO_INCREMENT for table `role_user` -- ALTER TABLE `role_user` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; + MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; + MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27; -- -- Constraints for dumped tables diff --git a/package-lock.json b/ClothingStore/package-lock.json similarity index 100% rename from package-lock.json rename to ClothingStore/package-lock.json diff --git a/package.json b/ClothingStore/package.json similarity index 100% rename from package.json rename to ClothingStore/package.json diff --git a/phpunit.xml b/ClothingStore/phpunit.xml similarity index 100% rename from phpunit.xml rename to ClothingStore/phpunit.xml diff --git a/public/.htaccess b/ClothingStore/public/.htaccess similarity index 100% rename from public/.htaccess rename to ClothingStore/public/.htaccess diff --git a/ClothingStore/public/clear-cache.php b/ClothingStore/public/clear-cache.php new file mode 100644 index 0000000..75c108d --- /dev/null +++ b/ClothingStore/public/clear-cache.php @@ -0,0 +1,42 @@ +make(Illuminate\Contracts\Console\Kernel::class); +$kernel->bootstrap(); + +echo "
✅ Application cache cleared
"; +} catch (Exception $e) { + echo "❌ Error clearing application cache: " . $e->getMessage() . "
"; +} + +try { + // Clear route cache + $kernel->call('route:clear'); + echo "✅ Route cache cleared
"; +} catch (Exception $e) { + echo "❌ Error clearing route cache: " . $e->getMessage() . "
"; +} + +try { + // Clear config cache + $kernel->call('config:clear'); + echo "✅ Config cache cleared
"; +} catch (Exception $e) { + echo "❌ Error clearing config cache: " . $e->getMessage() . "
"; +} + +try { + // Clear view cache + $kernel->call('view:clear'); + echo "✅ View cache cleared
"; +} catch (Exception $e) { + echo "❌ Error clearing view cache: " . $e->getMessage() . "
"; +} + +echo "Done! Return to home
"; \ No newline at end of file diff --git a/public/css/bootstrap.min.css b/ClothingStore/public/css/bootstrap.min.css similarity index 100% rename from public/css/bootstrap.min.css rename to ClothingStore/public/css/bootstrap.min.css diff --git a/public/css/elegant-icons.css b/ClothingStore/public/css/elegant-icons.css similarity index 100% rename from public/css/elegant-icons.css rename to ClothingStore/public/css/elegant-icons.css diff --git a/public/css/font-awesome.min.css b/ClothingStore/public/css/font-awesome.min.css similarity index 100% rename from public/css/font-awesome.min.css rename to ClothingStore/public/css/font-awesome.min.css diff --git a/public/css/magnific-popup.css b/ClothingStore/public/css/magnific-popup.css similarity index 100% rename from public/css/magnific-popup.css rename to ClothingStore/public/css/magnific-popup.css diff --git a/public/css/nice-select.css b/ClothingStore/public/css/nice-select.css similarity index 100% rename from public/css/nice-select.css rename to ClothingStore/public/css/nice-select.css diff --git a/public/css/owl.carousel.min.css b/ClothingStore/public/css/owl.carousel.min.css similarity index 100% rename from public/css/owl.carousel.min.css rename to ClothingStore/public/css/owl.carousel.min.css diff --git a/public/css/slicknav.min.css b/ClothingStore/public/css/slicknav.min.css similarity index 100% rename from public/css/slicknav.min.css rename to ClothingStore/public/css/slicknav.min.css diff --git a/ClothingStore/public/css/social-login.css b/ClothingStore/public/css/social-login.css new file mode 100644 index 0000000..40494df --- /dev/null +++ b/ClothingStore/public/css/social-login.css @@ -0,0 +1,57 @@ +/** + * Social Login Buttons Styling + */ +.social-btn { + color: white; + margin: 5px; + transition: all 0.3s ease; + padding: 8px 15px; + border-radius: 4px; + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 120px; +} + +.social-btn:hover { + opacity: 0.9; + color: white; + transform: translateY(-2px); + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); +} + +.social-btn i { + margin-right: 8px; +} + +.facebook-btn { + background-color: #3b5998; +} + +.google-btn { + background-color: #dd4b39; +} + +.github-btn { + background-color: #333333; +} + +.twitter-btn { + background-color: #1DA1F2; +} + +.linkedin-btn { + background-color: #0077b5; +} + +.social-auth-links { + margin-top: 25px; + border-top: 1px solid #e5e5e5; + padding-top: 20px; +} + +.social-auth-links p { + margin-bottom: 15px; + color: #6c757d; + font-weight: 500; +} diff --git a/public/css/style.css b/ClothingStore/public/css/style.css similarity index 100% rename from public/css/style.css rename to ClothingStore/public/css/style.css diff --git a/public/css/style.css.map b/ClothingStore/public/css/style.css.map similarity index 100% rename from public/css/style.css.map rename to ClothingStore/public/css/style.css.map diff --git a/public/css/style2.css b/ClothingStore/public/css/style2.css similarity index 100% rename from public/css/style2.css rename to ClothingStore/public/css/style2.css diff --git a/ClothingStore/public/debug-charts.php b/ClothingStore/public/debug-charts.php new file mode 100644 index 0000000..fdd6e91 --- /dev/null +++ b/ClothingStore/public/debug-charts.php @@ -0,0 +1,130 @@ +make(Illuminate\Contracts\Http\Kernel::class); +$response = $kernel->handle( + $request = Illuminate\Http\Request::capture() +); + +use App\Models\Order; +use App\Models\User; +use Illuminate\Support\Facades\DB; +use Carbon\Carbon; +use Illuminate\Support\Facades\Log; + +echo ""; + print_r($monthlySales); + echo ""; + } catch (\Exception $e) { + echo "
" . $e->getMessage() . "
"; + } + + // Generate customer sales data + try { + $customerSales = DB::table('orders') + ->join('users', 'orders.user_id', '=', 'users.id') + ->select('users.name', DB::raw('SUM(orders.total_amount) as total')) + ->groupBy('users.id', 'users.name') + ->orderBy('total', 'desc') + ->limit(10) + ->get() + ->map(function($item) { + return [ + 'name' => $item->name, + 'total' => (float)$item->total + ]; + })->toArray(); + + echo ""; + print_r($customerSales); + echo ""; + } catch (\Exception $e) { + echo "
" . $e->getMessage() . "
"; + } + + // Get order status counts + $statusCounts = [ + 'pending' => Order::where('status', 'pending')->count(), + 'processing' => Order::where('status', 'processing')->count(), + 'completed' => Order::where('status', 'completed')->count(), + 'cancelled' => Order::where('status', 'cancelled')->count() + ]; + + echo ""; + print_r($statusCounts); + echo ""; + + // Output everything as JSON + echo json_encode([ + 'stats' => $stats, + 'recent_orders' => $orderData, + 'chart_data' => [ + 'monthly_sales' => $monthlySales, + 'customer_sales' => $customerSales, + 'status_counts' => $statusCounts + ] + ], JSON_PRETTY_PRINT); + +} catch (Exception $e) { + echo json_encode([ + 'error' => $e->getMessage(), + 'trace' => $e->getTraceAsString() + ], JSON_PRETTY_PRINT); +} \ No newline at end of file diff --git a/ClothingStore/public/direct-charts.php b/ClothingStore/public/direct-charts.php new file mode 100644 index 0000000..07c65f1 --- /dev/null +++ b/ClothingStore/public/direct-charts.php @@ -0,0 +1,316 @@ +make(Illuminate\Contracts\Console\Kernel::class); +$kernel->bootstrap(); + +use App\Models\Order; +use App\Models\User; +use Illuminate\Support\Facades\DB; +use Carbon\Carbon; + +try { + // Generate monthly sales data - manual approach + $monthly = []; + $sixMonthsAgo = Carbon::now()->subMonths(6)->startOfMonth(); + $ordersForChart = Order::where('created_at', '>=', $sixMonthsAgo) + ->get(); + + // Group by month and calculate totals + $ordersByMonth = []; + foreach ($ordersForChart as $order) { + $monthKey = $order->created_at->format('Y-m'); + $monthDisplay = $order->created_at->format('M Y'); + + if (!isset($ordersByMonth[$monthKey])) { + $ordersByMonth[$monthKey] = [ + 'month' => $monthDisplay, + 'total' => 0 + ]; + } + + $ordersByMonth[$monthKey]['total'] += $order->total_amount; + } + + // Sort by month + ksort($ordersByMonth); + + // Convert to indexed array + $monthly = array_values($ordersByMonth); + + // Generate customer sales data - manual approach + $customers = []; + $userTotals = []; + + foreach ($ordersForChart as $order) { + $userId = $order->user_id; + $userName = $order->user->name ?? 'Unknown User'; + + if (!isset($userTotals[$userId])) { + $userTotals[$userId] = [ + 'name' => $userName, + 'total' => 0 + ]; + } + + $userTotals[$userId]['total'] += $order->total_amount; + } + + // Sort by total sales (descending) + usort($userTotals, function($a, $b) { + return $b['total'] <=> $a['total']; + }); + + // Get top 10 customers + $customers = array_slice(array_values($userTotals), 0, 10); + + // Get order status counts + $statusCounts = [ + 'pending' => Order::where('status', 'pending')->count(), + 'processing' => Order::where('status', 'processing')->count(), + 'completed' => Order::where('status', 'completed')->count(), + 'cancelled' => Order::where('status', 'cancelled')->count() + ]; + + // If no data, create sample data + if (empty($monthly)) { + $monthly = [ + ['month' => 'Jan 2023', 'total' => 12500], + ['month' => 'Feb 2023', 'total' => 17800], + ['month' => 'Mar 2023', 'total' => 14200], + ['month' => 'Apr 2023', 'total' => 22000], + ['month' => 'May 2023', 'total' => 25000] + ]; + } + + if (empty($customers)) { + $customers = [ + ['name' => 'Customer User', 'total' => 45050], + ['name' => 'John Doe', 'total' => 23500], + ['name' => 'Jane Smith', 'total' => 18700], + ['name' => 'Robert Johnson', 'total' => 12400], + ['name' => 'Lisa Brown', 'total' => 8900] + ]; + } + + // Convert data to JSON for JavaScript + $monthlyDataJson = json_encode($monthly); + $customerDataJson = json_encode($customers); + $statusDataJson = json_encode($statusCounts); + + // Output HTML with embedded charts + header('Content-Type: text/html'); +} catch (Exception $e) { + $error = $e->getMessage(); + $trace = $e->getTraceAsString(); +} +?> + + + + + +
This page tests if Chart.js is working correctly in your browser.
+ +