You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use MartinGeorgiev\SocialPost\Publisher as SocialPublisher;
use MartinGeorgiev\SocialPost\Message as SocialMessage;
...
public function myFunction (SocialPublisher $publisher) {
...
$post = new SocialMessage('post content here');
$publisher->publish($post);
...
}
Is you want to use it in a service, just pass SocialPublisher to the __construct method. Hope this helps.
Can you add an example in the documentation showing how to call the service via Dependency Injection, that than through the container?
That's Symfony's best practice recommendations now.
Thanks.
The text was updated successfully, but these errors were encountered: