Skip to content
Advertisement

Route exists but doesn’t work and deleted route still works Laravel

Well, I was working on my project and suddenly when I created a new route I get this problem where the route exists but it shows 404 !! so I tried to delete an existing route that is working but when I delete that route still works !! I had this problem previously but I just deleted that route and made another route again and it was working fine but this time it does not work !!

Here is some of my code ->

$("#resetBtn").click(function () {
    $.ajax({
        url: "/reset/website/data",
        type: "POST",
        data: {
            _token: $('meta[name="csrf"]').attr("content"),
        },
        success: function (data) {
            console.log(data);
            activateNotificationSuccess("Successfully reseted.");
        },
        error: function (error) {
            console.log(error);
            activateNotificationFail("Something went very wrong !!");
        },
    });   
});
Route::post('/reset/website/data', [ColorNImageController::class, 'reset']);

Here is the problem if I make it a get request and directly navigate using my browser ->

enter image description here

Does anyone have a solution?

Advertisement

Answer

Please run the command line:

php artisan route:clear
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement