Model
Extending the Model
config/shopper/models.php:
Database Schema
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | no | auto | Primary key |
name | string | no | - | Channel name |
slug | string | yes | auto | URL-friendly identifier (unique) |
description | text | yes | null | Channel description |
timezone | string | yes | null | Channel timezone |
url | string | yes | null | Channel URL |
is_default | boolean | no | false | Default channel flag |
is_enabled | boolean | no | false | Channel visibility |
metadata | json | yes | null | Additional custom data |
created_at | timestamp | yes | null | Creation timestamp |
updated_at | timestamp | yes | null | Last update timestamp |
Relationships
Products
Channels have a many-to-many polymorphic relationship with products:Query Scopes
Observer Behavior
TheChannelObserver ensures only one channel can be default:
Default Channel
You can retrieve the default channel using thedefault scope:
Creating Channels
Default Website Channel
Additional Channels
Retrieving Channels
Assigning Products to Channels
Storefront Example
Multi-Channel API
Use Cases
| Channel | Example Use |
|---|---|
| Website | Main e-commerce storefront |
| Mobile App | iOS/Android application |
| Marketplace | Amazon, eBay, Etsy integration |
| POS | Physical store point of sale |
| Wholesale | B2B customer portal |
| Social | Facebook/Instagram shop |
Best Practices
- Default Channel: Always have one default channel for fallback
- Product Assignment: Assign products to relevant channels during creation
- Timezone: Set appropriate timezone for each channel
- Metadata: Use metadata for channel-specific configuration (API keys, etc.)