Write the Eloquent expression that finds a Tag by name or creates it if it doesn't exist.
Users can type free-form tags, and duplicates shouldn't be created.
Ready to try it?
Create a free account and subscribe to take "Write a firstOrCreate Query". Earn 90 XP and track your internship progress.
Already have an account? Sign in