Syntax error on Service Provider

110 views Asked by At

I don't understand why, but I can't get rid of "syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM)" after setting a Service Provider. Does anyone have any clue why this is happening?

My ServiceProvider:

namespace Repositories;
use Illuminate\Support\ServiceProvider;
class MainPageServiceProvider extends ServiceProvider {

  public function register()
  {
  $this->app::bind('MainPageInterface', 'MainPagesRepository');
  }

}
1

There are 1 answers

1
Marcin Nabiałek On BEST ANSWER

It should be:

$this->app->bind('MainPageInterface', 'MainPagesRepository');

or

\App::bind('MainPageInterface', 'MainPagesRepository');