moltin / laravel-cart

Laravel Facade and Service Provider for Moltin\Cart
276 stars 87 forks source link

Error inside CartServiceProvider.php #16

Closed hboumedane closed 10 years ago

hboumedane commented 10 years ago

Hello,

I'm new user of laravel and moltin, I was trying a tutorial with moltin but i had this error : FatalErrorException Using $this when not in object context

public function register()
{

    $this->app->singleton('cart', function() {
        return new Cart($this->getStorageService(), $this->getIdentifierService());
    });
}

Please Help !!!

ryross commented 10 years ago

You probably need to upgrade your PHP version. What version are you on now?

hboumedane commented 10 years ago

I was on PHP 5.3 and now on PHP5.4 and have no longer this error , thanks for your help.