From ba578e9fdf02b25e4b06d43be8f230749541879c Mon Sep 17 00:00:00 2001 From: ashen-1-dev Date: Wed, 9 Dec 2020 19:02:38 +0700 Subject: [PATCH] =?UTF-8?q?=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8C=20=D0=97?= =?UTF-8?q?=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F(=D0=BF=D0=BE=D1=87=D1=82?= =?UTF-8?q?=D0=B8=20=D0=B3=D0=BE=D1=82=D0=BE=D0=B2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AnswerToTaskController.php | 55 ++ .../{ => BankTask}/BankTaskController.php | 7 +- .../{ => BankTask}/BankTaskFileController.php | 3 +- .../{ => BankTask}/SubjectController.php | 3 +- .../{ => BankTask}/ThemeController.php | 3 +- app/Http/Controllers/TaskController.php | 110 ++-- app/Http/Controllers/TaskFileController.php | 134 +++++ app/Http/Requests/TaskRequest.php | 26 + app/Models/AnswerToTask.php | 14 + app/Models/SchoolClass.php | 4 + app/Models/Task.php | 14 +- app/Models/TaskFile.php | 13 + app/Models/TaskHistory.php | 15 + app/Models/Teacher.php | 3 + composer.lock | 567 ++++++++++-------- .../2020_12_03_172010_create_tasks_table.php | 45 ++ ...07_120455_create_answers_to_task_table.php | 41 ++ ...0_12_08_122859_create_task_files_table.php | 43 ++ routes/api.php | 44 +- 19 files changed, 842 insertions(+), 302 deletions(-) create mode 100644 app/Http/Controllers/AnswerToTaskController.php rename app/Http/Controllers/{ => BankTask}/BankTaskController.php (93%) rename app/Http/Controllers/{ => BankTask}/BankTaskFileController.php (97%) rename app/Http/Controllers/{ => BankTask}/SubjectController.php (95%) rename app/Http/Controllers/{ => BankTask}/ThemeController.php (95%) create mode 100644 app/Http/Controllers/TaskFileController.php create mode 100644 app/Http/Requests/TaskRequest.php create mode 100644 app/Models/AnswerToTask.php create mode 100644 app/Models/TaskFile.php create mode 100644 app/Models/TaskHistory.php create mode 100644 database/migrations/2020_12_03_172010_create_tasks_table.php create mode 100644 database/migrations/2020_12_07_120455_create_answers_to_task_table.php create mode 100644 database/migrations/2020_12_08_122859_create_task_files_table.php diff --git a/app/Http/Controllers/AnswerToTaskController.php b/app/Http/Controllers/AnswerToTaskController.php new file mode 100644 index 0000000..075974b --- /dev/null +++ b/app/Http/Controllers/AnswerToTaskController.php @@ -0,0 +1,55 @@ +all(); + $input->class_id = $task->class_id; // Не работает + $input->student_id = Student::where('user_id', '=', Auth::id())->get(['id']); // Не работает + + $answer = AnswerToTask::create($input); + return response()->json($answer, 201); + + } + + public function show(Task $task, Student $student) { + $answer = AnswerToTask::where([ + ['student_id', '=', $student->id], + ['task_id', '=', $task->id] + ])->get(); + $file = TaskFile::where([ + ['student_id', '=', $student->id], + ['task_id', '=', $task->id] + ]) + ->get(['id','name', 'type', 'url']); + + return response()->json([ + 'answer' => $answer, + 'files' => $file + ],200); + } + + public function delete(AnswerToTask $answer){ + $answer->delete(); + + return response()->json(true, 204); + } + + public function update(AnswerToTask $answer, Request $request) { + $answer->description = $request->input('description'); + $answer->save(); + + return $answer; + + } + +} diff --git a/app/Http/Controllers/BankTaskController.php b/app/Http/Controllers/BankTask/BankTaskController.php similarity index 93% rename from app/Http/Controllers/BankTaskController.php rename to app/Http/Controllers/BankTask/BankTaskController.php index a6fbf34..a7534ac 100644 --- a/app/Http/Controllers/BankTaskController.php +++ b/app/Http/Controllers/BankTask/BankTaskController.php @@ -1,6 +1,6 @@ newQuery(); if ($request->has('name')) { - $tasks->where('name', 'like', $request->input('name').'%'); + $tasks->where('name', 'ilike', $request->input('name').'%'); } if ($request->has('subject_id')) { $tasks->where('subject_id', $request->input('subject_id')); @@ -37,7 +38,7 @@ class BankTaskController extends Controller } if ($request->has('author')) { - $tasks->where('author', 'like', $request->input('author').'%'); + $tasks->where('author', 'ilike', $request->input('author').'%'); } if ($request->has('count')) { diff --git a/app/Http/Controllers/BankTaskFileController.php b/app/Http/Controllers/BankTask/BankTaskFileController.php similarity index 97% rename from app/Http/Controllers/BankTaskFileController.php rename to app/Http/Controllers/BankTask/BankTaskFileController.php index c4f5df6..94addec 100644 --- a/app/Http/Controllers/BankTaskFileController.php +++ b/app/Http/Controllers/BankTask/BankTaskFileController.php @@ -1,12 +1,13 @@ class_id); + } + + public function store(TaskRequest $request) { + $class = SchoolClass::find(1); + $teacherId = 1; // Auth()->id(); + $newTask = $class->tasks()->create($request->all() + ['teacher_id' => $teacherId]); + + + return response()->json($newTask, 201); + } + + public function addbanktask(Task $task, Request $request) { + $temp = new TaskHistory(); + $temp->task_id = $task->id; + $temp->banktask_id = $request->input('banktask_id'); // Баг - можно впихнуть 2 одинаковых задания из банка задач в один таск + + $temp->save(); + + return response()->json($temp, 201); + } + + public function show(Task $task) { + $file = TaskFile::where([ + ['task_id', '=', $task->id], + ['add_by_teacher', '=', '1'] + ])->get(['id', 'name', 'type', 'url', 'user_id']); + return response()->json([ + 'task' => $task, + 'files' => $file + + ], 200); + } + + public function delete(Task $task) { + $task->delete(); + + return response()->json(true, 200); + } + + public function update(Task $task, TaskRequest $request) { $request->validate([ - 'name' => 'required|min:5|max:100', - 'subject_id' => 'required' + 'name' => 'required|min:5:max:100', ]); + $task->update($request->all()); +// $task->name = $request->input('name'); +// $task->description = $request->input('description'); - $add_new = new Task; - $add_new->name = $request->input('name'); - $add_new->description = $request->input('description'); - $add_new->subject_id = $request->input('subject_id'); - $add_new->path_to_task = $request->input('path_to_task'); - $add_new->save(); - - return Task::findOrFail($add_new->id); - - } - - public function index() - { - return Task::all(); // Здесь наверное лучше выводить только задания по конкретному предмету - // Добавить сортировку - } - - public function showTask($taskId) - { - return Task::where('id', '=', $taskId)->get(); - } - - public function editTask(Task $task, Request $request) - { - $request->validate([ - 'name' => 'required|min:5:max:100', - 'subject_id' => 'required' - ]); - - $task->name = $request->input('name'); - $task->description = $request->input('description'); - $task->path_to_task = $request->input('path_to_task'); $task->save(); return Task::where('id', '=', $task->id)->get(); } - public function deleteTask(Task $task) - { - $task->delete(); + public function checkAnswer(AnswerToTask $answer, Request $request) { + $request->validate([ + 'mark' => 'required|numeric' + ]); - return 'Task №' . $task->id . ' has been deleted'; + $answer->comment_by_teacher = $request->input('comment_by_teacher'); + $answer->mark = $request->input('mark'); + $answer->checked = 1; + $answer->save(); + + return response()->json($answer, 200); } -} + + +} \ No newline at end of file diff --git a/app/Http/Controllers/TaskFileController.php b/app/Http/Controllers/TaskFileController.php new file mode 100644 index 0000000..0955f97 --- /dev/null +++ b/app/Http/Controllers/TaskFileController.php @@ -0,0 +1,134 @@ +id; + $studentId = Student::where('user_id', '=', Auth::id())->get(); + $max_size = (int)ini_get('upload_max_filesize') * 1000; + $all_ext = implode(',', $this->allExtensions()); + $this->validate($request, [ + 'name' => 'required', + 'file' => 'required|file|mimes:' . $all_ext . '|max:' . $max_size + ]); + + $file = $request->file('file'); + $ext = $file->getClientOriginalExtension(); + $type = $this->getType($ext); + + if(auth()->user()->role_id == 2) { + if (Storage::putFileAs('public/task/' . $taskId . '/' . $type . '/', $file, $request->name)) { + TaskFile::create( + [ + 'name' => $request->name, + 'type' => $type, + 'extension' => $ext, + 'task_id' => $taskId, + 'url' => '/storage/task' . '/' . $taskId . '/' . $type . '/' . $request->name, + 'user_id' => Auth::id(), + 'add_by_teacher' => 1, + $file, + $request->name . $ext + ] + ); + return response()->json(true, 201); + } + } elseif (auth()->user()->role_id == 3) { + if (Storage::putFileAs('public/task/' . $taskId . '/student/'. Auth::id() . $type . '/', $file, $request->name)) { + TaskFile::create( + [ + 'name' => $request->name, + 'type' => $type, + 'extension' => $ext, + 'task_id' => $taskId, + 'url' => '/storage/task' . '/' . $taskId . '/student/'. Auth::id() . $type . '/' . $request->name, + 'user_id' => Auth::id(), + $file, + $request->name . $ext + ] + ); + return response()->json(true, 201); + } + + } + return response()->json(false, 422); + } + + public function showFiles(Task $task) + { + + $taskId = $task->id; + $files = TaskFile::where('task_id', '=', $taskId)->get(); + + return response()->json($files, 200); + + } + + public function download(TaskFile $file) + { + return Storage::download('/public/task/' . $file->task_id . '/' . $file->type . '/' . $file->name); + } + +// public function update(TaskFile $file, Request $request) Бесполезная функция +// { +// +// $request->validate([ +// 'name' => 'required' +// ]); +// $old_filename = '/public/task/' . $file->task_id . '/' . $file->type . '/' . $file->name; +// $new_filename = '/public/task/' . $file->task_id . '/' . $file->type . '/' . $request->name; +// +// if (Storage::disk('local')->exists($old_filename)) { +// if (Storage::disk('local')->move($old_filename, $new_filename)) { +// $file->name = $request->name; +// $file->url = '/storage/task/' . $file->task_id . '/' . $request->type . '/' . $file->name; +// return response()->json([$file->save(), $file]); +// } +// } +// +// return response()->json(false, 404); +// } + + public function delete(TaskFile $file) { + if (Storage::disk('local')->exists('/public/task/' . $file->task_id . '/' . $file->type . '/' . $file->name )) { + if (Storage::disk('local')->delete('/public/task/' . $file->task_id . '/' . $file->type . '/' . $file->name)) { + return response()->json($file->delete()); + } + } + return response()->json(['Not found'], 404); + } + + + private function getType($ext) + { + if (in_array(strtolower($ext), $this->image_ext)) { + return 'image'; + } + + if (in_array(strtolower($ext), $this->file_ext)) { + return 'file'; + } + } + + private function allExtensions() + { + return array_merge($this->image_ext, $this->file_ext); + } + + + +} diff --git a/app/Http/Requests/TaskRequest.php b/app/Http/Requests/TaskRequest.php new file mode 100644 index 0000000..08586c9 --- /dev/null +++ b/app/Http/Requests/TaskRequest.php @@ -0,0 +1,26 @@ + 'required|max:255', + + ]; + } +} diff --git a/app/Models/AnswerToTask.php b/app/Models/AnswerToTask.php new file mode 100644 index 0000000..0f78243 --- /dev/null +++ b/app/Models/AnswerToTask.php @@ -0,0 +1,14 @@ +withPivot('hours_per_week', 'hours_per_year'); } + public function tasks() { + return $this->hasMany(Task::class, 'class_id'); + } + } diff --git a/app/Models/Task.php b/app/Models/Task.php index 9252b54..d7d32d0 100644 --- a/app/Models/Task.php +++ b/app/Models/Task.php @@ -8,6 +8,18 @@ use Illuminate\Database\Eloquent\Model; class Task extends Model { use HasFactory; + protected $fillable = ['name', 'description', 'deadline', 'teacher_id', 'subject_id']; + + public function banktask() { + return $this->hasMany(BankTask::class, 'class_task'); + } + + public function teacher(){ + return $this->belongsTo(Teacher::class); + } + + public function class() { + $this->belongsTo(SchoolClass::class); + } - protected $table = 'tasks'; } diff --git a/app/Models/TaskFile.php b/app/Models/TaskFile.php new file mode 100644 index 0000000..32ba018 --- /dev/null +++ b/app/Models/TaskFile.php @@ -0,0 +1,13 @@ +hasMany(Timetable::class); } + public function tasks(){ + return $this->hasMany(Task::class); + } } diff --git a/composer.lock b/composer.lock index f88e116..ffa82a2 100644 --- a/composer.lock +++ b/composer.lock @@ -375,26 +375,29 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v3.0.2", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "48212cdc0a79051d50d7fc2f0645c5a321caf926" + "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/48212cdc0a79051d50d7fc2f0645c5a321caf926", - "reference": "48212cdc0a79051d50d7fc2f0645c5a321caf926", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c", + "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.2|^8.0", + "webmozart/assert": "^1.7.0" }, "replace": { "mtdowling/cron-expression": "^1.0" }, "require-dev": { - "phpstan/phpstan": "^0.11|^0.12", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-webmozart-assert": "^0.12.7", "phpunit/phpunit": "^7.0|^8.0|^9.0" }, "type": "library", @@ -425,7 +428,7 @@ "type": "github" } ], - "time": "2020-10-13T01:26:01+00:00" + "time": "2020-11-24T19:55:57+00:00" }, { "name": "egulias/email-validator", @@ -952,16 +955,16 @@ }, { "name": "laravel/framework", - "version": "v8.15.0", + "version": "v8.18.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "22e4182fa0885dea3772106c3b6df705b7c7363e" + "reference": "31747193c26ba0a9cb7929a912895d3cdefd10cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/22e4182fa0885dea3772106c3b6df705b7c7363e", - "reference": "22e4182fa0885dea3772106c3b6df705b7c7363e", + "url": "https://api.github.com/repos/laravel/framework/zipball/31747193c26ba0a9cb7929a912895d3cdefd10cf", + "reference": "31747193c26ba0a9cb7929a912895d3cdefd10cf", "shasum": "" }, "require": { @@ -981,15 +984,15 @@ "psr/simple-cache": "^1.0", "ramsey/uuid": "^4.0", "swiftmailer/swiftmailer": "^6.0", - "symfony/console": "^5.1", - "symfony/error-handler": "^5.1", - "symfony/finder": "^5.1", - "symfony/http-foundation": "^5.1", - "symfony/http-kernel": "^5.1", - "symfony/mime": "^5.1", - "symfony/process": "^5.1", - "symfony/routing": "^5.1", - "symfony/var-dumper": "^5.1", + "symfony/console": "^5.1.4", + "symfony/error-handler": "^5.1.4", + "symfony/finder": "^5.1.4", + "symfony/http-foundation": "^5.1.4", + "symfony/http-kernel": "^5.1.4", + "symfony/mime": "^5.1.4", + "symfony/process": "^5.1.4", + "symfony/routing": "^5.1.4", + "symfony/var-dumper": "^5.1.4", "tijsverkoyen/css-to-inline-styles": "^2.2.2", "vlucas/phpdotenv": "^5.2", "voku/portable-ascii": "^1.4.8" @@ -1034,20 +1037,20 @@ "illuminate/view": "self.version" }, "require-dev": { - "aws/aws-sdk-php": "^3.0", + "aws/aws-sdk-php": "^3.155", "doctrine/dbal": "^2.6|^3.0", "filp/whoops": "^2.8", "guzzlehttp/guzzle": "^6.5.5|^7.0.1", "league/flysystem-cached-adapter": "^1.0", "mockery/mockery": "^1.4.2", - "orchestra/testbench-core": "^6.5", + "orchestra/testbench-core": "^6.8", "pda/pheanstalk": "^4.0", "phpunit/phpunit": "^8.5.8|^9.3.3", "predis/predis": "^1.1.1", - "symfony/cache": "^5.1" + "symfony/cache": "^5.1.4" }, "suggest": { - "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.0).", + "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.155).", "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", "ext-ftp": "Required to use the Flysystem FTP driver.", "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", @@ -1069,8 +1072,8 @@ "predis/predis": "Required to use the predis connector (^1.1.2).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^5.1).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^5.1).", + "symfony/cache": "Required to PSR-6 cache bridge (^5.1.4).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^5.1.4).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).", "wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)." }, @@ -1111,20 +1114,20 @@ "framework", "laravel" ], - "time": "2020-11-17T14:53:20+00:00" + "time": "2020-12-08T22:05:12+00:00" }, { "name": "laravel/passport", - "version": "v10.0.1", + "version": "v10.1.0", "source": { "type": "git", "url": "https://github.com/laravel/passport.git", - "reference": "4e53f1b237a9e51ac10f0b30c6ebedd68f6848ab" + "reference": "c2b93a7d8d93cf303bb1eefbfa5610f084f9bdd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/passport/zipball/4e53f1b237a9e51ac10f0b30c6ebedd68f6848ab", - "reference": "4e53f1b237a9e51ac10f0b30c6ebedd68f6848ab", + "url": "https://api.github.com/repos/laravel/passport/zipball/c2b93a7d8d93cf303bb1eefbfa5610f084f9bdd4", + "reference": "c2b93a7d8d93cf303bb1eefbfa5610f084f9bdd4", "shasum": "" }, "require": { @@ -1139,9 +1142,10 @@ "illuminate/encryption": "^8.2", "illuminate/http": "^8.2", "illuminate/support": "^8.2", - "league/oauth2-server": "^8.1", + "lcobucci/jwt": "^3.4|^4.0", + "league/oauth2-server": "^8.2", "nyholm/psr7": "^1.3", - "php": "^7.3", + "php": "^7.3|^8.0", "phpseclib/phpseclib": "^2.0", "symfony/psr-http-message-bridge": "^2.0" }, @@ -1183,7 +1187,7 @@ "oauth", "passport" ], - "time": "2020-09-15T16:41:42+00:00" + "time": "2020-11-26T07:57:30+00:00" }, { "name": "laravel/tinker", @@ -1250,49 +1254,105 @@ "time": "2020-10-29T13:07:12+00:00" }, { - "name": "lcobucci/jwt", - "version": "3.4.0", + "name": "lcobucci/clock", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/lcobucci/jwt.git", - "reference": "320b9f05741b24acbbaf1106ed267ff3817fd74d" + "url": "https://github.com/lcobucci/clock.git", + "reference": "353d83fe2e6ae95745b16b3d911813df6a05bfb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/320b9f05741b24acbbaf1106ed267ff3817fd74d", - "reference": "320b9f05741b24acbbaf1106ed267ff3817fd74d", + "url": "https://api.github.com/repos/lcobucci/clock/zipball/353d83fe2e6ae95745b16b3d911813df6a05bfb3", + "reference": "353d83fe2e6ae95745b16b3d911813df6a05bfb3", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "infection/infection": "^0.17", + "lcobucci/coding-standard": "^6.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/php-code-coverage": "9.1.4", + "phpunit/phpunit": "9.3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Lcobucci\\Clock\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Luís Cobucci", + "email": "lcobucci@gmail.com" + } + ], + "description": "Yet another clock abstraction", + "funding": [ + { + "url": "https://github.com/lcobucci", + "type": "github" + }, + { + "url": "https://www.patreon.com/lcobucci", + "type": "patreon" + } + ], + "time": "2020-08-27T18:56:02+00:00" + }, + { + "name": "lcobucci/jwt", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/jwt.git", + "reference": "6d8665ccd924dc076a9b65d1ea8abe21d68f6958" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/6d8665ccd924dc076a9b65d1ea8abe21d68f6958", + "reference": "6d8665ccd924dc076a9b65d1ea8abe21d68f6958", "shasum": "" }, "require": { "ext-mbstring": "*", "ext-openssl": "*", - "php": "^5.6 || ^7.0" + "lcobucci/clock": "^2.0", + "php": "^7.4 || ^8.0" }, "require-dev": { - "mikey179/vfsstream": "~1.5", - "phpmd/phpmd": "~2.2", - "phpunit/php-invoker": "~1.1", - "phpunit/phpunit": "^5.7 || ^7.3", - "squizlabs/php_codesniffer": "~2.3" - }, - "suggest": { - "lcobucci/clock": "*" + "infection/infection": "^0.20", + "lcobucci/coding-standard": "^6.0", + "mikey179/vfsstream": "^1.6", + "phpbench/phpbench": "^0.17", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/php-invoker": "^3.1", + "phpunit/phpunit": "^9.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { "psr-4": { "Lcobucci\\JWT\\": "src" - }, - "files": [ - "compat/class-aliases.php", - "compat/json-exception-polyfill.php", - "compat/lcobucci-clock-polyfill.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1300,7 +1360,7 @@ ], "authors": [ { - "name": "Luís Otávio Cobucci Oblonczyk", + "name": "Luís Cobucci", "email": "lcobucci@gmail.com", "role": "Developer" } @@ -1320,7 +1380,7 @@ "type": "patreon" } ], - "time": "2020-11-25T01:46:26+00:00" + "time": "2020-11-25T02:06:12+00:00" }, { "name": "league/commonmark", @@ -1611,25 +1671,25 @@ }, { "name": "league/oauth2-server", - "version": "8.1.1", + "version": "8.2.3", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-server.git", - "reference": "09f22e8121fa1832962dba18213b80d4267ef8a3" + "reference": "70bb329bc79b7965a56f46e293da946c5a976ef1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/09f22e8121fa1832962dba18213b80d4267ef8a3", - "reference": "09f22e8121fa1832962dba18213b80d4267ef8a3", + "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/70bb329bc79b7965a56f46e293da946c5a976ef1", + "reference": "70bb329bc79b7965a56f46e293da946c5a976ef1", "shasum": "" }, "require": { "defuse/php-encryption": "^2.2.1", "ext-json": "*", "ext-openssl": "*", - "lcobucci/jwt": "^3.3.1", + "lcobucci/jwt": "^3.4 || ^4.0", "league/event": "^2.2", - "php": ">=7.2.0", + "php": "^7.2 || ^8.0", "psr/http-message": "^1.0.1" }, "replace": { @@ -1637,10 +1697,10 @@ "lncd/oauth2": "*" }, "require-dev": { - "laminas/laminas-diactoros": "^2.3.0", - "phpstan/phpstan": "^0.11.19", - "phpstan/phpstan-phpunit": "^0.11.2", - "phpunit/phpunit": "^8.5.4 || ^9.1.3", + "laminas/laminas-diactoros": "^2.4.1", + "phpstan/phpstan": "^0.12.57", + "phpstan/phpstan-phpunit": "^0.12.16", + "phpunit/phpunit": "^8.5.13", "roave/security-advisories": "dev-master" }, "type": "library", @@ -1690,7 +1750,7 @@ "type": "github" } ], - "time": "2020-07-01T11:33:50+00:00" + "time": "2020-12-03T21:32:29+00:00" }, { "name": "monolog/monolog", @@ -1785,16 +1845,16 @@ }, { "name": "nesbot/carbon", - "version": "2.41.5", + "version": "2.42.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "c4a9caf97cfc53adfc219043bcecf42bc663acee" + "reference": "d0463779663437392fe42ff339ebc0213bd55498" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/c4a9caf97cfc53adfc219043bcecf42bc663acee", - "reference": "c4a9caf97cfc53adfc219043bcecf42bc663acee", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d0463779663437392fe42ff339ebc0213bd55498", + "reference": "d0463779663437392fe42ff339ebc0213bd55498", "shasum": "" }, "require": { @@ -1809,7 +1869,7 @@ "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.35", + "phpstan/phpstan": "^0.12.54", "phpunit/phpunit": "^7.5 || ^8.0", "squizlabs/php_codesniffer": "^3.4" }, @@ -1870,20 +1930,20 @@ "type": "tidelift" } ], - "time": "2020-10-23T06:02:30+00:00" + "time": "2020-11-28T14:25:28+00:00" }, { "name": "nikic/php-parser", - "version": "v4.10.2", + "version": "v4.10.3", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "658f1be311a230e0907f5dfe0213742aff0596de" + "reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/658f1be311a230e0907f5dfe0213742aff0596de", - "reference": "658f1be311a230e0907f5dfe0213742aff0596de", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984", + "reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984", "shasum": "" }, "require": { @@ -1922,7 +1982,7 @@ "parser", "php" ], - "time": "2020-09-26T10:30:38+00:00" + "time": "2020-12-03T17:45:45+00:00" }, { "name": "nyholm/psr7", @@ -2666,16 +2726,16 @@ }, { "name": "psy/psysh", - "version": "v0.10.4", + "version": "v0.10.5", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "a8aec1b2981ab66882a01cce36a49b6317dc3560" + "reference": "7c710551d4a2653afa259c544508dc18a9098956" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/a8aec1b2981ab66882a01cce36a49b6317dc3560", - "reference": "a8aec1b2981ab66882a01cce36a49b6317dc3560", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/7c710551d4a2653afa259c544508dc18a9098956", + "reference": "7c710551d4a2653afa259c544508dc18a9098956", "shasum": "" }, "require": { @@ -2734,7 +2794,7 @@ "interactive", "shell" ], - "time": "2020-05-03T19:32:03+00:00" + "time": "2020-12-04T02:51:30+00:00" }, { "name": "ralouphie/getallheaders", @@ -2934,32 +2994,31 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v6.2.3", + "version": "v6.2.4", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "149cfdf118b169f7840bbe3ef0d4bc795d1780c9" + "reference": "56f0ab23f54c4ccbb0d5dcc67ff8552e0c98d59e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/149cfdf118b169f7840bbe3ef0d4bc795d1780c9", - "reference": "149cfdf118b169f7840bbe3ef0d4bc795d1780c9", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/56f0ab23f54c4ccbb0d5dcc67ff8552e0c98d59e", + "reference": "56f0ab23f54c4ccbb0d5dcc67ff8552e0c98d59e", "shasum": "" }, "require": { - "egulias/email-validator": "~2.0", + "egulias/email-validator": "^2.0", "php": ">=7.0.0", "symfony/polyfill-iconv": "^1.0", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, "require-dev": { - "mockery/mockery": "~0.9.1", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8" + "mockery/mockery": "^1.0", + "symfony/phpunit-bridge": "^4.4|^5.0" }, "suggest": { - "ext-intl": "Needed to support internationalized email addresses", - "true/punycode": "Needed to support internationalized email addresses, if ext-intl is not installed" + "ext-intl": "Needed to support internationalized email addresses" }, "type": "library", "extra": { @@ -2992,20 +3051,30 @@ "mail", "mailer" ], - "time": "2019-11-12T09:31:26+00:00" + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/swiftmailer/swiftmailer", + "type": "tidelift" + } + ], + "time": "2020-12-08T18:02:06+00:00" }, { "name": "symfony/console", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e" + "reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e", - "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e", + "url": "https://api.github.com/repos/symfony/console/zipball/3e0564fb08d44a98bd5f1960204c958e57bd586b", + "reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b", "shasum": "" }, "require": { @@ -3066,6 +3135,12 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -3080,20 +3155,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-28T11:24:18+00:00" }, { "name": "symfony/css-selector", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0" + "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", - "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", + "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", "shasum": "" }, "require": { @@ -3142,7 +3217,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-28T21:31:18+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3210,16 +3285,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "a154f2b12fd1ec708559ba73ed58bd1304e55718" + "reference": "289008c5be039e39908d33ae0a8ac99be1210bba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/a154f2b12fd1ec708559ba73ed58bd1304e55718", - "reference": "a154f2b12fd1ec708559ba73ed58bd1304e55718", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/289008c5be039e39908d33ae0a8ac99be1210bba", + "reference": "289008c5be039e39908d33ae0a8ac99be1210bba", "shasum": "" }, "require": { @@ -3272,20 +3347,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-28T21:46:03+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "26f4edae48c913fc183a3da0553fe63bdfbd361a" + "reference": "aa13a09811e6d2ad43f8fb336bebdb7691d85d3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/26f4edae48c913fc183a3da0553fe63bdfbd361a", - "reference": "26f4edae48c913fc183a3da0553fe63bdfbd361a", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/aa13a09811e6d2ad43f8fb336bebdb7691d85d3c", + "reference": "aa13a09811e6d2ad43f8fb336bebdb7691d85d3c", "shasum": "" }, "require": { @@ -3354,7 +3429,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-01T16:14:45+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -3434,16 +3509,16 @@ }, { "name": "symfony/finder", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0" + "reference": "fd8305521692f27eae3263895d1ef1571c71a78d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", + "url": "https://api.github.com/repos/symfony/finder/zipball/fd8305521692f27eae3263895d1ef1571c71a78d", + "reference": "fd8305521692f27eae3263895d1ef1571c71a78d", "shasum": "" }, "require": { @@ -3488,7 +3563,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-18T09:42:36+00:00" }, { "name": "symfony/http-client-contracts", @@ -3568,16 +3643,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f" + "reference": "e4576271ee99123aa59a40564c7b5405f0ebd1e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a2860ec970404b0233ab1e59e0568d3277d32b6f", - "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e4576271ee99123aa59a40564c7b5405f0ebd1e6", + "reference": "e4576271ee99123aa59a40564c7b5405f0ebd1e6", "shasum": "" }, "require": { @@ -3634,20 +3709,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-27T06:13:25+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "a13b3c4d994a4fd051f4c6800c5e33c9508091dd" + "reference": "38907e5ccb2d9d371191a946734afc83c7a03160" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/a13b3c4d994a4fd051f4c6800c5e33c9508091dd", - "reference": "a13b3c4d994a4fd051f4c6800c5e33c9508091dd", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/38907e5ccb2d9d371191a946734afc83c7a03160", + "reference": "38907e5ccb2d9d371191a946734afc83c7a03160", "shasum": "" }, "require": { @@ -3667,7 +3742,7 @@ "symfony/cache": "<5.0", "symfony/config": "<5.0", "symfony/console": "<4.4", - "symfony/dependency-injection": "<4.4", + "symfony/dependency-injection": "<5.1.8", "symfony/doctrine-bridge": "<5.0", "symfony/form": "<5.0", "symfony/http-client": "<5.0", @@ -3687,7 +3762,7 @@ "symfony/config": "^5.0", "symfony/console": "^4.4|^5.0", "symfony/css-selector": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", + "symfony/dependency-injection": "^5.1.8", "symfony/dom-crawler": "^4.4|^5.0", "symfony/expression-language": "^4.4|^5.0", "symfony/finder": "^4.4|^5.0", @@ -3743,24 +3818,25 @@ "type": "tidelift" } ], - "time": "2020-10-28T05:55:23+00:00" + "time": "2020-11-30T05:54:18+00:00" }, { "name": "symfony/mime", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b" + "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/f5485a92c24d4bcfc2f3fc648744fb398482ff1b", - "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b", + "url": "https://api.github.com/repos/symfony/mime/zipball/05f667e8fa029568964fd3bec6bc17765b853cc5", + "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.15" @@ -3770,7 +3846,11 @@ }, "require-dev": { "egulias/email-validator": "^2.1.10", - "symfony/dependency-injection": "^4.4|^5.0" + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/property-access": "^4.4|^5.1", + "symfony/property-info": "^4.4|^5.1", + "symfony/serializer": "^5.2" }, "type": "library", "autoload": { @@ -3815,7 +3895,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-30T14:55:39+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4521,16 +4601,16 @@ }, { "name": "symfony/process", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "f00872c3f6804150d6a0f73b4151daab96248101" + "reference": "240e74140d4d956265048f3025c0aecbbc302d54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f00872c3f6804150d6a0f73b4151daab96248101", - "reference": "f00872c3f6804150d6a0f73b4151daab96248101", + "url": "https://api.github.com/repos/symfony/process/zipball/240e74140d4d956265048f3025c0aecbbc302d54", + "reference": "240e74140d4d956265048f3025c0aecbbc302d54", "shasum": "" }, "require": { @@ -4576,7 +4656,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-02T15:47:15+00:00" }, { "name": "symfony/psr-http-message-bridge", @@ -4658,16 +4738,16 @@ }, { "name": "symfony/routing", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "d6ceee2a37b61b41079005207bf37746d1bfe71f" + "reference": "130ac5175ad2fd417978baebd8062e2e6b2bc28b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/d6ceee2a37b61b41079005207bf37746d1bfe71f", - "reference": "d6ceee2a37b61b41079005207bf37746d1bfe71f", + "url": "https://api.github.com/repos/symfony/routing/zipball/130ac5175ad2fd417978baebd8062e2e6b2bc28b", + "reference": "130ac5175ad2fd417978baebd8062e2e6b2bc28b", "shasum": "" }, "require": { @@ -4681,7 +4761,7 @@ "symfony/yaml": "<4.4" }, "require-dev": { - "doctrine/annotations": "~1.2", + "doctrine/annotations": "^1.7", "psr/log": "~1.0", "symfony/config": "^5.0", "symfony/dependency-injection": "^4.4|^5.0", @@ -4741,7 +4821,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-27T00:39:34+00:00" }, { "name": "symfony/service-contracts", @@ -4821,16 +4901,16 @@ }, { "name": "symfony/string", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea" + "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a97573e960303db71be0dd8fda9be3bca5e0feea", - "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea", + "url": "https://api.github.com/repos/symfony/string/zipball/40e975edadd4e32cd16f3753b3bad65d9ac48242", + "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242", "shasum": "" }, "require": { @@ -4897,27 +4977,27 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-24T12:08:07+00:00" }, { "name": "symfony/translation", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "27980838fd261e04379fa91e94e81e662fe5a1b6" + "reference": "52f486a707510884450df461b5a6429dd7a67379" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/27980838fd261e04379fa91e94e81e662fe5a1b6", - "reference": "27980838fd261e04379fa91e94e81e662fe5a1b6", + "url": "https://api.github.com/repos/symfony/translation/zipball/52f486a707510884450df461b5a6429dd7a67379", + "reference": "52f486a707510884450df461b5a6429dd7a67379", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php80": "^1.15", - "symfony/translation-contracts": "^2" + "symfony/translation-contracts": "^2.3" }, "conflict": { "symfony/config": "<4.4", @@ -4947,6 +5027,9 @@ }, "type": "library", "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { "Symfony\\Component\\Translation\\": "" }, @@ -4984,7 +5067,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-28T11:24:18+00:00" }, { "name": "symfony/translation-contracts", @@ -5063,16 +5146,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "4e13f3fcefb1fcaaa5efb5403581406f4e840b9a" + "reference": "173a79c462b1c81e1fa26129f71e41333d846b26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/4e13f3fcefb1fcaaa5efb5403581406f4e840b9a", - "reference": "4e13f3fcefb1fcaaa5efb5403581406f4e840b9a", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/173a79c462b1c81e1fa26129f71e41333d846b26", + "reference": "173a79c462b1c81e1fa26129f71e41333d846b26", "shasum": "" }, "require": { @@ -5144,7 +5227,7 @@ "type": "tidelift" } ], - "time": "2020-10-27T10:11:13+00:00" + "time": "2020-11-27T00:39:34+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -5340,6 +5423,55 @@ } ], "time": "2020-11-12T00:07:28+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<3.9.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2020-07-08T17:02:28+00:00" } ], "packages-dev": [ @@ -5591,16 +5723,16 @@ }, { "name": "fakerphp/faker", - "version": "v1.11.0", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "f228dc5112bafc14c77d40a2acc0c48058e184b0" + "reference": "9aa6c9e289860951e6b4d010c7a841802d015cd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/f228dc5112bafc14c77d40a2acc0c48058e184b0", - "reference": "f228dc5112bafc14c77d40a2acc0c48058e184b0", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/9aa6c9e289860951e6b4d010c7a841802d015cd8", + "reference": "9aa6c9e289860951e6b4d010c7a841802d015cd8", "shasum": "" }, "require": { @@ -5635,7 +5767,7 @@ "faker", "fixtures" ], - "time": "2020-11-15T20:27:00+00:00" + "time": "2020-11-23T09:33:08+00:00" }, { "name": "filp/whoops", @@ -6009,16 +6141,16 @@ }, { "name": "phar-io/version", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0" + "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/c6bb6825def89e0a32220f88337f8ceaf1975fa0", - "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0", + "url": "https://api.github.com/repos/phar-io/version/zipball/726c026815142e4f8677b7cb7f2249c9ffb7ecae", + "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae", "shasum": "" }, "require": { @@ -6052,7 +6184,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2020-06-27T14:39:04+00:00" + "time": "2020-11-30T09:21:21+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -6265,16 +6397,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.3", + "version": "9.2.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6b20e2055f7c29b56cb3870b3de7cc463d7add41" + "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6b20e2055f7c29b56cb3870b3de7cc463d7add41", - "reference": "6b20e2055f7c29b56cb3870b3de7cc463d7add41", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1", + "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1", "shasum": "" }, "require": { @@ -6288,7 +6420,7 @@ "sebastian/code-unit-reverse-lookup": "^2.0.2", "sebastian/complexity": "^2.0", "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0", + "sebastian/lines-of-code": "^1.0.3", "sebastian/version": "^3.0.1", "theseer/tokenizer": "^1.2.0" }, @@ -6334,7 +6466,7 @@ "type": "github" } ], - "time": "2020-10-30T10:46:41+00:00" + "time": "2020-11-28T06:44:49+00:00" }, { "name": "phpunit/php-file-iterator", @@ -6563,16 +6695,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.4.3", + "version": "9.5.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab" + "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab", - "reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", + "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", "shasum": "" }, "require": { @@ -6588,7 +6720,7 @@ "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2", + "phpunit/php-code-coverage": "^9.2.3", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -6619,7 +6751,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.4-dev" + "dev-master": "9.5-dev" } }, "autoload": { @@ -6658,7 +6790,7 @@ "type": "github" } ], - "time": "2020-11-10T12:53:30+00:00" + "time": "2020-12-04T05:05:53+00:00" }, { "name": "sebastian/cli-parser", @@ -7194,16 +7326,16 @@ }, { "name": "sebastian/lines-of-code", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "acf76492a65401babcf5283296fa510782783a7a" + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/acf76492a65401babcf5283296fa510782783a7a", - "reference": "acf76492a65401babcf5283296fa510782783a7a", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", "shasum": "" }, "require": { @@ -7243,7 +7375,7 @@ "type": "github" } ], - "time": "2020-10-26T17:03:56+00:00" + "time": "2020-11-28T06:42:11+00:00" }, { "name": "sebastian/object-enumerator", @@ -7605,55 +7737,6 @@ } ], "time": "2020-07-12T23:59:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2020-07-08T17:02:28+00:00" } ], "aliases": [], diff --git a/database/migrations/2020_12_03_172010_create_tasks_table.php b/database/migrations/2020_12_03_172010_create_tasks_table.php new file mode 100644 index 0000000..f797b99 --- /dev/null +++ b/database/migrations/2020_12_03_172010_create_tasks_table.php @@ -0,0 +1,45 @@ +id(); + $table->string('name',255); + $table->text('description')->nullable(); + $table->dateTime('deadline')->nullable(); + $table->unsignedInteger('teacher_id')->nullable(); + $table->unsignedInteger('class_id')->nullable(); + $table->timestamps(); + $table->integer('subject_id'); + + $table->foreign('subject_id')->references('id')->on('subjects') + ->onDelete('set null'); + +// $table->foreign('class_id')->references('id')->on('school_classes') +// ->onDelete('cascade'); +// $table->foreign('teacher_id')->references('id')->on('teachers') +// ->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('tasks'); + } +} diff --git a/database/migrations/2020_12_07_120455_create_answers_to_task_table.php b/database/migrations/2020_12_07_120455_create_answers_to_task_table.php new file mode 100644 index 0000000..58c9f49 --- /dev/null +++ b/database/migrations/2020_12_07_120455_create_answers_to_task_table.php @@ -0,0 +1,41 @@ +id(); + $table->text('description')->nullable(); + $table->smallInteger('mark')->nullable(); + $table->text('comment_by_teacher')->nullable(); + $table->boolean('checked')->default('false'); + $table->unsignedInteger('task_id'); + $table->unsignedInteger('student_id'); + $table->timestamps(); + + $table->foreign('task_id')->references('id')->on('tasks') + ->onDelete('set null'); + $table->foreign('student_id')->references('id')->on('students'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('answers_to_task'); + } +} diff --git a/database/migrations/2020_12_08_122859_create_task_files_table.php b/database/migrations/2020_12_08_122859_create_task_files_table.php new file mode 100644 index 0000000..1ecf902 --- /dev/null +++ b/database/migrations/2020_12_08_122859_create_task_files_table.php @@ -0,0 +1,43 @@ +bigIncrements('id'); + $table->string('name'); + $table->string('type'); + $table->string('extension'); + $table->boolean('add_by_teacher')->default('0'); + $table->string('url', 400); + $table->timestamps(); + $table->unsignedInteger('task_id'); + $table->unsignedInteger('user_id'); + + $table->foreign('task_id')->references('id')->on('tasks') + ->onDelete('cascade'); + $table->foreign('user_id')->references('id')->on('tasks') + ->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('task_files'); + } +} diff --git a/routes/api.php b/routes/api.php index fd9aab8..ae69746 100644 --- a/routes/api.php +++ b/routes/api.php @@ -18,27 +18,47 @@ Route::apiResource('students', 'Users\StudentController'); Route::apiResource('parents', 'Users\ParenttController'); -Route::apiResource('subjects', 'SubjectController'); +Route::apiResource('subjects', 'BankTask\SubjectController'); Route::apiResource('classes', 'SchoolClassController'); Route::post('classes/{class}/teacher', 'SchoolClassController@addTeacher'); Route::get('classes/{class}/students', 'SchoolClassController@getStudents'); Route::get('classes/{class}/subjects', 'SchoolClassController@getSubjects'); -Route::apiResource('themes', 'ThemeController'); +Route::apiResource('themes', 'BankTask\ThemeController'); Route::apiResource('timetables', 'TimetableController'); -Route::get('banktasks', 'BankTaskController@index'); //получение списка всех заданий +Route::get('banktasks', 'BankTask\BankTaskController@index'); //получение списка всех заданий Route::group(['prefix' => 'banktask'], function () { - Route::post('', 'BankTaskController@store'); //создание задания - Route::get('{banktask}', 'BankTaskController@show'); //получение задания - Route::put('{banktask}', 'BankTaskController@update'); //обновление задания - Route::delete('{banktask}', 'BankTaskController@delete'); //удаление задания - Route::post('{banktask}/addfile', 'BankTaskFileController@store'); - Route::get('{banktask}/files', 'BankTaskFileController@showFiles'); + Route::post('', 'BankTask\BankTaskController@store'); //создание задания + Route::get('{banktask}', 'BankTask\BankTaskController@show'); //получение задания + Route::put('{banktask}', 'BankTask\BankTaskController@update'); //обновление задания + Route::delete('{banktask}', 'BankTask\BankTaskController@delete'); //удаление задания + Route::post('{banktask}/addfile', 'BankTask\BankTaskFileController@store'); + Route::get('{banktask}/files', 'BankTask\BankTaskFileController@showFiles'); + Route::get('/file/{file}', 'BankTask\BankTaskFileController@download'); + Route::delete('/file/{file}', 'BankTask\BankTaskFileController@delete'); + Route::put('/file/{file}', 'BankTask\BankTaskFileController@update'); }); -Route::get('/file/{file}/download', 'BankTaskFileController@download'); -Route::delete('/file/{file}/delete', 'BankTaskFileController@delete'); -Route::put('/file/{file}/update', 'BankTaskFileController@update'); + + +Route::group(['prefix' => 'task'], function () { + Route::post('', 'TaskController@store'); // Добавить таск + Route::get('', 'TaskController@index'); // Показать задания для класса (в запросе нужно указывать Id класса) + Route::get('/{task}', 'TaskController@show'); //Показать задание + Route::put('/{task}', 'TaskController@update'); // Обновить задание + Route::delete('/{task}', 'TaskController@delete'); // Удалить задание + Route::post('/{task}/addbanktask', 'TaskController@addbanktask'); // Добавить к заданию задачи из банка + Route::put('/answer/check/{answer}', 'TaskController@checkAnswer'); // Проверить ответ ученика + Route::post('/{task}/addanswer', 'AnswerToTaskController@store'); // Добавить ответ(для ученика) + Route::get('/{task}/student/{student}', 'AnswerToTaskController@show'); // Показать ответ ученика + Route::delete('/answer/{answer}', 'AnswerToTask@delete'); // Удалить ответ + Route::put('/answer/{answer}', 'AnswerToTask@update'); // Изменить ответ + Route::post('/{task}/addfile', 'TaskFileController@store'); // Добавить файл + Route::get('/{task}/files', 'TaskFileController@showFiles'); // Посмотреть файлы у таска(только файлы + // которые добавил учитель). + Route::get('/{task}/file/{file}', 'TaskFileController@download'); // Скачать файл + Route::delete('/file/{file}', 'TaskFileController@delete'); // Удалить файл +}); \ No newline at end of file