Fixed
This commit is contained in:
parent
92efb4498d
commit
65c47fe151
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
|
use App\Enums\ScoreEnum;
|
||||||
use App\Models\Student;
|
use App\Models\Student;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Pagination\LengthAwarePaginator;
|
use Illuminate\Pagination\LengthAwarePaginator;
|
||||||
@ -27,6 +28,9 @@ class StudentService implements ServiceInterface
|
|||||||
'grade_id' => $data['grade_id'],
|
'grade_id' => $data['grade_id'],
|
||||||
]);
|
]);
|
||||||
$student->user()->save($user);
|
$student->user()->save($user);
|
||||||
|
$student
|
||||||
|
->lessons()
|
||||||
|
->syncWithPivotValues($student->grade->lessons->pluck('id')->all(), ['score' => ScoreEnum::WithoutScore]);
|
||||||
|
|
||||||
return $student;
|
return $student;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user