Slide 36
Slide 36 text
1 repository = $repository;
24 }
25
26 public function __invoke($id = null, array $data): User
27 {
28 if (Arr::has($data, 'password')) {
29 $data['password'] = Hash::make($data['password']);
30 }
31
32 return $this->repository->save($id, $data);
33 }
34 }