Homepage
Main navigation
Main content
Additional information
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Winter CMS resources and help articles
Simple and to the point. Optimized by the community.
×
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Edit trick
Changes will be published after manual review
Title
Give your trick a describing title. Do
not
start with «How to...».
Your trick
Keep it short and concise! Markdown is supported.
If you need to migrate morph-type relations that store the model name in the DB, morphMap is really good for this. That will also take care of translated model fields stored in winter_translate_attributes table. The following morphMap migrates the relations from Lovata.Shopaholic plugin to OFFLINE.Mall plugin: ``` use Winter\Storm\Database\Relations\Relation; public function boot() { Relation::morphMap([ 'Lovata\Shopaholic\Models\Product' => 'OFFLINE\Mall\Models\Product', 'Lovata\Shopaholic\Models\Category' => 'OFFLINE\Mall\Models\Category', ]); } ```
References
Add additional online resources to your trick
×
Name
URL
+ Add reference
Topics
If your trick fits more than one topic select multiple. Select at least one.
Backend
Plugin Development
CMS
Twig
Themes
Deployment
Tags
You can use existing tags or create new ones. Add at least one.
Submit for review
Cancel
We use cookies to measure the performance of this website. Do you want to accept these cookies?
Accept
Decline