1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-03-13 01:30:11 +01:00

feat: Aggiunti campi POST a UserRepository

This commit is contained in:
Maicol Battistini 2023-05-11 15:21:35 +02:00
parent e151c0a67c
commit 901bc12b18
No known key found for this signature in database

View File

@ -4,6 +4,7 @@ namespace App\Restify;
use App\Models\User;
use Binaryk\LaravelRestify\Http\Requests\RestifyRequest;
use Illuminate\Support\Facades\Hash;
class UserRepository extends Repository
{
@ -25,4 +26,14 @@ class UserRepository extends Repository
field('updated_at')->label('updatedAt')->readonly(),
];
}
public function fieldsForStore(RestifyRequest $request): array
{
return [
...$this->fields($request),
field('password')
->rules('required')
->storeCallback(static fn (string $value) => Hash::make($value)),
];
}
}