mirror of
https://github.com/robonen/education-project.git
synced 2026-03-20 02:44:31 +00:00
Merge branch 'timetable' of github.com:Robonen/education-project into timetable
This commit is contained in:
@@ -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
|
||||
{
|
||||
@@ -66,7 +67,17 @@ class StudentController extends Controller
|
||||
return response()->json(collect($student)->except('school_class'), 200);
|
||||
}
|
||||
|
||||
|
||||
public function destroy(Student $student)
|
||||
{
|
||||
$user = $student->user;
|
||||
$user->delete();
|
||||
return response()->json(null, 204);
|
||||
}
|
||||
|
||||
|
||||
public function getAnswers(Student $student) {
|
||||
return AnswerToTask::where('student_id', '=', $student->id)->get();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user