Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel API Route Not Found

I'm trying to test an API route, but I always get 404 Not Found.

I'm using this command:

curl http://localhost:8000/api/veip

This is my routes/api.php

<?php

use Illuminate\Http\Request;

Route::get('/veip', function () {
    return 'Hello World';
});

And this is my php artisan route:list output:

+--------+----------+----------+------+---------+------------+
| Domain | Method   | URI      | Name | Action  | Middleware |
+--------+----------+----------+------+---------+------------+
|        | GET|HEAD | /        |      | Closure | web        |
|        | GET|HEAD | api/veip |      | Closure | api        |
+--------+----------+----------+------+---------+------------+

So the route does exists

I don't know what's going on here...

like image 963
danielrvt Avatar asked Mar 05 '23 18:03

danielrvt


1 Answers

try php artisan route:clear may work for you

like image 146
aditiadika Avatar answered Mar 17 '23 20:03

aditiadika