Welcome to the Laravel Web Shop! This application is designed to provide a seamless shopping experience with advanced features and secure payment integration. Below you'll find a detailed overview of the technologies used, features available, and instructions for setting up and running the application.
- Laravel 11: A robust PHP framework for web artisans.
- Livewire: A full-stack framework for Laravel that makes building dynamic interfaces simple, without leaving the comfort of Laravel.
- Tailwind CSS: A utility-first CSS framework for rapid UI development.
- Stripe: A payment processing platform integrated using Laravel Cashier.
- Guest Add to Cart: Visitors can add products to the cart without needing to log in.
- Cart Persistence: When a guest user logs in, the items in their cart are retained and merged with their account.
- Product Variants: Users can select different product variants (e.g., size, color) and add them to the cart.
- Stripe Payment Gateway: Secure payment processing through Stripe, integrated using Laravel Cashier.
- Abandoned Cart Reminder: Sends an email reminder to users daily if they have items in their cart but haven't completed the purchase.
- Auto-Cleanup for Guest Carts: Guest carts are automatically deleted after being inactive for more than a day.
- Order Management: Users can view their order history.
- Order Confirmation: Sends an email confirmation after a successful order.
- Product Search: Allows users to search for products.
- Pagination: Efficiently handles large lists of products by paginating them.
-
Clone the repository:
git clone https://github.com/jareerzeenam/laravel-webshop.git cd laravel-web-shop-app
-
Install dependencies:
composer install npm install npm run dev
-
Environment configuration: Copy the
.env.example
file to.env
and update the necessary environment variables, especially for database and Stripe API keys.cp .env.example .env php artisan key:generate
-
Run migrations:
php artisan migrate
-
Run the application:
php artisan serve
-
Set up email notifications: Ensure that your email settings are correctly configured in the
.env
file to enable email notifications for abandoned carts and order confirmations.
-
Install Stripe CLI: Download the Stripe CLI from the following link: Stripe CLI
-
Listen to webhook events locally: After installing the Stripe CLI, run the following command to listen to webhook events:
stripe listen --forward-to YOUR_LOCAL_URL/stripe/webhook --format JSON
-
Set up webhook secret: Get the webhook signing secret from the Stripe dashboard and add it to the
.env
file asSTRIPE_WEBHOOK_SECRET
.STRIPE_WEBHOOK_SECRET=whsec_...
This feature sends an email reminder to users daily if they have items in their cart but haven't completed the purchase.
- Command:
app/Console/Commands/AbandonedCart.php
- Schedule: The command is already scheduled in
routes/console.php
to run daily:Schedule::command(AbandonedCart::class)->dailyAt('9:00');
This feature deletes guest carts that have been inactive for more than a day.
- Command:
app/Console/Commands/RemoveInactiveSessionCart.php
- Schedule: The command is already scheduled in
routes/console.php
to run weekly:Schedule::command(RemoveInactiveSessionCart::class)->weekly();
Once the application is set up, you can start exploring the various features:
- Browse and search for products.
- Select different product variants and add them to the cart.
- Add products to the cart as a guest or logged-in user.
- Proceed to checkout using Stripe.
- Receive email notifications for abandoned carts and order confirmations.
- View your order history from the "My Orders" page.
For any issues or contributions, please create an issue or a pull request on the GitHub repository.
Happy Coding!