|
|
@@ -3,7 +3,6 @@
|
|
|
namespace App\Services;
|
|
|
|
|
|
use App\Models\Student;
|
|
|
-use App\Models\StudentResponsible;
|
|
|
use App\Models\User;
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
|
use Illuminate\Http\UploadedFile;
|
|
|
@@ -41,19 +40,9 @@ public function update(int $id, array $data): ?Student
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- $responsibleData = $data['responsible'] ?? null;
|
|
|
- unset($data['responsible']);
|
|
|
-
|
|
|
$data = $this->handlePhoto($data, $model->photo_url);
|
|
|
$model->update($data);
|
|
|
|
|
|
- if ($responsibleData !== null) {
|
|
|
- StudentResponsible::updateOrCreate(
|
|
|
- ['student_id' => $id],
|
|
|
- array_merge($responsibleData, ['student_id' => $id]),
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
return $model->fresh();
|
|
|
}
|
|
|
|