mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-30 19:10:14 +02:00
feat: ✨ Aggiunti campi POST a UserRepository
This commit is contained in:
parent
e151c0a67c
commit
901bc12b18
@ -4,6 +4,7 @@ namespace App\Restify;
|
|||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Binaryk\LaravelRestify\Http\Requests\RestifyRequest;
|
use Binaryk\LaravelRestify\Http\Requests\RestifyRequest;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
class UserRepository extends Repository
|
class UserRepository extends Repository
|
||||||
{
|
{
|
||||||
@ -25,4 +26,14 @@ class UserRepository extends Repository
|
|||||||
field('updated_at')->label('updatedAt')->readonly(),
|
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)),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user