Showing 7 of 1,216 result(s)
The array_only function is a shortcut to calling Arr::only . This function is declared in the global namespace.
The signature of the first method is:
The following code sample is an anonymous function assigned to a variable named $isPostFormat . The following example will use the Str::is helper method to check if a value is of the format /post/* : If a given value satisfies the format, true is...
The $callback function is an optional parameter, and can be omitted. When the $callback parameter is omitted, the first method will return the first item in the array:
The array_first function is a shortcut to calling Arr::first . This function is declared in the global namespace.
The signature of the last method is:
The following section builds of the code example we covered in the first section; using it, we can find the last post in a list that matches the /post/* format: we could get the last post in the following array like so: the value of $lastPost...