我正在尝试使用larvel来显示特定的滑动,具体取决于输入的card_id。当前的card_id不是序列号,但仍然是绑定到每个用户的唯一ID,因此序列号仅为1,2,3,4,5,并且card_id将为:321a4s,并且可以在其上附加多个ID是我当前的端点代码: 控制器
public function show($card_id)
{
$swipe = Swipe::find($card_id);
//Verify swipe exists
if(!$swipe){return response("ID Not Found", 404);}
return $swipe;
}
swipe.php
protected $primaryKey = 'mask_id';
protected $table = 'swipe';
protected $fillable = [
'card_id',
];
为什么我仍然收到此错误?最好的解决方案是什么?