-2
Route::get('/', function () {
return view('welcome');
});
Route::view('/teste', 'teste');
Route::get('/noticia/{slug}', function($slug){
if($slug != null):
Route::redirect('noticia/{$slug}', '/');
else:
echo 'Erro de redirecionamento';
endif;
});
The function must redirect user access to the "Welcome" view whenever the value of $Slug is equal to empty ie: /news/(empty)
When I assign a value to the variable $Slug, I can fall to Else, and the script returns echo.
PROBLEM: Whenever I access /news returns to me error 404 not found.
QUESTION: Where is the value of the variable {$Slug stored}