What is Tagging in Laravel?

0 votes
I have a website that receive  so many request  for data from user. How can i identify when response to that particular request using Laravel service called tagging? Explain me about this concept?

Thank you!!
Mar 26 in Laravel by kartik
• 27,360 points
83 views

1 answer to this question.

0 votes

Hii @kartik,

Occasionally, you may need to resolve all of a certain “category” of binding. 

For example, perhaps you are building a report aggregator that receives an array of many different Report interface implementations. After registering the Report implementations, you can assign them a tag using the tag method:

$this->app->bind(‘SpeedReport’, function () {
//
});

$this->app->bind(‘MemoryReport’, function () {
//
});

$this->app->tag([‘SpeedReport’, ‘MemoryReport’], ‘reports’);

Once the services have been tagged, you may easily resolve them all via the tagged method:

$this->app->bind(‘ReportAggregator’, function ($app) {
return new ReportAggregator($app->tagged(‘reports’));
});

This will ensure you to track the request from each user and respond to its each request.

Thank you!!

answered Mar 26 by Niroj
• 58,960 points

Related Questions In Laravel

0 votes
1 answer

What is reverse routing in Laravel?

 Laravel reverse routing is generating URL's based ...READ MORE

answered Mar 17 in Laravel by Niraj
1,764 views
0 votes
1 answer

What is middleware? How can we register middeleware in Laravel?

Middleware acts as a bridge between a ...READ MORE

answered Mar 18 in Laravel by Niroj
• 58,960 points
277 views
0 votes
1 answer

What is CSRF in Laravel?

CSRF stands for Cross Site Request Forgery is ...READ MORE

answered Mar 19 in Laravel by Niroj
• 58,960 points
141 views
0 votes
1 answer

What is the use of Facade Pattern in Laravel?

Hey kartik, Facades provide a static interface to classes that are ...READ MORE

answered Mar 19 in Laravel by Niroj
• 58,960 points
155 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18 in Laravel by Niroj
• 58,960 points
2,204 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18 in Laravel by Niroj
• 58,960 points
244 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23 in Laravel by Niroj
• 58,960 points
191 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23 in Laravel by Niroj
• 58,960 points
2,760 views
0 votes
1 answer

What is the significant difference between insert() and insertGetId() function in Laravel?

Hello, Insert(): This function is simply used to ...READ MORE

answered Mar 17 in Laravel by Niroj
• 58,960 points
185 views
0 votes
1 answer

What is the concept of controller in Laravel?

Hii, In the MVC framework, the letter ‘C’ ...READ MORE

answered Mar 18 in Laravel by Niroj
• 58,960 points
102 views