Thank you everyone, but problem was in my AppRepositoryProvider. As it’s binding exception, then obviously the problem was with binding 🙂
Correct file is:
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppRepositoryProvider extends ServiceProvider {
public function boot() {}
public function register() {
$models = array(
'CustomModel',
'CustomModel2',
'CustomModel3'
);
foreach ($models as $model) {
$this->app->bind("App\Contracts\\{$model}Interface", "App\Repositories\\{$model}Repository");
}
}
}
Note, that I’m using "App\Contracts\\{$model}Interface"
(not escaping “{” symbol) and it generate correct string App\Contracts\CustomModelInterface
instead of App\Contracts\{$model}Interface
(with unexpected escaping).