Answer the question
In order to leave comments, you need to log in
What am I doing wrong? Laravel 5 service provider?
config/app.php:
...
'providers' => [
...
App\Providers\CustomRegisterProvider::class,
],
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Services\CustomRegister;
class CustomRegisterProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app->bind('App\Services\CustomRegisterContract', function(){
return new CustomRegister();
});
}
}
...
use App\Services\CustomRegister as Register;
class RegisterController extends Controller
{
...
/**
* Регистрация потребителя
*
* @param Request $request
*/
public function consumer(Request $request, Register $register){
...
}
}
ReflectionException in Route.php line 286:
Class App\Services\CustomRegister does not exist
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question