dd/app/Http/Requests/Nasa/NasaQueryRequest.php
2026-06-14 15:46:45 +08:00

38 lines
832 B
PHP

<?php
namespace App\Http\Requests\Nasa;
use Illuminate\Foundation\Http\FormRequest;
class NasaQueryRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
];
}
public function cleanQuery(): array
{
// 🧬 利用 Laravel 11 极其强大的 collect 简化闭环
return collect($this->query())->transform(function ($xValue) {
return is_null($xValue) ? '' : $xValue;
})->all();
}
}