Explain your approach to implementing authentication and authorization for different API endpoints in a PHP framework