You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two table "archives" and "archives_permission" and data
and Models/Archives.php
public function archivesPermission()
{
return $this->hasMany(ArchivesPermission::class,'archives_uuid','uuid');
}
When I use Archives::with(['archivesPermission'])->first() ,then archivesPermission is empty collection
But When I use Archives::first()->archivesPermission()->get() will get correct data
If I change uuid from "96e45fe0-27d2-499e-8bbc-79c4e1d4d015" to "96d45fe0-27d2-499e-8bbc-79c4e1d4d015", then Archives::with(['archivesPermission'])->first() ,then archivesPermission will get correct data
This discussion was converted from issue #43471 on July 29, 2022 08:33.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Description:
I have two table "archives" and "archives_permission" and data
and Models/Archives.php
When I use
Archives::with(['archivesPermission'])->first()
,then archivesPermission is empty collectionBut When I use
Archives::first()->archivesPermission()->get()
will get correct dataIf I change uuid from "96e45fe0-27d2-499e-8bbc-79c4e1d4d015" to "96d45fe0-27d2-499e-8bbc-79c4e1d4d015", then
Archives::with(['archivesPermission'])->first()
,then archivesPermission will get correct dataSteps To Reproduce:
Beta Was this translation helpful? Give feedback.
All reactions