Spaces:
Running
Running
Download app/Repositories/ProfileRepository.php from Ailixir-AI-Team/ailixir-api: direct link, hf CLI and curl.
- Browser
- Download file 607 Bytes
-
https://huggingface.co/spaces/Ailixir-AI-Team/ailixir-api/resolve/06e8928c07068b151bcea9d64ac2b8b28c9090ff/app/Repositories/ProfileRepository.php
- Command line
-
hf download hf://spaces/Ailixir-AI-Team/ailixir-api@06e8928c07068b151bcea9d64ac2b8b28c9090ff/app/Repositories/ProfileRepository.php
-
curl -L -o ProfileRepository.php https://huggingface.co/spaces/Ailixir-AI-Team/ailixir-api/resolve/06e8928c07068b151bcea9d64ac2b8b28c9090ff/app/Repositories/ProfileRepository.php
607 Bytes
| namespace App\Repositories; | |
| use App\Models\User; | |
| use App\Models\Researcher; | |
| class ProfileRepository | |
| { | |
| public function saveUser(User $user): User | |
| { | |
| $user->save(); | |
| return $user; | |
| } | |
| public function getUserResearcher(User $user): ?Researcher | |
| { | |
| return $user->researcher; | |
| } | |
| public function createResearcher(array $data): Researcher | |
| { | |
| return Researcher::create($data); | |
| } | |
| public function updateResearcher(Researcher $researcher, array $data): Researcher | |
| { | |
| $researcher->update($data); | |
| return $researcher; | |
| } | |
| } | |