daniel-zahariev / php-aws-ses

PHP classes that interfaces Amazon Simple Email Service
307 stars 100 forks source link

IMPORT IN LUMEN #46

Closed lanzosuarez closed 6 years ago

lanzosuarez commented 6 years ago

How do i import SimpleEmailServiceMessage in Lumen.

daniel-zahariev commented 6 years ago

After the installation of the package via Composer: composer require daniel-zahariev/php-aws-ses you have to either add it to the use block of the file like this: use SimpleEmailServiceMessage; or create instances with the full name (e.g. namespaces included) of the class which in this case should look like this: $message = new \SimpleEmailServiceMessage();

Hope this solves it for you.

lanzosuarez commented 6 years ago

It didnt work :( says message: "Class 'App\Http\Controllers\SimpleEmailService'

daniel-zahariev commented 6 years ago

This shouldn't happen in the presence of backslash before the class name. Read through namespaces usage again: http://php.net/manual/en/language.namespaces.basics.php

lanzosuarez commented 6 years ago

maybe because this statement 'namespace App\Http\Controllers' is on the top of my php controller file? what do you think?

lanzosuarez commented 6 years ago

Its working now. Thank. :)