Laravel Replace Array Python Definition