I’m trying to define a variable. However, I get “undefined variable $route” as an error message. What am I doing wrong?
<?php
use IlluminateSupportFacadesRoute;
use AppHttpControllersPublicController;
use AppHttpControllersArticleController;
Route::get('/', [PublicController::class, 'homepage']) ->name('homepage');
Route::post('/article/store' , [ArticleController::class , 'store']) -> name ('article.store');
Route::get('/article/create' , [ArticleController::class , 'create']) -> name ('article.create');
Route::get('/article/index' , [ArticleController::class , 'index']) ->name ('article.index');
Route::get('/article/show/{article}' , [ArticleController::class , 'show'])->name('article.show');
Route::get('/article/category/{category}' , [ArticleController::class, 'byCategory'])->name('article.byCategory');
enter image description here
above is the code of our routes. what did we do wrong?
New contributor
sara peruzzini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.