Z
Z
Zhanibek Smagul2015-04-09 06:50:22
Laravel
Zhanibek Smagul, 2015-04-09 06:50:22

What is the error in php artisan route:list?

php artisan route:list throws this error:
Target [Illuminate\Contracts\Auth\Registrar] is not instantiable
and code in routes.php
Route::get('/', '[email protected]');
Route::get('about', '[email protected]');
Route::get('contact', '[email protected]');
Route::get('auth/login', '[email protected]');
Route::resource('articles', 'ArticlesController');
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);

and if you remove

Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);

then everything works
C:\OpenServer\domains\firstapp>php artisan route:list
+--------+----------+--------------- ---+------------------+----- ---------------------+------------+
| domain | method | URI | name | action | middleware |
+--------+----------+--------------------------------+-- -+------------------------------------------------ -+------------+
| | GET|HEAD | / | | App\Http\Controllers\[email protected] | guest |
| | GET|HEAD | about | | App\Http\Controllers\[email protected] | |
| | GET|HEAD | contact | | App\Http\Controllers\[email protected] | |
| | GET|HEAD | auth/login | | App\Http\Controllers\[email protected] | |
| | GET|HEAD | articles | articles.index | App\Http\Controllers\[email protected] | |
| | GET|HEAD | articles/create | articles.create | App\Http\Controllers\[email protected] | |
| | POST | articles | articles.store | App\Http\Controllers\[email protected] | |
| | GET|HEAD | articles/{articles} | articles.show | App\Http\Controllers\[email protected] | |
| | GET|HEAD | articles/{articles}/edit | articles.edit | App\Http\Controllers\[email protected] | |
| | PUT | articles/{articles} | articles.update | App\Http\Controllers\[email protected] | |
| | PATCH | articles/{articles} | | App\Http\Controllers\[email protected] | |
| | DELETE | articles/{articles} | articles.destroy | App\Http\Controllers\[email protected] | |
+--------+----------+--------------------------------+-- -+------------------------------------------------ -+--------------------+

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2015-04-09
@rdifb0

The problem is that the router is trying to instantiate a controller class that has a Registrar dependency that laravel cannot automatically inject. You probably edited the AppServiceProvider.php file
and broke the binding there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question