Array check if record exists or not in Laravel 5.7