Laravel 8 Arr::only() {#collection-method}
Arr::only
函数只返回给定数组中指定的键值对:
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100, 'orders' => 10];
$slice = Arr::only($array, ['name', 'price']);
// ['name' => 'Desk', 'price' => 100]