In RouteAction.php line 84: Invalid route action
If you are using laravel 8 you need to add your controller and method name inside the array, otherwise, it will throw an error.
Route::get('/projects', User\ProjectController::class, 'index')->name('user.projects');
TO
Route::get('/projects', [User\ProjectController::class, 'index'])->name('user.projects');
I also face a similar problem:
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', 'Frontend\FrontendController@index')->name('home');
Route::get('/post', 'Frontend\FrontendController@post')->name('post');
Route::get('/contact', 'Frontend\FrontendController@contact')->name('contact_us');
Route::group(['prefix' => 'admin'], function () {
Route::get('/create', 'Backend\BackendController@index');
//User Route
Route::get('/registration', '');
});
And I just remove the Route::get('/registration', '');
and it's work for me :)
Those who are new to Laravel or learning use
Route::resource('resource_name','controller_name')
to avoid this kind of error when you type:
php artisan route:list
In cmd or any other command line.
Because it is invalid. As you're using GET
route, you must specify method name(unless you used ::resource
):
$this->get('dashboard', 'DashboardController@methodName');