-
-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined ttwiter index #72
Comments
Which version of Laravel are you using ? |
I use Laravel 4.2, here is my composer.json { |
Can you post your code ? |
I have the same problem, do you have some solution? Thank you. |
Can you post your code ? |
I found a mistake in my own code. It works great... Thx.. |
Same problem here.. published config, providers added.. It actually used to work a while back. My code: function __construct(Tweet $twitterAPI, CLImate $climate)
{
$this->twitterAPI = $twitterAPI;
$this->climate = $climate;
}
public function fire(BeanstalkdJob $job, $data)
{
$this->climate->info('Posting to twitter!');
// get args
$ss = $data['ss'];
$episode_id = $data['episode_id'];
// get necessary fields
$episode = \Episode::find($episode_id)->with('Show')->get();;
$number = $episode->episode_number;
$slug = $episode->show->slug;
// generate url and message
$url = URL::route('shows.episode.show', [$slug, $number, $episode->id]);
$url = str_ireplace('.dev', '.com', $url);
$message = $episode->present()->title() . ' posted! #anime #ecchi ' . $url;
// Post media with screenshot
if ($ss) {
$screenshot = File::get($episode->present()->screenshot('large', true, true));
$response = $this->twitterAPI->postTweetMedia(['status' => $message, 'media[]' => $screenshot]);
$this->climate->info('Posted with screenshot: ' . $message);
Log::info('Posted to twitter with screenshot!' . "\n", ['response' => $response]);
} else {
$response = $this->twitterAPI->postTweet(['status' => $message]);
Log::info('Posted to twitter!' . "\n", ['response' => $response]);
}
// Save in database that we have posted this to twitter!
$episode->posted_to_twitter = 1;
$episode->save();
$job->delete();
} Apparently I can't use dependancy injection? It works fine with the facade.. Also this: [Exception] |
@Ortix92 I'm encountering the same probably when trying to inject ErrorException in Twitter.php line 56:
Undefined index: ttwitter::config |
Same issue as @nickdenardis I had to use the Facade to use this, using dependency injection threw the ErrorException in Twitter.php line 56:
Undefined index: ttwitter::config |
I had this issue also |
This package is simply not compatible with dependency injection, which is really unfortunate. The way around this is to use the facade. |
Closing this due to inactivity. Please let me know if you are still having an issue and i'll reopen. |
Hi, Mr. John. I got error when trying to initiate your package. It showed error like this:
ThanksForYourHelp 👍
ErrorException (E_UNKNOWN)
Undefined index: ttwitter::config
Open: /var/www/html/integration/vendor/thujohn/twitter/src/Thujohn/Twitter/Twitter.php
The text was updated successfully, but these errors were encountered: