I have 2 models: ArticleCategory and Article. Article category has many articles. In the article category blueprint I added HasMany fieldtype for that relationship. Adding article to article category works well, as expected, but when I try to unlink the article from article category the article gets deleted instead of just 'unlink'.
By 'unlink' I mean that article_category_id column should have value NULL. Also, it is worth mentioning that I implemented soft deletion for article so articles get soft deleted, not permanently deleted. (just in case it helps in detecting the problem)
ArticleCategory model has 'articles' eloquent relationship.
I provide you with both blueprints and migrations:
Description
I have 2 models: ArticleCategory and Article. Article category has many articles. In the article category blueprint I added HasMany fieldtype for that relationship. Adding article to article category works well, as expected, but when I try to unlink the article from article category the article gets deleted instead of just 'unlink'.
By 'unlink' I mean that article_category_id column should have value NULL. Also, it is worth mentioning that I implemented soft deletion for article so articles get soft deleted, not permanently deleted. (just in case it helps in detecting the problem)
ArticleCategory model has 'articles' eloquent relationship.
I provide you with both blueprints and migrations:
article blueprint
article category blueprint
articles migration
article categories migration
Steps to reproduce
Environment
Environment Application Name: Statamic Laravel Version: 11.19.0 PHP Version: 8.3.10 Composer Version: 2.7.7 Environment: local Debug Mode: ENABLED URL: localhost:8080 Maintenance Mode: OFF Timezone: Europe/Zurich Locale: de
Cache Config: NOT CACHED Events: NOT CACHED Routes: NOT CACHED Views: CACHED
Drivers Broadcasting: null Cache: file Database: sqlite Logs: stack / daily Mail: log Queue: sync Scout: collection Session: file
Locales Installed: de, en, fr LaravelLang\Lang\Plugin: 15.5.6 Locales Version: 2.9.2 Protected: de Publisher Version: 16.4.0
Sentry Enabled: MISSING DSN Environment: local Laravel SDK Version: 4.7.1 PHP SDK Version: 4.8.1 Release: NOT SET Sample Rate Errors: 100% Sample Rate Performance Monitoring: NOT SET Sample Rate Profiling: NOT SET Send Default PII: DISABLED
Statamic Addons: 3 Sites: 1 Stache Watcher: Disabled Static Caching: Disabled Version: 5.19.0 PRO
Statamic Addons statamic-rad-pack/runway: 7.7.3 statamic/eloquent-driver: 4.12.0 tv2regionerne/statamic-safeguard: 1.4.0
Statamic Eloquent Driver Asset Containers: file Assets: eloquent Blueprints: file Collection Trees: eloquent Collections: file Entries: eloquent Forms: file Global Sets: file Global Variables: eloquent Navigation Trees: eloquent Navigations: file Revisions: file Sites: file Taxonomies: file Terms: eloquent Tokens: eloquent