This commit is contained in:
hackerESQ
2025-01-26 22:56:05 -06:00
parent 169eabd800
commit ea4602abc7
7 changed files with 157 additions and 37 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class PortfolioRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
$rules = [
'title' => ['required', 'string', 'min:5', 'max:255'],
'notes' => ['sometimes', 'nullable', 'string'],
'wishlist' => ['sometimes', 'nullable', 'boolean'],
];
if (!is_null($this->portfolio)) {
$rules['title'][0] = 'sometimes';
}
return $rules;
}
}