diff --git a/routes/api.php b/routes/api.php index 430087e..06b104a 100644 --- a/routes/api.php +++ b/routes/api.php @@ -29,8 +29,7 @@ ) { return Nova::modelInstanceForKey($resourceName) ->with("tokens") - ->where("id", $id) - ->first(); + ->find($id); }); Route::post("tokens/{resourceName}/{id}", function ( @@ -58,11 +57,10 @@ ) { $user = Nova::modelInstanceForKey($resourceName) ->with("tokens") - ->where("id", $id) - ->first(); + ->find($id); return $user ->tokens() - ->where("id", $request->token_id) + ->whereKey($request->token_id) ->delete(); });