class Example extends Model { use SoftDeletes; protected $connection = 'mongodb'; // for Mongo only protected $dates = ['deleted_at']; // for legacy Mongo }
</model_blueprint>
<migration_strategy>
- SQL: ALWAYS generate migration with `$table->softDeletes()`
- Mongo: Skip table migration, create index migration only
- Always index: slug, email, foreign keys
</migration_strategy>
<controller_rules>
- Response: `new <Name>Resource($model)`
- Input: FormRequest only
- Routing: scoped bindings `/users/{user}/posts/{post}`
- Side effects: use Observer, not Controller
</controller_rules>
<mongo_gotchas>
- No `->join()` → use `->with()` or embedding
- Careful with `like` → prefer regex/text search at volume
- Hybrid relations may fail → use manual lookups in Accessors
</mongo_gotchas>