use Conditionable on Exceptions
This PR gives capabilities to the Exceptions class so that users can write their codes with better quality.
In this PR, Illuminate\Support\Traits\Conditionable is used in the Illuminate\Foundation\Configuration\Exception class, so the exception will accept the when() and unless() functions.
You can see a difference in the use of this function:
With out using when() (Execution of n conditions for n exceptions)
With using when() (Execution of 1 conditions for n exceptions)
note: I had no idea to make a new test for these changes, so I ask you to check it out, Thank's.
How would request be injected into your when callback?
Wouldn't it make more sense to add a withExceptions() method to \Illuminate\Routing\Router?