whoisthisstud
4 months ago
360
2
Laravel

404 on one route out of many

Posted 4 months ago by whoisthisstud

I have an issue where just one of my routes returns a 404. I've tried resetting cache, moving the location of the route in the route file, ensuring that the field is fillable, dumping at the start of the function, verifying I'm logged in, etc... Still get a 404.

It's possible I've looked at it for too long and am overlooking something simple.

Suggestions?

--

All of the fraud routes, below, work except the one commented. They're all within an auth middleware group, but I've verified that I'm logged in.

// Fraud Routes
Route::get('/admin/fraud-lock/{$id}', '[email protected]'); // THIS ONE DOESN'T
Route::get('/admin/flag-ip/{ip}', '[email protected]');
Route::get('/admin/unflag-ip/{ip}', '[email protected]');
Route::get('/admin/flag-warrior/{email}', '[email protected]');
Route::get('/admin/unflag-warrior/{email}', '[email protected]');

The route does show up in the route list.

GET|HEAD | admin/fraud-lock/{$id} | | App\Http\Controllers\[email protected] | web,auth 

The field is fillable. Frauds model

protected $fillable = [ 'ip', 'email','locked' ];

In the AdminMarkFrauds controller:

public function lockFraud($id)
{
    dd($id); // Doesn't even get to this point

    DB::table('frauds')->where('id',$id)->update([ 'locked' => '1']);
            
    $msgType = "success";
    $msg = "The Fraud record has been locked";
    
    return Redirect::back()->with($msgType,$msg);
}
<!-- id has been verified to be correct -->
<a class="dropdown-item" href="/admin/fraud-lock/{{ $wFraud->frauds()->first()->id }}">
    <span class="material-icons sm-icon align-middle">lock</span>
    <span class="align-middle"> Lock Warrior</span>
</a>

From Telescope:

//PAYLOAD
[
]

// HEADERS
{
host: "rap.dev:8888",
accept-encoding: "gzip, deflate",
cookie: "XSRF-TOKEN=eyJpdiI6IlJcLzRXTGJLQndKTHFmVzkzVU5ueUdRPT0iLCJ2YWx1ZSI6Im1HWUJta2IyTlhUSnZaRXR1MzFWNGE0VHJ5NytxVDBKMjFcLzI1RGJoUnVWOGhTTGgwdm5MdmJ0aFpOR2JGQVV3IiwibWFjIjoiN2ZmMmVhZmYxYmFjMWIyNDM4ZTEzOTcyYjgxYWRjZDU5ZjUxY2IxNTJkZjc4MDRkNDIwNWM2NjlmOTZhMDA4NSJ9; request_a_prayer_session=eyJpdiI6InBicWJcLzlVNlRkSFpjckVzblZBVWFBPT0iLCJ2YWx1ZSI6Im80Z2JHMkJNa0pSelVLYWtHSmE0eStjTkhsZXk2dmJSSHd3VHVJRXlSb28ySEFmSjRpWEdFa2FNRGRCWDJcL0FLIiwibWFjIjoiZjM5NmJmNDAzOWFhYjYzNTBmNzRiYTIyYjk5NGQ4NzQwM2M0MDA0NzQ5YThhMDU4NDcwZTAwNjY0MGQ5NWZkYyJ9; remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d=eyJpdiI6IjdJNXZzOVQ0NXhcL0ZQQW1zcFVNdm13PT0iLCJ2YWx1ZSI6IjBjWjlNQTBxblVUMVFEa3g0XC9XT0FuSXpXXC90Y0VTenVEdlNybjhZamZkcXNyMUFYbnF5U2xwU291Vmg5R0RMZEY1WkkwUWZGWnA3WWRzcWIxWElwUEo4a0FZN05iVHpBSFQrWmlEeG9uUG5QNmNYNGlSSVJBRWppSGZqNGNHS1pnalF2aUhcL1IxNVRqSUlDSmVTQnJ3V1N1dXo5ZzZwS2xBb00yemMwb1wvZms9IiwibWFjIjoiODQ4NDA1ZTFlYmI1NjM3NGNmN2I3NzhhZjg0YTVhY2VlM2QxOTJmNjBmNTFkMjNlNDQ2YTkxNDMxMDA3YmI0ZiJ9",
connection: "keep-alive",
upgrade-insecure-requests: "1",
accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
user-agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15",
referer: "http://rap.dev:8888/admin/warriors",
dnt: "1",
accept-language: "en-us"
}

// SESSION
[
]

// RESPONSE
"HTML Response"

Please sign in or create an account to participate in this conversation.