Astrotomic / laravel-translatable

A Laravel package for multilingual models
https://docs.astrotomic.info/laravel-translatable/
MIT License
1.22k stars 152 forks source link

How to insert data in main post table ? #365

Closed Abdulsami660 closed 8 months ago

Abdulsami660 commented 10 months ago

hi , i have a main post table with column author and a post_translations table which holds title and content column. my question is how can i insert data in author field because documentation says pass $req->all() in create method of Post Model and your translations are inserted and post record as well but in my case author column is giving null and post_translation attribute are inserted Screenshot (96) . please help. Thanks

OpJePl44tsm4n commented 9 months ago

same here, i would expect the original create() function to still work the way it was intended... now it doesn't save because it's missing required fields. (the Query is stating no data is provided and all fields are empty)

Abdulsami660 commented 9 months ago

My issue was solved . Because I didn't mass assign the model..

On Thu, Sep 21, 2023, 4:22 PM Pim @.***> wrote:

same here, i would expect the original create() function to still work the way it was intended... now it doesn't save because it's missing required fields. (the Query is stating no data is provided and all fields are empty)

— Reply to this email directly, view it on GitHub https://github.com/Astrotomic/laravel-translatable/issues/365#issuecomment-1729371305, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWDJ6U45TJEHDLNAOCTKDOTX3QPQJANCNFSM6AAAAAA4FP4U6A . You are receiving this because you authored the thread.Message ID: @.***>

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days