SimpleSoftwareIO / simple-sms

Send and receive SMS messages with Laravel
https://www.simplesoftware.io/docs/simple-sms
MIT License
200 stars 87 forks source link

SMS::Pretend #32

Closed LTSTech closed 8 years ago

LTSTech commented 8 years ago

Hello,

first thanks for this very cool library. we hit an issue when trying to use the pretend function. The doc says to call it statically but the definition is not static. As a result we get an exception.

SMS::Pretend
Non-static method SimpleSoftwareIO\SMS\SMS::pretend() should not be called statically

Should the doc be updated?

Cheers!

SimplyCorey commented 8 years ago

@LTSTech It look like you are accessing the package the wrong way. Are you using Laravel? The package should never be accessed via statics. It should be using Laravel's facades (which look like statics) This error leads me to believe that you did not do this part of the installation.

Aliases

Add 'SMS' => SimpleSoftwareIO\SMS\Facades\SMS::class in your config/app.php configuration file within the aliases array.

Please let me know if this fixes/doesn't fix your issue.

abulanon commented 8 years ago

@SimplyCorey, It works now. hi added already the providers and aliases correctly to config/app.php file.

I found out that the issue is the class that I have declared in uses clause. before: use SimpleSoftwareIO\SMS\SMS; after(correct one): use SimpleSoftwareIO\SMS\Facades\SMS;

Anyways it is ok now. Thank you for the response.

Regards..