A comprehensive, modern eCommerce platform built with Laravel 12, featuring a beautiful storefront and powerful admin panel with role-based access control.
- Product Catalog: Browse products by categories with advanced filtering & sorting
- Live Search: Real-time product search with dropdown results (triggers after 3 characters, shows up to 20 products with images, prices, categories, and stock status)
- Shopping Cart (AJAX): Add to cart, inline increase/decrease, and remove without page reload; live header count
- Coupons: Apply/remove coupons (AJAX) with discount reflected in totals
- Checkout Process: Secure checkout with validation and order creation, email notification
- Payment Methods: Stripe, PayPal, and Cash on Delivery (COD) - all configurable from admin panel
- Currency: Default currency enforced globally via
@currency(...)(frontend switching disabled) - Coins (Loyalty Points): Earn coins for add‑to‑cart, order placement, COD choice, and referral sign‑ups. Balance shown on profile; admin can adjust/reset.
- Product Reviews & Ratings: Customers can leave reviews with ratings (1-5 stars), verified purchase badges, and admin moderation
- Newsletter: Email subscription system with double opt-in support and welcome emails
- Pages System: Customizable content pages (Help Center, Shipping Info, Returns, Contact Us) with rich text editor
- Wishlist: Add products to wishlist (supports both authenticated users and guests)
- Responsive Design: Mobile-first Bootstrap 5 UI (storefront) with modern components
- User Authentication: Login, register, profile update, password change
- User Profile: View orders, addresses, reviews, and coin balance
- Dashboard: Stats tiles + 14‑day Orders/Revenue charts; Recent Orders; Low Stock
- Products/Categories: Full CRUD with images, hierarchical categories, rich text editor for descriptions
- Orders: Index/show/update; colored badges for Status/Payment/Shipping
- Users: View user details, orders, cart items, wishlist, sessions; adjust/reset coins
- Roles/Permissions: Spatie permissions with route‑based checks; route permissions auto-listed
- Administrators: Manage admin users and assign roles (Admin → Administrators)
- Pages Management: CRUD for custom pages (Help Center, Shipping Info, Returns, Contact Us) with rich text editor
- Reviews Management: Approve/reject/delete product reviews; filter by status
- Newsletter Subscribers: Manage newsletter subscribers, toggle subscription status
- Site Settings: Comprehensive settings including:
- Basic site information (name, tagline, logo, favicon)
- SEO settings (meta title, description, keywords)
- Legal & footer links (privacy, terms, cookies, customer service links)
- Social media links
- Feature toggles (wishlist, reviews, newsletter)
- Review settings (enable/disable, require purchase, require approval, allow anonymous)
- Newsletter settings (enable/disable, double opt-in, welcome email)
- Payment Gateways: Stripe/PayPal/COD configure, enable/disable, test connection; logs
- Currencies: CRUD, set default/toggle active, rates & formatting
- Email Settings: Admin-managed SMTP applied at runtime
- Coin Settings: Configure coin awards (add‑to‑cart award + daily cap, order award rate/minimum, COD bonus, referral signup bonus) and enable/disable features
- Shipping Settings: Enable/disable shipping, free‑shipping threshold, per‑country/city rates (flat/percent), global fallback rate
- OTP Settings: Configure email and SMS OTP settings
- Server-Side DataTables: All admin tables use server-side processing for better performance with search, filters, and pagination
- Breadcrumbs: Automatic breadcrumb navigation throughout admin panel
- Role-Based Access Control (RBAC): Using Spatie Laravel Permission
- Route-Based Permissions: Individual permissions for each admin route (automatically discovered)
- User Authorization: Users can only access their own orders and data
- CSRF Protection: Built-in Laravel security features
- Input Validation: Comprehensive form validation and sanitization
- XSS Protection: All user inputs are properly escaped
- Eloquent ORM: Clean, expressive database interactions
- Database Migrations: Version-controlled database schema
- Model Factories: Automated test data generation
- Pagination: Efficient data loading with Bootstrap 5 pagination
- Server-Side Processing: DataTables with AJAX for large datasets
- API Ready: RESTful API endpoints for mobile app integration
- Session Management: Secure cart and user session handling
- Referral System: Shareable
/r/{code}links; awards referrer on successful signup - Rich Text Editor: Quill editor for product descriptions and page content
- Live Search: AJAX-powered real-time product search with debouncing
- Clean Architecture: Follows Laravel best practices and MVC pattern
- Extensible: Easy to add new features and customize functionality
- Well Documented: Comprehensive code comments and structure
- Modern Stack: Built with latest Laravel 12 and PHP 8.3+
- Security First: Implements industry-standard security practices
- Performance Optimized: Server-side processing, eager loading, efficient queries
- Complete Solution: Everything needed to start selling online
- Professional Design: Modern, responsive interface that builds trust
- Easy Management: Intuitive admin panel for non-technical users
- Customer Engagement: Reviews, ratings, newsletter, and loyalty points
- Scalable: Built to handle growth from startup to enterprise
- Cost Effective: Open source solution with no licensing fees
- Fast Performance: Optimized for speed and user experience
- Mobile Friendly: Perfect shopping experience on all devices
- Secure Checkout: Safe and reliable payment processing
- Order Tracking: Complete visibility into order status and history
- Product Reviews: Read and write reviews to make informed decisions
- Live Search: Quick product discovery with instant results
- PHP: 8.3 or higher
- Composer: Latest version
- Database: MySQL, PostgreSQL, or SQLite
- Web Server: Apache, Nginx, or Laravel Valet
- Node.js: For asset compilation (optional)
git clone https://github.com/needyamin/eCommerceLaravel
cd eCommerceLaravelcomposer install
npm installcp .env.example .env
php artisan key:generateUpdate your .env file with database credentials:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=ecommerce_laravel
DB_USERNAME=your_username
DB_PASSWORD=your_passwordphp artisan migrate --seedThis will:
- Create admin and test user accounts
- Set up roles and permissions (automatically discovers all admin routes)
- Seed categories, products, currencies, coupons
- Configure default site settings (reviews, newsletter, etc.)
- Create default customer service pages (Help Center, Shipping Info, Returns, Contact Us)
Optional seeders (recommended for admin RBAC and payments):
php artisan db:seed --class=Database\Seeders\AdminRoutePermissionsSeeder
php artisan db:seed --class=Database\Seeders\PaymentGatewaySettingsSeeder
php artisan db:seed --class=Database\Seeders\PageSeederIf you're upgrading an existing install, run these specific migrations:
php artisan migrate --path=database/migrations/2025_10_24_130000_add_coins_to_users_and_create_user_points_table.php
php artisan migrate --path=database/migrations/2025_10_24_131000_create_coin_settings_table.php
php artisan migrate --path=database/migrations/2025_10_24_132000_add_referral_fields_to_users_table.php
php artisan migrate --path=database/migrations/2025_10_24_133000_add_flags_to_coin_settings_table.php
php artisan migrate --path=database/migrations/2025_10_24_134000_create_shipping_settings_table.php
php artisan migrate --path=database/migrations/2025_10_24_134500_add_global_rate_to_shipping_settings_table.php
php artisan migrate --path=database/migrations/2025_11_07_022231_create_product_reviews_table.php
php artisan migrate --path=database/migrations/2025_11_07_022251_add_review_settings_to_site_settings_table.php
php artisan migrate --path=database/migrations/2025_11_07_023046_add_newsletter_settings_to_site_settings_table.php
php artisan migrate --path=database/migrations/2025_11_07_024826_add_customer_service_links_to_site_settings_table.php
php artisan migrate --path=database/migrations/2025_11_07_025029_create_pages_table.phpAfter migrating, visit Admin → Site Settings, Admin → Coin Settings, and Admin → Shipping Settings to configure.
npm run dev
# or for production
npm run buildphp artisan serveVisit http://localhost:8000 to see your eCommerce store!
- Email:
[email protected] - Password:
password - Role: Super Admin
- Email:
[email protected] - Password:
password
├── app/
│ ├── Http/Controllers/
│ │ ├── Admin/ # Admin panel controllers
│ │ │ ├── DataTableController.php # Server-side DataTables handler
│ │ │ ├── PageController.php # Pages CRUD
│ │ │ ├── ReviewController.php # Reviews management
│ │ │ └── ... # Other admin controllers
│ │ ├── Api/ # API controllers
│ │ ├── ProductController.php # Frontend products (includes search)
│ │ ├── ReviewController.php # Frontend reviews
│ │ ├── PageController.php # Frontend pages
│ │ └── NewsletterController.php # Newsletter subscription
│ ├── Models/ # Eloquent models
│ │ ├── ProductReview.php # Product reviews model
│ │ ├── Page.php # Pages model
│ │ └── ...
│ └── Providers/ # Service providers
├── database/
│ ├── migrations/ # Database schema
│ │ ├── create_product_reviews_table.php
│ │ ├── create_pages_table.php
│ │ ├── add_review_settings_to_site_settings_table.php
│ │ ├── add_newsletter_settings_to_site_settings_table.php
│ │ └── add_customer_service_links_to_site_settings_table.php
│ ├── seeders/ # Sample data
│ │ ├── PageSeeder.php # Default pages seeder
│ │ └── ...
│ └── factories/ # Model factories
├── resources/
│ ├── views/
│ │ ├── admin/ # Admin panel views
│ │ │ ├── pages/ # Pages CRUD views
│ │ │ ├── reviews/ # Reviews management views
│ │ │ └── ...
│ │ ├── pages/ # Frontend page views
│ │ ├── layouts/ # Layout templates
│ │ ├── partials/ # Partial views
│ │ │ └── nav.blade.php # Navigation with live search
│ │ └── ... # Frontend views
│ └── css/ # Stylesheets
├── routes/
│ ├── web.php # Web routes
│ └── api.php # API routes
└── public/
└── admin-assets/ # Admin theme assets
The admin panel uses AdminLTE theme. Customize the appearance by modifying:
resources/views/admin/layouts/app.blade.phpresources/views/admin/partials/sidebar.blade.phppublic/admin-assets/css/adminlte.css
- Admin routes are protected by route‑name permissions (e.g.,
admin.products.edit). - Use Admin → Role & Permission to assign both named and route‑based permissions.
- Route permissions are automatically discovered and created by
AdminRoutePermissionsSeeder. - Seed all current admin route permissions and grant to Super Admin:
php artisan db:seed --class=Database\Seeders\AdminRoutePermissionsSeederConfigure all site-wide settings from Admin → Site Settings:
- Basic Information: Site name, tagline, logo, favicon
- SEO: Meta title, description, keywords
- Legal & Footer: Footer text, privacy/terms/cookies URLs, customer service links
- Social Media: Facebook, Twitter, Instagram, LinkedIn links
- Feature Toggles: Enable/disable wishlist, reviews, newsletter
- Review Settings: Control review requirements (purchase, approval, anonymous)
- Newsletter Settings: Configure double opt-in and welcome emails
Create and manage custom pages from Admin → Pages:
- Use rich text editor (Quill) for content
- Set SEO meta tags per page
- Control visibility with active/inactive status
- Sort pages with sort order
- Default pages: Help Center, Shipping Info, Returns, Contact Us
- Frontend: Customers can leave reviews on product pages (if enabled)
- Settings: Control via Admin → Site Settings → Review Settings
- Management: Approve/reject/delete reviews from Admin → Reviews
- Features: Star ratings (1-5), verified purchase badges, admin moderation
You can configure SMTP at runtime from Admin → Email Settings (no .env edit required). For local setup via .env, use:
MAIL_MAILER=smtp
MAIL_HOST=your-smtp-host
MAIL_PORT=587
MAIL_USERNAME=your-email
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME="Your Store"- Admin → Coin Settings: toggle coins system on/off and configure awards
- Profile shows coin balance; admin user page allows Adjust and Reset
- Admin → Shipping Settings: enable shipping, set free shipping minimum, define per‑country/city rates, and a global fallback rate
- Checkout totals include dynamic shipping and currency formatting
- Stripe: Configure API keys, enable/disable, test connection
- PayPal: Configure client ID/secret, enable/disable, sandbox mode
- Cash on Delivery (COD): Enable/disable from Admin → Payment Gateways → COD
- All payment methods are configurable from Admin → Payment Gateways
The system includes RESTful API endpoints for mobile app integration:
POST /api/register- User registrationPOST /api/login- User loginPOST /api/logout- User logout
GET /api/categories- List categoriesGET /api/products- List productsGET /api/products/{id}- Get product detailsGET /products/search?q={query}- Live search (returns JSON, requires 3+ characters)
GET /api/cart- Get user cartPOST /api/cart/add- Add item to cartGET /api/orders- List user ordersGET /api/orders/{id}- Get order details
POST /products/{product}/reviews- Submit a product review (authenticated)DELETE /reviews/{review}- Delete own review (authenticated)
GET /page/{slug}- View a custom page
POST /newsletter/subscribe- Subscribe to newsletterPOST /newsletter/unsubscribe- Unsubscribe from newsletterGET /newsletter/confirm/{token}- Confirm subscription (double opt-in)
- Email & SMS OTP request/verify endpoints (UI available under
/otp/emailand/otp/sms)
Run the test suite:
php artisan testNote: If using SQLite for tests, ensure pdo_sqlite is installed; or configure tests to use MySQL by setting DB_CONNECTION=mysql for the testing environment.
Generate test data:
php artisan db:seed --class=DatabaseSeeder- Set
APP_ENV=productionin.env - Run
php artisan config:cache - Run
php artisan route:cache - Run
php artisan view:cache - Set up proper web server configuration
- Configure SSL certificate
- Set up database backups
-
Copy environment file:
cp .env.docker.example .env
-
Update
.envfile with your configuration -
Build and start containers:
docker-compose up -d --build
-
Install dependencies and setup:
docker-compose exec app composer install docker-compose exec app php artisan key:generate docker-compose exec app php artisan migrate --seed docker-compose exec app php artisan storage:link
-
Access the application:
- Frontend: http://localhost:8000
- Database: localhost:3306
- Redis: localhost:6379
For production deployment, use the production override:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --buildSee DOCKER.md for detailed Docker setup instructions, SSL configuration, backup strategies, and troubleshooting.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Laravel - The PHP framework
- AdminLTE - Admin panel theme
- Spatie Laravel Permission - Role and permission management
- Bootstrap 5 - CSS framework
- Quill - Rich text editor
- DataTables - Advanced table features
For support, email [email protected] or create an issue on GitHub.
Built with ❤️ using Laravel 12