Merge pull request 'Implement projects and project keys' (#5) from codex/0.1-kanban-foundation/02-projects-and-project-keys into main
linter / quality (push) Successful in 1m15s
tests / ci (8.4) (push) Successful in 1m14s

Reviewed-on: OpenSource/KanbanGit#5
This commit was merged in pull request #5.
This commit is contained in:
2026-03-25 20:15:42 +00:00
17 changed files with 721 additions and 1 deletions
+46
View File
@@ -0,0 +1,46 @@
<?php
namespace App\Http\Requests;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreProjectRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return $this->user() !== null;
}
protected function prepareForValidation(): void
{
if ($this->has('key')) {
$this->merge([
'key' => strtoupper((string) $this->string('key')->trim()),
]);
}
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'key' => [
'required',
'string',
'max:5',
'regex:/^[A-Z0-9]+$/',
Rule::unique('projects', 'key'),
],
'name' => ['required', 'string', 'max:255'],
];
}
}