php - Calling a package method in a library in laravel 4 -


I am using Mandrod for a project in Larval.

& Gt; 'Transaction email via Mandrill', 'html' = & gt; 'This works!', 'From_email' = & gt; 'fromemail@example.com', 'to' = & gt; array (Array ('email' = & gt; 'kwanghock@kwanghock.com.sg')))); $ Response = Mandil :: request ('message / send', $ payload);

However, when I take this part of the code in a library, then give me a

  symphony \ component \ debug \ exception \ FatalErrorException Class' Project  

? Php Namespace Project \ Email \ Mandrill_lib; Use LaravelMandrillRequest \ Facades \ LaravelMandrillRequestServiceProvider; Use LaravelMandrillRequest \ Facades \ MandrillRequest; Class MandrillEmail MandrillInterface Apply {Send Public Function ($ Email) {foreach (as email $ email) {$ payload = array ('message' = & gt; array ('subject' = & gt; Transactions through Mandrill Email, 'html' = & gt; This works! ',' From_email '= & gt;' fromemail@example.com ',' to '= & gt; array (array (' email '= & gt; 'Kwanghock@kwanghock.com.sg')))); $ Response = Mandil :: request ('message / send', $ payload); }

You also have to do user Mandrill:

  Use LaravelMandrillRequest \ Facades \ LaravelMandrillRequestServiceProvider; Use LaravelMandrillRequest \ Facades \ MandrillRequest; Use Mandal; /// here! Class MandrillEmail {...}  

Or attempt to use it through its own namespace

  class 'project' email \ Mandrill_lib \ Mandrill Will not 'get'  

Comments