You can add to Resource
protected static ?string $recordRouteKeyName = 'slug';
to change from id to slug or other unique column.