Search

Showing 7 of 1,975 result(s)

/blog/2016/11/16/laravel-string-helper-function-str_replace_first

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...

/blog/2016/11/29/laravel-messagebag-public-api-count

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...

/blog/2016/11/29/laravel-messagebag-public-api-keys

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...

/blog/2016/12/01/laravel-artisan-command-input-and-command-signatures#content-input-parameter-default-values

…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...

/blog/2018/02/20/laravel-5-string-translation-public-api#content-retrieving-translation-line-text-with-get

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...

/blog/2018/02/20/laravel-5-string-translation-public-api#content-determining-if-a-translation-line-exists-with-has

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...

/blog/2018/02/20/laravel-5-string-translation-public-api#content-parsing-translation-keys-with-parsekey

…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...