Skip to content
Discussion options

You must be logged in to vote

Hello. You need to establish a relationship between the models.
You can find more details here: https://laravel.com/docs/8.x/eloquent-relationships

After these steps, the final version will look something like this:

   /**
    * Query data.
    *
    * @return array
    */
   public function query(Request $request): array
   {
       return array(
           'keys' => $request->user()->keys()->paginate()
       );
   }

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by szwedzik
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants