Support the ongoing development of Laravel.io →
posted 10 years ago
Queues

I'm using the queue and wanting to call methods out of my class. So I'm using:

Queue::push('MyApp\Services\Queue\AnalyticsService@login', $userId);

I then have a class called AnalyticsService and inside it a method called login.


class AnalyticsService {

	public function identify($job, $data)
	{

		...

	}

	public function login($job, $data)
	{

		...

	}

}

When I run the Queue it always runs the first method (in this case "identify()") instead of the correct method. Anyone have any ideas?

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.