I added this MailChimp API to Laravel 4 with Composer and I am able to use this API like so:
$MailChimp = new \Drewm\MailChimp();
How can I create an instance of MailChimp() without the path like this:
$MailChimp = new MailChimp();
I added this MailChimp API to Laravel 4 with Composer and I am able to use this API like so:
$MailChimp = new \Drewm\MailChimp();
How can I create an instance of MailChimp() without the path like this:
$MailChimp = new MailChimp();
You can "use" it on the top of your php source file.
use Drewm\MailChimp;
$MailChimp = new MailChimp();
I would strongly suggest to not rely on the no-longer-documented Laravel feature and just use the PHP native way if you must have this:
if (! class_exists('Setting')) { // in case the same php process is reused
class_alias(\App\Facades\Setting::class, 'Setting');
}
This is what Laravel was using under the hood either way - and your IDE will immediately recognize it.