1
0
mirror of https://github.com/robonen/education-project.git synced 2026-03-20 02:44:31 +00:00

Правки после слияния

This commit is contained in:
ashen-1-dev
2020-12-17 00:27:04 +07:00
29 changed files with 1206 additions and 100 deletions

View File

@@ -7,6 +7,7 @@ use App\Http\Requests\StudentRequest;
use App\Models\SchoolClass;
use App\Models\Student;
use Illuminate\Http\JsonResponse;
use App\Models\AnswerToTask;
class StudentController extends Controller
{
@@ -31,6 +32,18 @@ class StudentController extends Controller
return response()->json($student, 200);
}
/**
* Создание ученика
*
* @param StudentRequest $request
* @return JsonResponse
*/
/*public function store(StudentRequest $request)
{
$student = Student::creat($request->all());
return response()->json($student, 200);
}*/
/**
* Обновление ученика
*
@@ -54,6 +67,7 @@ class StudentController extends Controller
return response()->json(collect($student)->except('school_class'), 200);
}
public function destroy(Student $student)
{
$user = $student->user;
@@ -61,4 +75,9 @@ class StudentController extends Controller
return response()->json(null, 204);
}
public function getAnswers(Student $student) {
return AnswerToTask::where('student_id', '=', $student->id)->get();
}
}