# Iz Mart BD — Laravel setup

Laravel 12 · PHP 8.2 · MySQL/MariaDB (XAMPP) · database: `izmartbd_update`

## 1. First-time setup

```bash
cd izmartbd
composer install
cp .env.example .env        # already done locally
php artisan key:generate    # already done locally
```

`.env` database settings (already set):

```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=izmartbd_update
DB_USERNAME=root
DB_PASSWORD=
```

## 2. Create the database + tables + demo data

1. Start **MySQL** from the XAMPP Control Panel.
2. Create the database (phpMyAdmin → New → `izmartbd_update`, collation `utf8mb4_unicode_ci`), or:
   ```bash
   C:\xampp\mysql\bin\mysql.exe -u root -e "CREATE DATABASE IF NOT EXISTS izmartbd_update CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
   ```
3. Tables + demo data:
   ```bash
   php artisan migrate --seed
   php artisan storage:link
   ```

## 3. Run

```bash
php artisan serve
```

- Website: http://127.0.0.1:8000
- Admin panel: http://127.0.0.1:8000/admin
  - Email: `admin@izmartbd.com`
  - Password: `password`  ⚠️ change this before going live (Admin → Profile)

## 4. Before going live

- Admin → Settings: put Iz Mart BD's real hotline, email, office addresses and Google Map locations
  (the seeded values are placeholders copied from the reference design).
- Change the admin password.
- `.env`: `APP_ENV=production`, `APP_DEBUG=false`, set `APP_URL` to your domain.
- Payment gateways (bKash / Nagad / SSLCommerz) are **not integrated yet** — orders are saved with
  `payment_status = unpaid`. See `TODO` in `app/Http/Controllers/CheckoutController.php`.

## Project map

| Part | Where |
|---|---|
| Storefront routes | `routes/web.php` |
| Admin routes | `routes/admin.php` |
| Storefront controllers | `app/Http/Controllers/*.php` |
| Admin controllers | `app/Http/Controllers/Admin/` |
| Session cart + totals | `app/Services/Cart.php` |
| Models | `app/Models/` |
| Tables | `database/migrations/` |
| Demo data | `database/seeders/DatabaseSeeder.php` + `database/seeders/data/*.json` |
| Layout (header/footer) | `resources/views/layouts/app.blade.php` |
| Pages | `resources/views/` |
| CSS / JS (no build step) | `public/assets/css/`, `public/assets/js/` |
