Available Methods
Arrays & Objects
array_addarray_collapsearray_dividearray_dotarray_exceptarray_firstarray_flattenarray_forgetarray_getarray_hasarray_lastarray_onlyarray_pluckarray_prependarray_pullarray_randomarray_setarray_sortarray_sort_recursivearray_wherearray_wrapdata_filldata_getdata_setheadlastPaths
app_pathbase_pathconfig_pathdatabase_pathmixpublic_pathresource_pathstorage_pathStrings
__camel_caseclass_basenameeends_withkebab_casepreg_replace_arraysnake_casestarts_withstr_afterstr_beforestr_containsstr_finishstr_isstr_limitStr::orderedUuidstr_pluralstr_randomstr_replace_arraystr_replace_firststr_replace_laststr_singularstr_slugstr_startstudly_casetitle_casetranstrans_choiceStr::uuidURLs
actionassetsecure_assetroutesecure_urlurlMiscellaneous
abortabort_ifabort_unlessappauthbackbcryptblankbroadcastcacheclass_uses_recursivecollectconfigcookiecsrf_fieldcsrf_tokendddecryptdispatchdispatch_nowdumpencryptenveventfactoryfilledinfologgermethod_fieldnowoldoptionalpolicyredirectreportrequestrescueresolveresponseretrysessiontaptodaythrow_ifthrow_unlesstrait_uses_recursivetransformvalidatorvalueviewwith
$array = array_add(['name' => 'Desk'], 'price', 100); $array = array_collapse([[1, 2, 3], [4, 5, 6], [7, 8, 9]]); [$keys, $values] = array_divide(['name' => 'Desk']); $array = ['products' => ['desk' => ['price' => 100]]]; $flattened = array_dot($array); $array = ['name' => 'Desk', 'price' => 100]; $filtered = array_except($array, ['price']); $array = [100, 200, 300]; $first = array_first($array, function ($value, $key) { return $value >= 150; }); $first = array_first($array, $callback, $default); $array = ['name' => 'Joe', 'languages' => ['PHP', 'Ruby']]; $flattened = array_flatten($array); $array = ['products' => ['desk' => ['price' => 100]]]; array_forget($array, 'products.desk'); $array = ['products' => ['desk' => ['price' => 100]]]; $price = array_get($array, 'products.desk.price'); $discount = array_get($array, 'products.desk.discount', 0); $array = ['product' => ['name' => 'Desk', 'price' => 100]]; $contains = array_has($array, 'product.name'); // true $contains = array_has($array, ['product.price', 'product.discount']); $array = [100, 200, 300, 110]; $last = array_last($array, function ($value, $key) { return $value >= 150; }); $last = array_last($array, $callback, $default); $array = ['name' => 'Desk', 'price' => 100, 'orders' => 10]; $slice = array_only($array, ['name', 'price']); $array = [ ['developer' => ['id' => 1, 'name' => 'Taylor']], ['developer' => ['id' => 2, 'name' => 'Abigail']], ]; $names = array_pluck($array, 'developer.name'); $names = array_pluck($array, 'developer.name', 'developer.id'); $array = ['one', 'two', 'three', 'four']; $array = array_prepend($array, 'zero'); $array = ['price' => 100]; $array = array_prepend($array, 'Desk', 'name'); $array = ['name' => 'Desk', 'price' => 100]; $name = array_pull($array, 'name'); $value = array_pull($array, $key, $default); $array = [1, 2, 3, 4, 5]; $random = array_random($array); $array = ['products' => ['desk' => ['price' => 100]]]; array_set($array, 'products.desk.price', 200); $array = ['Desk', 'Table', 'Chair']; $sorted = array_sort($array); $array = [ ['name' => 'Desk'], ['name' => 'Table'], ['name' => 'Chair'], ]; $sorted = array_values(array_sort($array, function ($value) { return $value['name']; })); $string = 'Laravel'; $array = array_wrap($string); $nothing = null; $array = array_wrap($nothing);