Laravel Request exists() vs has()

1// https://example.com?popular
2$request->exists('popular') // true
3$request->has('popular') // false
4 
5// https://example.com?popular=foo
6$request->exists('popular') // true
7$request->has('popular') // true

Tip given by @coderahuljat

Like our articles?

Become a Premium Member for $129/year or $29/month
What else you will get:
  • 22 courses (477 lessons, total 38 h 20 min)
  • 2 long-form tutorials (one new every week)
  • access to project repositories
  • access to private Discord