You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/**
* Gets the key of the provided value.
*
* @param string $value The value.
*
* **@return boolean The key if found, false otherwise.**
*/
public static function getKey($value)
{
return array_search($value, static::getAll(), true);
}
array_search will return the element, if found, which would be a string
array_search will return the element, if found, which would be a string
UserRoles::getKey(3)
will return 'client'The text was updated successfully, but these errors were encountered: