code
stringlengths
17
247k
docstring
stringlengths
30
30.3k
func_name
stringlengths
1
89
language
stringclasses
1 value
repo
stringlengths
7
63
path
stringlengths
7
153
url
stringlengths
51
209
license
stringclasses
4 values
public function __toString() { $values = array_map(function ($value) { $value = enum_value($value); return '"'.str_replace('"', '""', $value).'"'; }, $this->values); return $this->rule.':'.implode(',', $values); }
Convert the rule to a validation string. @return string @see \Illuminate\Validation\ValidationRuleParser::parseParameters
__toString
php
laravel/framework
src/Illuminate/Validation/Rules/In.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/In.php
MIT
public function __construct($keys = null) { if ($keys instanceof Arrayable) { $keys = $keys->toArray(); } $this->keys = is_array($keys) ? $keys : func_get_args(); }
Create a new array rule instance. @param array|null $keys
__construct
php
laravel/framework
src/Illuminate/Validation/Rules/ArrayRule.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/ArrayRule.php
MIT
public static function default() { $email = is_callable(static::$defaultCallback) ? call_user_func(static::$defaultCallback) : static::$defaultCallback; return $email instanceof static ? $email : new static; }
Get the default configuration of the file rule. @return static
default
php
laravel/framework
src/Illuminate/Validation/Rules/Email.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Email.php
MIT
public function rfcCompliant(bool $strict = false) { if ($strict) { $this->strictRfcCompliant = true; } else { $this->rfcCompliant = true; } return $this; }
Ensure that the email is an RFC compliant email address. @param bool $strict @return $this
rfcCompliant
php
laravel/framework
src/Illuminate/Validation/Rules/Email.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Email.php
MIT
public function strict() { return $this->rfcCompliant(true); }
Ensure that the email is a strictly enforced RFC compliant email address. @return $this
strict
php
laravel/framework
src/Illuminate/Validation/Rules/Email.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Email.php
MIT
public function validateMxRecord() { $this->validateMxRecord = true; return $this; }
Ensure that the email address has a valid MX record. Requires the PHP intl extension. @return $this
validateMxRecord
php
laravel/framework
src/Illuminate/Validation/Rules/Email.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Email.php
MIT
public function preventSpoofing() { $this->preventSpoofing = true; return $this; }
Ensure that the email address is not attempting to spoof another email address using invalid unicode characters. @return $this
preventSpoofing
php
laravel/framework
src/Illuminate/Validation/Rules/Email.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Email.php
MIT
public function withNativeValidation(bool $allowUnicode = false) { if ($allowUnicode) { $this->nativeValidationWithUnicodeAllowed = true; } else { $this->nativeValidation = true; } return $this; }
Ensure the email address is valid using PHP's native email validation functions. @param bool $allowUnicode @return $this
withNativeValidation
php
laravel/framework
src/Illuminate/Validation/Rules/Email.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Email.php
MIT
public function __construct($allowSvg = false) { if ($allowSvg) { $this->rules('image:allow_svg'); } else { $this->rules('image'); } }
Create a new image file rule instance. @param bool $allowSvg
__construct
php
laravel/framework
src/Illuminate/Validation/Rules/ImageFile.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/ImageFile.php
MIT
public static function required() { return ['required', static::default()]; }
Get the default configuration of the password rule and mark the field as required. @return array
required
php
laravel/framework
src/Illuminate/Validation/Rules/Password.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Password.php
MIT
public static function sometimes() { return ['sometimes', static::default()]; }
Get the default configuration of the password rule and mark the field as sometimes being required. @return array
sometimes
php
laravel/framework
src/Illuminate/Validation/Rules/Password.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Password.php
MIT
public static function min($size) { return new static($size); }
Set the minimum size of the password. @param int $size @return $this
min
php
laravel/framework
src/Illuminate/Validation/Rules/Password.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Password.php
MIT
public function max($size) { $this->max = $size; return $this; }
Set the maximum size of the password. @param int $size @return $this
max
php
laravel/framework
src/Illuminate/Validation/Rules/Password.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Password.php
MIT
public function uncompromised($threshold = 0) { $this->uncompromised = true; $this->compromisedThreshold = $threshold; return $this; }
Ensures the password has not been compromised in data leaks. @param int $threshold @return $this
uncompromised
php
laravel/framework
src/Illuminate/Validation/Rules/Password.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Password.php
MIT
public function mixedCase() { $this->mixedCase = true; return $this; }
Makes the password require at least one uppercase and one lowercase letter. @return $this
mixedCase
php
laravel/framework
src/Illuminate/Validation/Rules/Password.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Password.php
MIT
public function letters() { $this->letters = true; return $this; }
Makes the password require at least one letter. @return $this
letters
php
laravel/framework
src/Illuminate/Validation/Rules/Password.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Password.php
MIT
public function numbers() { $this->numbers = true; return $this; }
Makes the password require at least one number. @return $this
numbers
php
laravel/framework
src/Illuminate/Validation/Rules/Password.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Password.php
MIT
public function symbols() { $this->symbols = true; return $this; }
Makes the password require at least one symbol. @return $this
symbols
php
laravel/framework
src/Illuminate/Validation/Rules/Password.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Password.php
MIT
public function rules($rules) { $this->customRules = Arr::wrap($rules); return $this; }
Specify additional validation rules that should be merged with the default rules during validation. @param \Closure|string|array $rules @return $this
rules
php
laravel/framework
src/Illuminate/Validation/Rules/Password.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Password.php
MIT
public function appliedRules() { return [ 'min' => $this->min, 'max' => $this->max, 'mixedCase' => $this->mixedCase, 'letters' => $this->letters, 'numbers' => $this->numbers, 'symbols' => $this->symbols, 'uncompromised' => $this->uncompromised, 'compromisedThreshold' => $this->compromisedThreshold, 'customRules' => $this->customRules, ]; }
Get information about the current state of the password validation rules. @return array
appliedRules
php
laravel/framework
src/Illuminate/Validation/Rules/Password.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Password.php
MIT
public function __construct($condition) { if (! is_string($condition)) { $this->condition = $condition; } else { throw new InvalidArgumentException('The provided condition must be a callable or boolean.'); } }
Create a new required validation rule based on a condition. @param callable|bool $condition
__construct
php
laravel/framework
src/Illuminate/Validation/Rules/RequiredIf.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/RequiredIf.php
MIT
public function only($values) { $this->only = $values instanceof Arrayable ? $values->toArray() : Arr::wrap($values); return $this; }
Specify the cases that should be considered valid. @param \UnitEnum[]|\UnitEnum|\Illuminate\Contracts\Support\Arrayable<array-key, \UnitEnum> $values @return $this
only
php
laravel/framework
src/Illuminate/Validation/Rules/Enum.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Enum.php
MIT
public function except($values) { $this->except = $values instanceof Arrayable ? $values->toArray() : Arr::wrap($values); return $this; }
Specify the cases that should be considered invalid. @param \UnitEnum[]|\UnitEnum|\Illuminate\Contracts\Support\Arrayable<array-key, \UnitEnum> $values @return $this
except
php
laravel/framework
src/Illuminate/Validation/Rules/Enum.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Rules/Enum.php
MIT
protected function getInlineMessage($attribute, $rule) { $inlineEntry = $this->getFromLocalArray($attribute, Str::snake($rule)); return is_array($inlineEntry) && in_array($rule, $this->sizeRules) ? $inlineEntry[$this->getAttributeType($attribute)] : $inlineEntry; }
Get the proper inline error message for standard and size rules. @param string $attribute @param string $rule @return string|null
getInlineMessage
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
protected function getWildcardCustomMessages($messages, $search, $default) { foreach ($messages as $key => $message) { if ($search === $key || (Str::contains($key, ['*']) && Str::is($key, $search))) { return $message; } } return $default; }
Check the given messages for a wildcard key. @param array $messages @param string $search @param string $default @return string
getWildcardCustomMessages
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
protected function getSizeMessage($attribute, $rule) { $lowerRule = Str::snake($rule); // There are three different types of size validations. The attribute may be // either a number, file, or string so we will check a few things to know // which type of value it is and return the correct line for that type. $type = $this->getAttributeType($attribute); $key = "validation.{$lowerRule}.{$type}"; return $this->translator->get($key); }
Get the proper error message for an attribute and size rule. @param string $attribute @param string $rule @return string
getSizeMessage
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
public function getDisplayableAttribute($attribute) { $primaryAttribute = $this->getPrimaryAttribute($attribute); $expectedAttributes = $attribute != $primaryAttribute ? [$attribute, $primaryAttribute] : [$attribute]; foreach ($expectedAttributes as $name) { // The developer may dynamically specify the array of custom attributes on this // validator instance. If the attribute exists in this array it is used over // the other ways of pulling the attribute name for this given attributes. if ($inlineAttribute = $this->getAttributeFromLocalArray($name)) { return $inlineAttribute; } // We allow for a developer to specify language lines for any attribute in this // application, which allows flexibility for displaying a unique displayable // version of the attribute name instead of the name used in an HTTP POST. if ($translatedAttribute = $this->getAttributeFromTranslations($name)) { return $translatedAttribute; } } // When no language line has been specified for the attribute and it is also // an implicit attribute we will display the raw attribute's name and not // modify it with any of these replacements before we display the name. if (isset($this->implicitAttributes[$primaryAttribute])) { return ($formatter = $this->implicitAttributesFormatter) ? $formatter($attribute) : $attribute; } return str_replace('_', ' ', Str::snake($attribute)); }
Get the displayable name of the attribute. @param string $attribute @return string
getDisplayableAttribute
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
protected function getAttributeFromTranslations($name) { if (! is_array($attributes = $this->translator->get('validation.attributes'))) { return null; } return $this->getAttributeFromLocalArray($name, Arr::dot($attributes)); }
Get the given attribute from the attribute translations. @param string $name @return string|null
getAttributeFromTranslations
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
protected function getAttributeFromLocalArray($attribute, $source = null) { $source = $source ?: $this->customAttributes; if (isset($source[$attribute])) { return $source[$attribute]; } foreach (array_keys($source) as $sourceKey) { if (str_contains($sourceKey, '*')) { $pattern = str_replace('\*', '([^.]*)', preg_quote($sourceKey, '#')); if (preg_match('#^'.$pattern.'\z#u', $attribute) === 1) { return $source[$sourceKey]; } } } }
Get the custom name for an attribute if it exists in the given array. @param string $attribute @param array|null $source @return string|null
getAttributeFromLocalArray
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
protected function replaceAttributePlaceholder($message, $value) { return str_replace( [':attribute', ':ATTRIBUTE', ':Attribute'], [$value, Str::upper($value), Str::ucfirst($value)], $message ); }
Replace the :attribute placeholder in the given message. @param string $message @param string $value @return string
replaceAttributePlaceholder
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
protected function replaceIndexPlaceholder($message, $attribute) { return $this->replaceIndexOrPositionPlaceholder( $message, $attribute, 'index' ); }
Replace the :index placeholder in the given message. @param string $message @param string $attribute @return string
replaceIndexPlaceholder
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
protected function replacePositionPlaceholder($message, $attribute) { return $this->replaceIndexOrPositionPlaceholder( $message, $attribute, 'position', fn ($segment) => $segment + 1 ); }
Replace the :position placeholder in the given message. @param string $message @param string $attribute @return string
replacePositionPlaceholder
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
protected function numberToIndexOrPositionWord(int $value) { return [ 1 => 'first', 2 => 'second', 3 => 'third', 4 => 'fourth', 5 => 'fifth', 6 => 'sixth', 7 => 'seventh', 8 => 'eighth', 9 => 'ninth', 10 => 'tenth', ][(int) $value] ?? 'other'; }
Get the word for a index or position segment. @param int $value @return string
numberToIndexOrPositionWord
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
protected function replaceInputPlaceholder($message, $attribute) { $actualValue = $this->getValue($attribute); if (is_scalar($actualValue) || is_null($actualValue)) { $message = str_replace(':input', $this->getDisplayableValue($attribute, $actualValue), $message); } return $message; }
Replace the :input placeholder in the given message. @param string $message @param string $attribute @return string
replaceInputPlaceholder
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
public function getDisplayableValue($attribute, $value) { if (isset($this->customValues[$attribute][$value])) { return $this->customValues[$attribute][$value]; } if (is_array($value)) { return 'array'; } $key = "validation.values.{$attribute}.{$value}"; if (($line = $this->translator->get($key)) !== $key) { return $line; } if (is_bool($value)) { return $value ? 'true' : 'false'; } if (is_null($value)) { return 'empty'; } return (string) $value; }
Get the displayable name of the value. @param string $attribute @param mixed $value @return string
getDisplayableValue
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
protected function callClassBasedReplacer($callback, $message, $attribute, $rule, $parameters, $validator) { [$class, $method] = Str::parseCallback($callback, 'replace'); return $this->container->make($class)->{$method}(...array_slice(func_get_args(), 1)); }
Call a class based validator message replacer. @param string $callback @param string $message @param string $attribute @param string $rule @param array $parameters @param \Illuminate\Validation\Validator $validator @return string
callClassBasedReplacer
php
laravel/framework
src/Illuminate/Validation/Concerns/FormatsMessages.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/FormatsMessages.php
MIT
public function validateList($attribute, $value) { return is_array($value) && array_is_list($value); }
Validate that an attribute is a list. @param string $attribute @param mixed $value @return bool
validateList
php
laravel/framework
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
MIT
public function validateConfirmed($attribute, $value, $parameters) { return $this->validateSame($attribute, $value, [$parameters[0] ?? $attribute.'_confirmation']); }
Validate that an attribute has a matching confirmation. @param string $attribute @param mixed $value @param array{0: string} $parameters @return bool
validateConfirmed
php
laravel/framework
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
MIT
public function validateContains($attribute, $value, $parameters) { if (! is_array($value)) { return false; } foreach ($parameters as $parameter) { if (! in_array($parameter, $value)) { return false; } } return true; }
Validate an attribute contains a list of values. @param string $attribute @param mixed $value @param array<int, int|string> $parameters @return bool
validateContains
php
laravel/framework
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
MIT
private function failsMinRatioCheck($parameters, $width, $height) { if (! isset($parameters['min_ratio'])) { return false; } [$minNumerator, $minDenominator] = array_replace( [1, 1], array_filter(sscanf($parameters['min_ratio'], '%f/%d')) ); return ($width / $height) > ($minNumerator / $minDenominator); }
Determine if the given parameters fail a dimension minimum ratio check. @param array<string,string> $parameters @param int $width @param int $height @return bool
failsMinRatioCheck
php
laravel/framework
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
MIT
private function failsMaxRatioCheck($parameters, $width, $height) { if (! isset($parameters['max_ratio'])) { return false; } [$maxNumerator, $maxDenominator] = array_replace( [1, 1], array_filter(sscanf($parameters['max_ratio'], '%f/%d')) ); return ($width / $height) < ($maxNumerator / $maxDenominator); }
Determine if the given parameters fail a dimension maximum ratio check. @param array<string,string> $parameters @param int $width @param int $height @return bool
failsMaxRatioCheck
php
laravel/framework
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
MIT
public function validateImage($attribute, $value, $parameters = []) { $mimes = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']; if (is_array($parameters) && in_array('allow_svg', $parameters)) { $mimes[] = 'svg'; } return $this->validateMimes($attribute, $value, $mimes); }
Validate the MIME type of a file is an image MIME type. @param string $attribute @param mixed $value @param array<int, string> $parameters @return bool
validateImage
php
laravel/framework
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
MIT
public function validateRequiredIfDeclined($attribute, $value, $parameters) { $this->requireParameterCount(1, $parameters, 'required_if_declined'); if ($this->validateDeclined($parameters[0], $this->getValue($parameters[0]))) { return $this->validateRequired($attribute, $value); } return true; }
Validate that an attribute exists when another attribute was "declined". @param string $attribute @param mixed $value @param mixed $parameters @return bool
validateRequiredIfDeclined
php
laravel/framework
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
MIT
public function validateProhibitedIfAccepted($attribute, $value, $parameters) { $this->requireParameterCount(1, $parameters, 'prohibited_if_accepted'); if ($this->validateAccepted($parameters[0], $this->getValue($parameters[0]))) { return $this->validateProhibited($attribute, $value); } return true; }
Validate that an attribute does not exist when another attribute was "accepted". @param string $attribute @param mixed $value @param mixed $parameters @return bool
validateProhibitedIfAccepted
php
laravel/framework
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
MIT
public function validateProhibitedIfDeclined($attribute, $value, $parameters) { $this->requireParameterCount(1, $parameters, 'prohibited_if_declined'); if ($this->validateDeclined($parameters[0], $this->getValue($parameters[0]))) { return $this->validateProhibited($attribute, $value); } return true; }
Validate that an attribute does not exist when another attribute was "declined". @param string $attribute @param mixed $value @param mixed $parameters @return bool
validateProhibitedIfDeclined
php
laravel/framework
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
MIT
public function validateUuid($attribute, $value, $parameters) { $version = null; if ($parameters !== null && count($parameters) === 1) { $version = $parameters[0]; if ($version !== 'max') { $version = (int) $parameters[0]; } } return Str::isUuid($value, $version); }
Validate that an attribute is a valid UUID. @param string $attribute @param mixed $value @param array<int, int<0, 8>|'max'> $parameters @return bool
validateUuid
php
laravel/framework
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
MIT
protected function replaceAcceptedIf($message, $attribute, $rule, $parameters) { $parameters[1] = $this->getDisplayableValue($parameters[0], Arr::get($this->data, $parameters[0])); $parameters[0] = $this->getDisplayableAttribute($parameters[0]); return str_replace([':other', ':value'], $parameters, $message); }
Replace all place-holders for the accepted_if rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceAcceptedIf
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceDeclinedIf($message, $attribute, $rule, $parameters) { $parameters[1] = $this->getDisplayableValue($parameters[0], Arr::get($this->data, $parameters[0])); $parameters[0] = $this->getDisplayableAttribute($parameters[0]); return str_replace([':other', ':value'], $parameters, $message); }
Replace all place-holders for the declined_if rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceDeclinedIf
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceBetween($message, $attribute, $rule, $parameters) { return str_replace([':min', ':max'], $parameters, $message); }
Replace all place-holders for the between rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceBetween
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceDateFormat($message, $attribute, $rule, $parameters) { return str_replace(':format', $parameters[0], $message); }
Replace all place-holders for the date_format rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceDateFormat
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceDecimal($message, $attribute, $rule, $parameters) { return str_replace( ':decimal', isset($parameters[1]) ? $parameters[0].'-'.$parameters[1] : $parameters[0], $message ); }
Replace all place-holders for the decimal rule. @param string $message @param string $attribute @param string $rule @param array<int,int> $parameters @return string
replaceDecimal
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceDifferent($message, $attribute, $rule, $parameters) { return $this->replaceSame($message, $attribute, $rule, $parameters); }
Replace all place-holders for the different rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceDifferent
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceDigits($message, $attribute, $rule, $parameters) { return str_replace(':digits', $parameters[0], $message); }
Replace all place-holders for the digits rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceDigits
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceDigitsBetween($message, $attribute, $rule, $parameters) { return $this->replaceBetween($message, $attribute, $rule, $parameters); }
Replace all place-holders for the digits (between) rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceDigitsBetween
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceExtensions($message, $attribute, $rule, $parameters) { return str_replace(':values', implode(', ', $parameters), $message); }
Replace all place-holders for the extensions rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceExtensions
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceMin($message, $attribute, $rule, $parameters) { return str_replace(':min', $parameters[0], $message); }
Replace all place-holders for the min rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceMin
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceMinDigits($message, $attribute, $rule, $parameters) { return str_replace(':min', $parameters[0], $message); }
Replace all place-holders for the min digits rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceMinDigits
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceMax($message, $attribute, $rule, $parameters) { return str_replace(':max', $parameters[0], $message); }
Replace all place-holders for the max rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceMax
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceMaxDigits($message, $attribute, $rule, $parameters) { return str_replace(':max', $parameters[0], $message); }
Replace all place-holders for the max digits rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceMaxDigits
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceMissingIf($message, $attribute, $rule, $parameters) { $parameters[1] = $this->getDisplayableValue($parameters[0], Arr::get($this->data, $parameters[0])); $parameters[0] = $this->getDisplayableAttribute($parameters[0]); return str_replace([':other', ':value'], $parameters, $message); }
Replace all place-holders for the missing_if rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceMissingIf
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceMissingUnless($message, $attribute, $rule, $parameters) { return str_replace([':other', ':value'], [ $this->getDisplayableAttribute($parameters[0]), $this->getDisplayableValue($parameters[0], $parameters[1]), ], $message); }
Replace all place-holders for the missing_unless rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceMissingUnless
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceMissingWith($message, $attribute, $rule, $parameters) { return str_replace(':values', implode(' / ', $this->getAttributeList($parameters)), $message); }
Replace all place-holders for the missing_with rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceMissingWith
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceMissingWithAll($message, $attribute, $rule, $parameters) { return $this->replaceMissingWith($message, $attribute, $rule, $parameters); }
Replace all place-holders for the missing_with_all rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceMissingWithAll
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceMultipleOf($message, $attribute, $rule, $parameters) { return str_replace(':value', $parameters[0] ?? '', $message); }
Replace all place-holders for the multiple_of rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceMultipleOf
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceNotIn($message, $attribute, $rule, $parameters) { return $this->replaceIn($message, $attribute, $rule, $parameters); }
Replace all place-holders for the not_in rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceNotIn
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceInArray($message, $attribute, $rule, $parameters) { return str_replace(':other', $this->getDisplayableAttribute($parameters[0]), $message); }
Replace all place-holders for the in_array rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceInArray
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceMimetypes($message, $attribute, $rule, $parameters) { return str_replace(':values', implode(', ', $parameters), $message); }
Replace all place-holders for the mimetypes rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceMimetypes
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceMimes($message, $attribute, $rule, $parameters) { return str_replace(':values', implode(', ', $parameters), $message); }
Replace all place-holders for the mimes rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceMimes
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replacePresentIf($message, $attribute, $rule, $parameters) { $parameters[1] = $this->getDisplayableValue($parameters[0], Arr::get($this->data, $parameters[0])); $parameters[0] = $this->getDisplayableAttribute($parameters[0]); return str_replace([':other', ':value'], $parameters, $message); }
Replace all place-holders for the present_if rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replacePresentIf
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replacePresentUnless($message, $attribute, $rule, $parameters) { return str_replace([':other', ':value'], [ $this->getDisplayableAttribute($parameters[0]), $this->getDisplayableValue($parameters[0], $parameters[1]), ], $message); }
Replace all place-holders for the present_unless rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replacePresentUnless
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replacePresentWith($message, $attribute, $rule, $parameters) { return str_replace(':values', implode(' / ', $this->getAttributeList($parameters)), $message); }
Replace all place-holders for the present_with rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replacePresentWith
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replacePresentWithAll($message, $attribute, $rule, $parameters) { return $this->replacePresentWith($message, $attribute, $rule, $parameters); }
Replace all place-holders for the present_with_all rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replacePresentWithAll
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceRequiredWith($message, $attribute, $rule, $parameters) { return str_replace(':values', implode(' / ', $this->getAttributeList($parameters)), $message); }
Replace all place-holders for the required_with rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceRequiredWith
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceRequiredWithAll($message, $attribute, $rule, $parameters) { return $this->replaceRequiredWith($message, $attribute, $rule, $parameters); }
Replace all place-holders for the required_with_all rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceRequiredWithAll
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceRequiredWithout($message, $attribute, $rule, $parameters) { return $this->replaceRequiredWith($message, $attribute, $rule, $parameters); }
Replace all place-holders for the required_without rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceRequiredWithout
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceRequiredWithoutAll($message, $attribute, $rule, $parameters) { return $this->replaceRequiredWith($message, $attribute, $rule, $parameters); }
Replace all place-holders for the required_without_all rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceRequiredWithoutAll
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceSize($message, $attribute, $rule, $parameters) { return str_replace(':size', $parameters[0], $message); }
Replace all place-holders for the size rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceSize
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceGt($message, $attribute, $rule, $parameters) { if (is_null($value = $this->getValue($parameters[0]))) { return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message); } return str_replace(':value', $this->getSize($attribute, $value), $message); }
Replace all place-holders for the gt rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceGt
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceLt($message, $attribute, $rule, $parameters) { if (is_null($value = $this->getValue($parameters[0]))) { return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message); } return str_replace(':value', $this->getSize($attribute, $value), $message); }
Replace all place-holders for the lt rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceLt
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceGte($message, $attribute, $rule, $parameters) { if (is_null($value = $this->getValue($parameters[0]))) { return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message); } return str_replace(':value', $this->getSize($attribute, $value), $message); }
Replace all place-holders for the gte rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceGte
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceLte($message, $attribute, $rule, $parameters) { if (is_null($value = $this->getValue($parameters[0]))) { return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message); } return str_replace(':value', $this->getSize($attribute, $value), $message); }
Replace all place-holders for the lte rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceLte
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceRequiredIf($message, $attribute, $rule, $parameters) { $parameters[1] = $this->getDisplayableValue($parameters[0], Arr::get($this->data, $parameters[0])); $parameters[0] = $this->getDisplayableAttribute($parameters[0]); return str_replace([':other', ':value'], $parameters, $message); }
Replace all place-holders for the required_if rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceRequiredIf
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceRequiredIfAccepted($message, $attribute, $rule, $parameters) { $parameters[0] = $this->getDisplayableAttribute($parameters[0]); return str_replace([':other'], $parameters, $message); }
Replace all place-holders for the required_if_accepted rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceRequiredIfAccepted
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
public function replaceRequiredIfDeclined($message, $attribute, $rule, $parameters) { $parameters[0] = $this->getDisplayableAttribute($parameters[0]); return str_replace([':other'], $parameters, $message); }
Replace all place-holders for the required_if_declined rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceRequiredIfDeclined
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceProhibitedIf($message, $attribute, $rule, $parameters) { $parameters[1] = $this->getDisplayableValue($parameters[0], Arr::get($this->data, $parameters[0])); $parameters[0] = $this->getDisplayableAttribute($parameters[0]); return str_replace([':other', ':value'], $parameters, $message); }
Replace all place-holders for the prohibited_if rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceProhibitedIf
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceProhibitedIfAccepted($message, $attribute, $rule, $parameters) { $parameters[0] = $this->getDisplayableAttribute($parameters[0]); return str_replace([':other'], $parameters, $message); }
Replace all place-holders for the prohibited_if_accepted rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceProhibitedIfAccepted
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
public function replaceProhibitedIfDeclined($message, $attribute, $rule, $parameters) { $parameters[0] = $this->getDisplayableAttribute($parameters[0]); return str_replace([':other'], $parameters, $message); }
Replace all place-holders for the prohibited_if_declined rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceProhibitedIfDeclined
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceProhibits($message, $attribute, $rule, $parameters) { return str_replace(':other', implode(' / ', $this->getAttributeList($parameters)), $message); }
Replace all place-holders for the prohibited_with rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceProhibits
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceSame($message, $attribute, $rule, $parameters) { return str_replace(':other', $this->getDisplayableAttribute($parameters[0]), $message); }
Replace all place-holders for the same rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceSame
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceBefore($message, $attribute, $rule, $parameters) { if (! strtotime($parameters[0])) { return str_replace(':date', $this->getDisplayableAttribute($parameters[0]), $message); } return str_replace(':date', $this->getDisplayableValue($attribute, $parameters[0]), $message); }
Replace all place-holders for the before rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceBefore
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceBeforeOrEqual($message, $attribute, $rule, $parameters) { return $this->replaceBefore($message, $attribute, $rule, $parameters); }
Replace all place-holders for the before_or_equal rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceBeforeOrEqual
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceAfter($message, $attribute, $rule, $parameters) { return $this->replaceBefore($message, $attribute, $rule, $parameters); }
Replace all place-holders for the after rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceAfter
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceAfterOrEqual($message, $attribute, $rule, $parameters) { return $this->replaceBefore($message, $attribute, $rule, $parameters); }
Replace all place-holders for the after_or_equal rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceAfterOrEqual
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
protected function replaceDateEquals($message, $attribute, $rule, $parameters) { return $this->replaceBefore($message, $attribute, $rule, $parameters); }
Replace all place-holders for the date_equals rule. @param string $message @param string $attribute @param string $rule @param array<int,string> $parameters @return string
replaceDateEquals
php
laravel/framework
src/Illuminate/Validation/Concerns/ReplacesAttributes.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Validation/Concerns/ReplacesAttributes.php
MIT
public function notifications() { return $this->morphMany(DatabaseNotification::class, 'notifiable')->latest(); }
Get the entity's notifications. @return \Illuminate\Database\Eloquent\Relations\MorphMany<DatabaseNotification, $this>
notifications
php
laravel/framework
src/Illuminate/Notifications/HasDatabaseNotifications.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Notifications/HasDatabaseNotifications.php
MIT
public function readNotifications() { return $this->notifications()->read(); }
Get the entity's read notifications. @return \Illuminate\Database\Query\Builder
readNotifications
php
laravel/framework
src/Illuminate/Notifications/HasDatabaseNotifications.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Notifications/HasDatabaseNotifications.php
MIT
public function unreadNotifications() { return $this->notifications()->unread(); }
Get the entity's unread notifications. @return \Illuminate\Database\Query\Builder
unreadNotifications
php
laravel/framework
src/Illuminate/Notifications/HasDatabaseNotifications.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Notifications/HasDatabaseNotifications.php
MIT
public function broadcastOn() { return []; }
Get the channels the event should broadcast on. @return array
broadcastOn
php
laravel/framework
src/Illuminate/Notifications/Notification.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Notifications/Notification.php
MIT
public function notifiable() { return $this->morphTo(); }
Get the notifiable entity that the notification belongs to. @return \Illuminate\Database\Eloquent\Relations\MorphTo<\Illuminate\Database\Eloquent\Model, $this>
notifiable
php
laravel/framework
src/Illuminate/Notifications/DatabaseNotification.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Notifications/DatabaseNotification.php
MIT
public function sendNow($notifiables, $notification, ?array $channels = null) { (new NotificationSender( $this, $this->container->make(Bus::class), $this->container->make(Dispatcher::class), $this->locale) )->sendNow($notifiables, $notification, $channels); }
Send the given notification immediately. @param \Illuminate\Support\Collection|array|mixed $notifiables @param mixed $notification @param array|null $channels @return void
sendNow
php
laravel/framework
src/Illuminate/Notifications/ChannelManager.php
https://github.com/laravel/framework/blob/master/src/Illuminate/Notifications/ChannelManager.php
MIT