-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table Relationship #24
Comments
You can just do: foreach ($users as $user) {
$posts = Post::where('user_id', $user->user_id)->get();
} |
Yes Thank you so much, it got the data
but how to get "Tony"? |
Just do Closing since this question actually has nothing to do with this library. I suggest you reading up on Laravel Eloquent docs first. |
and now I got this
how can I get the first_name -- "Tony"? |
|
But it hv an error
After define {{$user = App\User::find($post->user_id)}}
|
Try to debug by looking at the variable type. Sorry I can't help much on this as it has nothing to do with the library |
Hello, I have an question
I want to display all posts in a page
Here is my dynamodb
user_id for me to link, so one user has many posts
I just simply use Auth::user()->user_id to get user id and request body to create a new post item
but how to foreach the following?
The text was updated successfully, but these errors were encountered: