This commit is contained in:
Adrian Hopek
2022-04-14 14:29:36 +02:00
parent 27c43872ba
commit e3998238ef
13 changed files with 499 additions and 183 deletions

View File

@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Toby\Eloquent\Models\User;
class GiveKeyRequest extends FormRequest
{
public function rules(): array
{
return [
"user" => ["required", "exists:users,id"],
];
}
public function recipient(): User
{
return User::find($this->get("user"));
}
}