本文整理汇总了PHP中Illuminate\Support\Arr::sortRecursive方法的典型用法代码示例。如果您正苦于以下问题:PHP Arr::sortRecursive方法的具体用法?PHP Arr::sortRecursive怎么用?PHP Arr::sortRecursive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Arr
的用法示例。
在下文中一共展示了Arr::sortRecursive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
Audit::log(Auth::user()->id, trans('admin/settings/general.audit-log.category'), trans('admin/settings/general.audit-log.msg-index'));
$page_title = trans('admin/settings/general.page.index.title');
// "Admin | Settings";
$page_description = trans('admin/settings/general.page.index.description');
// "List of Settings";
// $settings = (new SettingModel())->all();
$settings = Setting::all();
$settings = Arr::dot($settings);
$settingsFiltered = Utils::FilterOutUserSettings($settings);
$settingsFiltered = Arr::sortRecursive($settingsFiltered);
return view('admin.settings.index', compact('settingsFiltered', 'page_title', 'page_description'));
}
示例2:
/**
* Recursively sort an array by keys and values.
*
* @param array $array
* @return array
*/
function array_sort_recursive($array)
{
return Arr::sortRecursive($array);
}
示例3: seeJsonContains
/**
* Assert that the response contains the given JSON.
*
* @param array $data
* @param bool $negate
* @return $this
*/
protected function seeJsonContains(array $data, $negate = false)
{
$method = $negate ? 'assertFalse' : 'assertTrue';
$actual = json_encode(Arr::sortRecursive((array) $this->decodeResponseJson()));
foreach (Arr::sortRecursive($data) as $key => $value) {
$expected = $this->formatToExpectedJson($key, $value);
$this->{$method}(Str::contains($actual, $expected), ($negate ? 'Found unexpected' : 'Unable to find') . ' JSON fragment' . PHP_EOL . "[{$expected}]" . PHP_EOL . 'within' . PHP_EOL . "[{$actual}].");
}
return $this;
}
示例4: seeJsonContains
/**
* Assert that the response contains the given JSON.
*
* @param array $data
* @param bool $negate
* @return $this
*/
protected function seeJsonContains(array $data, $negate = false)
{
$method = $negate ? 'assertFalse' : 'assertTrue';
$actual = json_decode($this->response->getContent(), true);
if (is_null($actual) || $actual === false) {
return $this->fail('Invalid JSON was returned from the route. Perhaps an exception was thrown?');
}
$actual = json_encode(Arr::sortRecursive((array) $actual));
foreach (Arr::sortRecursive($data) as $key => $value) {
$expected = $this->formatToExpectedJson($key, $value);
$this->{$method}(Str::contains($actual, $expected), ($negate ? 'Found unexpected' : 'Unable to find') . " JSON fragment [{$expected}] within [{$actual}].");
}
return $this;
}