Showing 7 of 1,975 result(s)
The replaceFirst helper method is used to replace the first occurrence of a given $search string with the provided $replace string in the $subject string. All three parameters are required and must be strings. The signature for the replaceFirst...
The count method is a straightforward method and simply returns the total number of items in the collection. The count method returns an integer.This article is the start of a mini-series about Laravel's ErrorMessageBag component. Click through...
The keys method is used to retrieve all of keys stored inside the MessageBag instance. The following code example demonstrate the usage of the keys method: After the above code has executed, the $keys variable will be an array that contains a...
…e parameter. If a user does not specify any value when calling the command, the default value is used: Now, when a user is executing the command, an argument for the lastName parameter is not required. The following two command calls would are...
The get method can be used to retrieve the translation line for the provided $key . This method can also process any replacements within the translation line itself (by passing an array argument for the $replace parameter). This method also...
The has method determines if a translation line exists for the specified locale. It accepts a $key , which corresponds to an array key within the translation group file, i.e., user . The method also accepts a $locale , which can be used to...
…s. The namespace refers to a custom namespace (or the default * namespace); the group refers to a particular file, such as passwords.php and the item refers to a particular key within the array returned by the file. The following code examples...