Closed closerdesign closed 5 years ago
Hi, @closerdesign How are you? Could you, please, post your code here? I mean, the part which is causing this error.
Tks!
Thanks!
I'm having to do this:
$sendy = new Sendy([ 'listId' => 'MyListId', 'installationUrl' => 'MyUrl', 'apiKey' => 'MyApiKey' ]);
$sendy->subscribe([ 'email' => $request->email ]);
Instead of this:
$data = [ 'email' => 'johndoe@example.com', 'name' => 'John Doe', 'any_custom_column' => 'value'];Sendy::subscribe($data);
On Tue, Jul 19, 2016 at 8:08 PM Alison Monteiro notifications@github.com wrote:
Hi, @closerdesign https://github.com/closerdesign How are you? Could you, please, post your code here? I mean, the part which is causing this error.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hocza/sendy-laravel/issues/13#issuecomment-233811544, or mute the thread https://github.com/notifications/unsubscribe-auth/AKhLeH6xlTe252V-NThpM2-8MuU4B943ks5qXXUZgaJpZM4JQU2K .
Huh next time hide your API key.
So the first snippet is working but the below one is not working?
Did you setup the config/sendy.php correctly?
Yes. And there is no problem at that point. The thing is that is I use the function as static it doesn't work. If I use the function as dynamic it simply ignores the sendy.php.
@closerdesign To use the method as static you need add an alias on config/app.php
'aliases' => [
// ...
'Sendy' => 'Hocza\Sendy\Facades\Sendy',
]
Did you do that?
Yes, I did. It didn´t work. I followed the instructions exactly as they are on the site.
A question comes up with this, what´s the difference between these formats on service providers?
'View' => Illuminate\Support\Facades\View::class, 'Sendy' => 'Hocza\Sendy\Facades\Sendy',
Do I have to call Sendy the same way as View?
Thanks dude!
@closerdesign if you still might have the issue I was able to fix it by doing:
use Hocza\Sendy\Facades\Sendy;
Instead and then call the functions statically. It complains in php storm that the function doesn't exist but it works fine.
Hi guys,
I'm trying to use the library following your instructions but at the end, the only response that I have is that I'm trying to call a method statically that can't be called that way. Any idea?