1. Home
  2. Laravel
  3. Abort unless
#laravel#helper

The abort unless function throws back a specified HTTP exception if the first attribute evaluates to false.

abort_if(auth()->id(), 403, "Unauthorized");
copy
Full Laravel cheatsheet
Sitemap Git repository