A
A
axblue2016-11-27 23:15:11
Laravel
axblue, 2016-11-27 23:15:11

Lots of requests, is that normal?

Hello, tell me, is it normal when there are so many requests? Whether it is possible somehow in a pack one request? Screenshot of requests:
4d73c722b1ca40f79b9483127b34ba2b.jpg
Well, actually on the screen this is just a part of the requests, there are much more of them.
Many-to-many relationship.

public function tags()
{
    return $this->belongsToMany('App\Tag', 'recipe_tags');
}

@foreach($recipes as $recipe)
   @foreach ($recipe->tags as $tag){{$tag->name }} //запросы идут из-за получения тегов рецепта.

   @endforeach
@endforeach

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2016-11-27
@leshikgo

https://laravel.com/docs/5.3/eloquent-relationship...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question