Update ResourceController.php

fixed identifier check