Fix BindingResolutionError when debug toolbar isn't present (#465)

* Fix BindingResolutionError when debug toolbar isn't present

* Formatting
This commit is contained in:
Nabeel S
2019-12-11 15:12:31 -05:00
committed by GitHub
parent e6d38f9338
commit a58bca390b
8 changed files with 67 additions and 21 deletions

View File

@@ -4,6 +4,18 @@ use App\Exceptions\SettingNotFound;
use Carbon\Carbon;
use Illuminate\Contracts\View\Factory;
/*
* array_key_first only exists in PHP 7.3+
*/
if (!function_exists('array_key_first')) {
function array_key_first(array $arr)
{
foreach ($arr as $key => $unused) {
return $key;
}
}
}
if (!function_exists('in_mask')) {
/**
* Return true/false if a value exists in a mask