I am building a laravel API and i need to be able to only accept requests of type 'application/json' when data is being posted. Any other content-types should return a 406 'Not Acceptable' response.
I am aware I could put in some middleware to check for this however I was wondering if there is a better way this could be accomplished?
Thanks