Search

Showing 7 of 1,216 result(s)

/blog/2018/04/11/laravel-5-ensuring-a-value-is-an-array-with-wrap#content-example-use

In the introduction of this section, we saw this example code: We could do the same thing using the wrap method like so: The Arr::wrap method will not do anything to the input $value if it is already an array. We can round this section out by...

/blog/2018/04/11/laravel-5-ensuring-a-value-is-an-array-with-wrap#content-global-arraywrap-helper-function

The array_wrap helper function is a shortcut to calling Arr:wrap . This function is declared in the global namespace.

/blog/2018/04/11/laravel-5-excluding-items-from-an-array-with-except#content-example-use

The following examples assume that the $_POST super-global contains the following information: We could easily get all the information except for the password like so: $inputData would then contain the following items: When passing a single item,...

/blog/2018/04/11/laravel-5-excluding-items-from-an-array-with-except#content-global-arrayexcept-helper-function

The array_except function is a shortcut to calling Arr::except . This function is declared in the global namespace.

/blog/2018/04/11/laravel-5-filtering-array-elements-with-only#content-example-use

The only helper method is the logical opposite of the except method. Using the same $_POST array from the previous example, we could retrieve only a user's first name like so: With the resulting array looking like this: