0

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');
  }

}
Rui Silva
  • 99
  • 4
  • 12

1 Answers1

0

It should be:

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

or

\App::bind('MainPageInterface', 'MainPagesRepository');
Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
  • Thanks, I guess it worked. I got that syntax from an article I was following so probably the writer made this small mistake. – Rui Silva Nov 11 '14 at 12:48