Spaces:
Running
Running
Download app/Repositories/ScientistRepository.php from Ailixir-AI-Team/ailixir-api: direct link, hf CLI and curl.
- Browser
- Download file 500 Bytes
-
https://huggingface.co/spaces/Ailixir-AI-Team/ailixir-api/resolve/main/app/Repositories/ScientistRepository.php
- Command line
-
hf download hf://spaces/Ailixir-AI-Team/ailixir-api/app/Repositories/ScientistRepository.php
-
curl -L -o ScientistRepository.php https://huggingface.co/spaces/Ailixir-AI-Team/ailixir-api/resolve/main/app/Repositories/ScientistRepository.php
500 Bytes
| namespace App\Repositories; | |
| use App\Models\Scientist; | |
| class ScientistRepository | |
| { | |
| public function paginate($perPage) | |
| { | |
| return Scientist::query() | |
| ->select('id', 'name', 'images', 'bio', 'field') | |
| ->with(['awards:id,name,category,images']) | |
| ->withCount('awards') | |
| ->paginate($perPage); | |
| } | |
| public function findWithAwards($id) | |
| { | |
| return Scientist::with(['awards:id,name,category,images'])->findOrFail($id); | |
| } | |
| } | |