mirror of
https://github.com/robonen/education-project.git
synced 2026-03-20 10:54:31 +00:00
исправил конфликты после обновления ветки
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Exceptions;
|
namespace App\Exceptions;
|
||||||
|
|
||||||
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
||||||
@@ -23,6 +24,11 @@ class Handler extends ExceptionHandler
|
|||||||
return parent::render($request, $exception);
|
return parent::render($request, $exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function unauthenticated($request, AuthenticationException $exception)
|
||||||
|
{
|
||||||
|
return response()->json(['message' => 'Unauthenticated'], 401);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of the exception types that are not reported.
|
* A list of the exception types that are not reported.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Auth;
|
|||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Requests\Auth\LoginRequest;
|
use App\Http\Requests\Auth\LoginRequest;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class LoginController extends Controller
|
class LoginController extends Controller
|
||||||
{
|
{
|
||||||
@@ -11,14 +12,13 @@ class LoginController extends Controller
|
|||||||
{
|
{
|
||||||
$credentials = $request->only('login', 'password');
|
$credentials = $request->only('login', 'password');
|
||||||
|
|
||||||
if (auth()->attempt($credentials))
|
if (!auth()->attempt($credentials))
|
||||||
return response()->json('You cannot sign with those credentials!', 401);
|
return response()->json('You cannot sign with those credentials!', 401);
|
||||||
|
|
||||||
$token = auth()->user()->makeToken($request->get('remember_me'));
|
$token = auth()->user()->createToken(config('app.name'));
|
||||||
|
$token->token->expires_at = (bool)$request->get('remember_me') ? Carbon::now()->addMonth() : Carbon::now()->addDay();
|
||||||
|
$token->token->save();
|
||||||
|
|
||||||
return response()->json([
|
return response()->json(['access_token' => $token->accessToken], 200);
|
||||||
'token_type' => 'Bearer',
|
|
||||||
'token' => $token->accessToken,
|
|
||||||
], 200);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ class LogoutController extends Controller
|
|||||||
{
|
{
|
||||||
public function __invoke(Request $request)
|
public function __invoke(Request $request)
|
||||||
{
|
{
|
||||||
$request->user()->token()->revoke();
|
auth()->user()->token()->revoke();
|
||||||
|
|
||||||
return response()->json('ok', 200);
|
return response()->json(['message' => 'You are logged out'], 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,21 +5,19 @@ namespace App\Http\Controllers\Auth;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Requests\Auth\RegisterRequest;
|
use App\Http\Requests\Auth\RegisterRequest;
|
||||||
|
|
||||||
use App\Models\HeadTeacher;
|
|
||||||
use App\Models\Parentt;
|
|
||||||
use App\Models\Role;
|
use App\Models\Role;
|
||||||
use App\Models\Student;
|
use App\Models\SchoolClass;
|
||||||
use App\Models\Teacher;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\QueryException;
|
||||||
|
|
||||||
class RegisterController extends Controller
|
class RegisterController extends Controller
|
||||||
{
|
{
|
||||||
public function __invoke(RegisterRequest $request)
|
public function __invoke(RegisterRequest $request)
|
||||||
{
|
{
|
||||||
$role = Role::where('name', $request->get('role'));
|
$role = Role::where('name', $request->get('role'))->get();
|
||||||
|
|
||||||
if ($role->isEmpty())
|
if ($role->isEmpty())
|
||||||
return response()->json('Role not found', 404);
|
return response()->json(['message'=>'Role not found'], 404);
|
||||||
|
|
||||||
$user = User::create(array_merge(
|
$user = User::create(array_merge(
|
||||||
$request->only('login', 'class_id'),
|
$request->only('login', 'class_id'),
|
||||||
@@ -29,29 +27,35 @@ class RegisterController extends Controller
|
|||||||
]
|
]
|
||||||
));
|
));
|
||||||
|
|
||||||
$user_id = [
|
|
||||||
'user_id' => $user->id,
|
|
||||||
];
|
|
||||||
|
|
||||||
switch($request->get('role'))
|
switch($request->get('role'))
|
||||||
{
|
{
|
||||||
case 'headteacher':
|
case 'headteacher':
|
||||||
HeadTeacher::create($user_id);
|
$user->headteacher()->create();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'teacher':
|
case 'teacher':
|
||||||
Teacher::create($user_id);
|
$user->teacher()->create();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'student':
|
case 'student':
|
||||||
Student::create($user_id);
|
try {
|
||||||
|
$user->student()->create(['class_id'=>$request->input('class_id')]);
|
||||||
|
$class = SchoolClass::find($request->input('class_id'));
|
||||||
|
if ($class) {
|
||||||
|
$class->count_students++;;
|
||||||
|
$class->save();
|
||||||
|
}
|
||||||
|
} catch (QueryException $e) {
|
||||||
|
$user->delete();
|
||||||
|
return response()->json(['message'=>'Class not found'],404);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'parent':
|
case 'parent':
|
||||||
Parentt::create($user_id);
|
$user->parent()->create();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json('ok', 200);
|
return response()->json(null, 201);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
65
app/Http/Controllers/ChatLinkController.php
Normal file
65
app/Http/Controllers/ChatLinkController.php
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Requests\ChatLinkRequest;
|
||||||
|
use App\Models\ChatLink;
|
||||||
|
use Illuminate\Database\QueryException;
|
||||||
|
|
||||||
|
class ChatLinkController extends Controller
|
||||||
|
{
|
||||||
|
//Получение ссылок для класса или для их создателя
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
switch(auth()->user()->role->name)
|
||||||
|
{
|
||||||
|
case 'student':
|
||||||
|
$links = ChatLink::all()->where('class_id', auth()->user()->class_id);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'teacher':
|
||||||
|
case 'headteacher':
|
||||||
|
$links = auth()->user()->chatLinks;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'parent':
|
||||||
|
$links = [];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json($links, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Создание ссылки
|
||||||
|
public function store(ChatLinkRequest $request)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$link = auth()->user()->create($request->all());
|
||||||
|
} catch (QueryException $e) {
|
||||||
|
return response()->json(['message'=>'Class not found'], 404);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json($link, 201);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Обновление ссылки
|
||||||
|
public function update(ChatLink $link, ChatLinkRequest $request)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$link->update($request->all());
|
||||||
|
} catch (QueryException $e) {
|
||||||
|
return response()->json(['message'=>'Class not found'], 404);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json($link, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Удаление ссылки
|
||||||
|
public function destroy(ChatLink $link)
|
||||||
|
{
|
||||||
|
$link->delete();
|
||||||
|
return response()->json(null, 204);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -45,9 +45,8 @@ class TimetableController extends Controller
|
|||||||
'class' => $class,
|
'class' => $class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$dateTimetables = [];
|
$dateTimetables = [];
|
||||||
// if (!$filterTimetables->isEmpty()) {
|
//if (!$filterTimetables->isEmpty()) {
|
||||||
for ($i = 0; $i < 6; $i++) {
|
for ($i = 0; $i < 6; $i++) {
|
||||||
$date = Carbon::parse($request->input('date'))
|
$date = Carbon::parse($request->input('date'))
|
||||||
->startOfWeek()
|
->startOfWeek()
|
||||||
@@ -55,7 +54,8 @@ class TimetableController extends Controller
|
|||||||
->format('Y-m-d');
|
->format('Y-m-d');
|
||||||
array_push($dateTimetables, [$date => $filterTimetables->where('date', $date)->values()]);
|
array_push($dateTimetables, [$date => $filterTimetables->where('date', $date)->values()]);
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
|
//}
|
||||||
return response()->json($dateTimetables, 200);
|
return response()->json($dateTimetables, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
35
app/Http/Controllers/Users/UserController.php
Normal file
35
app/Http/Controllers/Users/UserController.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Users;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
|
||||||
|
class UserController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
public function getUser()
|
||||||
|
{
|
||||||
|
switch(auth()->user()->role->name)
|
||||||
|
{
|
||||||
|
case 'student':
|
||||||
|
$user = auth()->user()->student;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'teacher':
|
||||||
|
$user = auth()->user()->teacher;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'headteacher':
|
||||||
|
$user = auth()->user()->headteacher;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'parent':
|
||||||
|
$user = auth()->user()->parent;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return response()->json($user);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,8 +14,8 @@ class Authenticate extends Middleware
|
|||||||
*/
|
*/
|
||||||
protected function redirectTo($request)
|
protected function redirectTo($request)
|
||||||
{
|
{
|
||||||
if (! $request->expectsJson()) {
|
//if (! $request->expectsJson()) {
|
||||||
return route('login');
|
// return route('login');
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Role
|
|||||||
$roles = explode($this->delimetr, $roles);
|
$roles = explode($this->delimetr, $roles);
|
||||||
|
|
||||||
if (!auth()->user()->hasRole($roles)) {
|
if (!auth()->user()->hasRole($roles)) {
|
||||||
return response()->json('',404);
|
return response()->json(null,404);
|
||||||
}
|
}
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ class RegisterRequest extends UserRequest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'role' => 'required|string',
|
'role' => 'required|string',
|
||||||
'class_id' => 'required|integer|gt:0',
|
'class_id' => 'integer|gt:0',
|
||||||
|
'login' => 'required|unique:users'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ abstract class UserRequest extends ApiFormRequest
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return array_merge([
|
return array_merge([
|
||||||
'login' => 'required|string',
|
|
||||||
'password' => 'required|string|min:6',
|
'password' => 'required|string|min:6',
|
||||||
], $this->specific());
|
], $this->specific());
|
||||||
}
|
}
|
||||||
|
|||||||
22
app/Http/Requests/ChatLinkRequest.php
Normal file
22
app/Http/Requests/ChatLinkRequest.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class ChatLinkRequest extends ApiFormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => 'required',
|
||||||
|
'link' => 'required',
|
||||||
|
'class_id' => 'required|integer|gt:0',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
29
app/Models/ChatLink.php
Normal file
29
app/Models/ChatLink.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ChatLink extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'link',
|
||||||
|
'class_id',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function schoolClass()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(SchoolClass::class, 'class_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function creator()
|
||||||
|
{
|
||||||
|
return $this->hasMany(User::class, 'creator');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -11,6 +11,11 @@ class HeadTeacher extends Model
|
|||||||
|
|
||||||
protected $guarded = [
|
protected $guarded = [
|
||||||
'user_id',
|
'user_id',
|
||||||
|
'updated_at',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $hidden = [
|
||||||
|
'user_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function user()
|
public function user()
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ class Parentt extends Model
|
|||||||
|
|
||||||
protected $guarded = [
|
protected $guarded = [
|
||||||
'user_id',
|
'user_id',
|
||||||
|
'updated_at',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $hidden = [
|
||||||
|
'user_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function user()
|
public function user()
|
||||||
|
|||||||
@@ -26,8 +26,17 @@ class SchoolClass extends Model
|
|||||||
->withPivot('hours_per_week', 'hours_per_year');
|
->withPivot('hours_per_week', 'hours_per_year');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function tasks() {
|
public function tasks() {
|
||||||
return $this->hasMany(Task::class, 'class_id');
|
return $this->hasMany(Task::class, 'class_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function chatLinks()
|
||||||
|
{
|
||||||
|
return $this->hasMany(ChatLink::class, 'class_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ class Student extends Model
|
|||||||
'updated_at',
|
'updated_at',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
protected $hidden = [
|
||||||
|
'user_id',
|
||||||
|
];
|
||||||
|
|
||||||
public function schoolClass()
|
public function schoolClass()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(SchoolClass::class, 'class_id');
|
return $this->belongsTo(SchoolClass::class, 'class_id');
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ class Teacher extends Model
|
|||||||
|
|
||||||
protected $guarded = [
|
protected $guarded = [
|
||||||
'user_id',
|
'user_id',
|
||||||
|
'updated_at',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $hidden = [
|
||||||
|
'user_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function schoolClass()
|
public function schoolClass()
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Laravel\Passport\HasApiTokens;
|
||||||
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
use HasFactory, Notifiable;
|
use HasFactory, Notifiable, HasApiTokens;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
@@ -41,7 +42,7 @@ class User extends Authenticatable
|
|||||||
{
|
{
|
||||||
foreach ($roles as $role)
|
foreach ($roles as $role)
|
||||||
{
|
{
|
||||||
if ($this->role->contains('name', $role))
|
if ($this->role->name == $role)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,11 +59,24 @@ class User extends Authenticatable
|
|||||||
return $this->hasOne(HeadTeacher::class);
|
return $this->hasOne(HeadTeacher::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function makeToken(bool $remember)
|
public function teacher()
|
||||||
{
|
{
|
||||||
$token = $this->createToken(config('app.name'));
|
return $this->hasOne(Teacher::class);
|
||||||
$token->token->expires_at = $remember ? Carbon::now()->addMonth() : Carbon::now()->addDay();
|
|
||||||
$token->token->save();
|
|
||||||
return $token;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function student()
|
||||||
|
{
|
||||||
|
return $this->hasOne(Student::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function parent()
|
||||||
|
{
|
||||||
|
return $this->hasOne(Parentt::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function chatLinks()
|
||||||
|
{
|
||||||
|
return $this->hasMany(ChatLink::class, 'creator');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class AuthServiceProvider extends ServiceProvider
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $policies = [
|
protected $policies = [
|
||||||
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
|
'App\Models\Model' => 'App\Policies\ModelPolicy',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,7 +15,8 @@
|
|||||||
"guzzlehttp/guzzle": "^7.0.1",
|
"guzzlehttp/guzzle": "^7.0.1",
|
||||||
"laravel/framework": "^8.12",
|
"laravel/framework": "^8.12",
|
||||||
"laravel/passport": "^10.0",
|
"laravel/passport": "^10.0",
|
||||||
"laravel/tinker": "^2.5"
|
"laravel/tinker": "^2.5",
|
||||||
|
"lcobucci/jwt": "3.3.3"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"facade/ignition": "^2.5",
|
"facade/ignition": "^2.5",
|
||||||
|
|||||||
245
composer.lock
generated
245
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "d29a824fe1ba5e1a371425931ce19f0b",
|
"content-hash": "94e022aa2f8a4e9c7f1f2b9740b6dbd5",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "asm89/stack-cors",
|
"name": "asm89/stack-cors",
|
||||||
@@ -58,6 +58,79 @@
|
|||||||
],
|
],
|
||||||
"time": "2020-10-29T16:03:21+00:00"
|
"time": "2020-10-29T16:03:21+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "barryvdh/laravel-cors",
|
||||||
|
"version": "v2.0.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/fruitcake/laravel-cors.git",
|
||||||
|
"reference": "01de0fe5f71c70d1930ee9a80385f9cc28e0f63a"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/01de0fe5f71c70d1930ee9a80385f9cc28e0f63a",
|
||||||
|
"reference": "01de0fe5f71c70d1930ee9a80385f9cc28e0f63a",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"asm89/stack-cors": "^2.0.1",
|
||||||
|
"illuminate/contracts": "^6|^7|^8|^9",
|
||||||
|
"illuminate/support": "^6|^7|^8|^9",
|
||||||
|
"php": ">=7.2",
|
||||||
|
"symfony/http-foundation": "^4|^5",
|
||||||
|
"symfony/http-kernel": "^4.3.4|^5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"laravel/framework": "^6|^7|^8",
|
||||||
|
"orchestra/testbench-dusk": "^4|^5|^6",
|
||||||
|
"phpunit/phpunit": "^6|^7|^8",
|
||||||
|
"squizlabs/php_codesniffer": "^3.5"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.0-dev"
|
||||||
|
},
|
||||||
|
"laravel": {
|
||||||
|
"providers": [
|
||||||
|
"Fruitcake\\Cors\\CorsServiceProvider"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Fruitcake\\Cors\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fruitcake",
|
||||||
|
"homepage": "https://fruitcake.nl"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Barry vd. Heuvel",
|
||||||
|
"email": "barryvdh@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application",
|
||||||
|
"keywords": [
|
||||||
|
"api",
|
||||||
|
"cors",
|
||||||
|
"crossdomain",
|
||||||
|
"laravel"
|
||||||
|
],
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/barryvdh",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2020-10-22T13:57:20+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "brick/math",
|
"name": "brick/math",
|
||||||
"version": "0.9.1",
|
"version": "0.9.1",
|
||||||
@@ -955,16 +1028,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/framework",
|
"name": "laravel/framework",
|
||||||
"version": "v8.18.1",
|
"version": "v8.19.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/framework.git",
|
"url": "https://github.com/laravel/framework.git",
|
||||||
"reference": "31747193c26ba0a9cb7929a912895d3cdefd10cf"
|
"reference": "f5f331cee60f1bbe672503b7eb9ba5b22b2ceacb"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/framework/zipball/31747193c26ba0a9cb7929a912895d3cdefd10cf",
|
"url": "https://api.github.com/repos/laravel/framework/zipball/f5f331cee60f1bbe672503b7eb9ba5b22b2ceacb",
|
||||||
"reference": "31747193c26ba0a9cb7929a912895d3cdefd10cf",
|
"reference": "f5f331cee60f1bbe672503b7eb9ba5b22b2ceacb",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1114,20 +1187,20 @@
|
|||||||
"framework",
|
"framework",
|
||||||
"laravel"
|
"laravel"
|
||||||
],
|
],
|
||||||
"time": "2020-12-08T22:05:12+00:00"
|
"time": "2020-12-15T16:16:31+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/passport",
|
"name": "laravel/passport",
|
||||||
"version": "v10.1.0",
|
"version": "v10.0.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/passport.git",
|
"url": "https://github.com/laravel/passport.git",
|
||||||
"reference": "c2b93a7d8d93cf303bb1eefbfa5610f084f9bdd4"
|
"reference": "4e53f1b237a9e51ac10f0b30c6ebedd68f6848ab"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/passport/zipball/c2b93a7d8d93cf303bb1eefbfa5610f084f9bdd4",
|
"url": "https://api.github.com/repos/laravel/passport/zipball/4e53f1b237a9e51ac10f0b30c6ebedd68f6848ab",
|
||||||
"reference": "c2b93a7d8d93cf303bb1eefbfa5610f084f9bdd4",
|
"reference": "4e53f1b237a9e51ac10f0b30c6ebedd68f6848ab",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1142,10 +1215,9 @@
|
|||||||
"illuminate/encryption": "^8.2",
|
"illuminate/encryption": "^8.2",
|
||||||
"illuminate/http": "^8.2",
|
"illuminate/http": "^8.2",
|
||||||
"illuminate/support": "^8.2",
|
"illuminate/support": "^8.2",
|
||||||
"lcobucci/jwt": "^3.4|^4.0",
|
"league/oauth2-server": "^8.1",
|
||||||
"league/oauth2-server": "^8.2",
|
|
||||||
"nyholm/psr7": "^1.3",
|
"nyholm/psr7": "^1.3",
|
||||||
"php": "^7.3|^8.0",
|
"php": "^7.3",
|
||||||
"phpseclib/phpseclib": "^2.0",
|
"phpseclib/phpseclib": "^2.0",
|
||||||
"symfony/psr-http-message-bridge": "^2.0"
|
"symfony/psr-http-message-bridge": "^2.0"
|
||||||
},
|
},
|
||||||
@@ -1187,7 +1259,7 @@
|
|||||||
"oauth",
|
"oauth",
|
||||||
"passport"
|
"passport"
|
||||||
],
|
],
|
||||||
"time": "2020-11-26T07:57:30+00:00"
|
"time": "2020-09-15T16:41:42+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/tinker",
|
"name": "laravel/tinker",
|
||||||
@@ -1253,100 +1325,36 @@
|
|||||||
],
|
],
|
||||||
"time": "2020-10-29T13:07:12+00:00"
|
"time": "2020-10-29T13:07:12+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "lcobucci/clock",
|
|
||||||
"version": "2.0.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/lcobucci/clock.git",
|
|
||||||
"reference": "353d83fe2e6ae95745b16b3d911813df6a05bfb3"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"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",
|
"name": "lcobucci/jwt",
|
||||||
"version": "4.0.0",
|
"version": "3.3.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/lcobucci/jwt.git",
|
"url": "https://github.com/lcobucci/jwt.git",
|
||||||
"reference": "6d8665ccd924dc076a9b65d1ea8abe21d68f6958"
|
"reference": "c1123697f6a2ec29162b82f170dd4a491f524773"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/lcobucci/jwt/zipball/6d8665ccd924dc076a9b65d1ea8abe21d68f6958",
|
"url": "https://api.github.com/repos/lcobucci/jwt/zipball/c1123697f6a2ec29162b82f170dd4a491f524773",
|
||||||
"reference": "6d8665ccd924dc076a9b65d1ea8abe21d68f6958",
|
"reference": "c1123697f6a2ec29162b82f170dd4a491f524773",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
"lcobucci/clock": "^2.0",
|
"php": "^5.6 || ^7.0"
|
||||||
"php": "^7.4 || ^8.0"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"infection/infection": "^0.20",
|
"mikey179/vfsstream": "~1.5",
|
||||||
"lcobucci/coding-standard": "^6.0",
|
"phpmd/phpmd": "~2.2",
|
||||||
"mikey179/vfsstream": "^1.6",
|
"phpunit/php-invoker": "~1.1",
|
||||||
"phpbench/phpbench": "^0.17",
|
"phpunit/phpunit": "^5.7 || ^7.3",
|
||||||
"phpstan/extension-installer": "^1.0",
|
"squizlabs/php_codesniffer": "~2.3"
|
||||||
"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",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "4.0-dev"
|
"dev-master": "3.1-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -1360,7 +1368,7 @@
|
|||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Luís Cobucci",
|
"name": "Luís Otávio Cobucci Oblonczyk",
|
||||||
"email": "lcobucci@gmail.com",
|
"email": "lcobucci@gmail.com",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
}
|
}
|
||||||
@@ -1380,7 +1388,7 @@
|
|||||||
"type": "patreon"
|
"type": "patreon"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2020-11-25T02:06:12+00:00"
|
"time": "2020-08-20T13:22:28+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/commonmark",
|
"name": "league/commonmark",
|
||||||
@@ -1671,25 +1679,25 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/oauth2-server",
|
"name": "league/oauth2-server",
|
||||||
"version": "8.2.4",
|
"version": "8.1.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/oauth2-server.git",
|
"url": "https://github.com/thephpleague/oauth2-server.git",
|
||||||
"reference": "622eaa1f28eb4a2dea0cfc7e4f5280fac794e83c"
|
"reference": "09f22e8121fa1832962dba18213b80d4267ef8a3"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/622eaa1f28eb4a2dea0cfc7e4f5280fac794e83c",
|
"url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/09f22e8121fa1832962dba18213b80d4267ef8a3",
|
||||||
"reference": "622eaa1f28eb4a2dea0cfc7e4f5280fac794e83c",
|
"reference": "09f22e8121fa1832962dba18213b80d4267ef8a3",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"defuse/php-encryption": "^2.2.1",
|
"defuse/php-encryption": "^2.2.1",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
"lcobucci/jwt": "^3.4 || ^4.0",
|
"lcobucci/jwt": "^3.3.1",
|
||||||
"league/event": "^2.2",
|
"league/event": "^2.2",
|
||||||
"php": "^7.2 || ^8.0",
|
"php": ">=7.2.0",
|
||||||
"psr/http-message": "^1.0.1"
|
"psr/http-message": "^1.0.1"
|
||||||
},
|
},
|
||||||
"replace": {
|
"replace": {
|
||||||
@@ -1697,10 +1705,10 @@
|
|||||||
"lncd/oauth2": "*"
|
"lncd/oauth2": "*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"laminas/laminas-diactoros": "^2.4.1",
|
"laminas/laminas-diactoros": "^2.3.0",
|
||||||
"phpstan/phpstan": "^0.12.57",
|
"phpstan/phpstan": "^0.11.19",
|
||||||
"phpstan/phpstan-phpunit": "^0.12.16",
|
"phpstan/phpstan-phpunit": "^0.11.2",
|
||||||
"phpunit/phpunit": "^8.5.13",
|
"phpunit/phpunit": "^8.5.4 || ^9.1.3",
|
||||||
"roave/security-advisories": "dev-master"
|
"roave/security-advisories": "dev-master"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
@@ -1750,20 +1758,20 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2020-12-10T11:35:44+00:00"
|
"time": "2020-07-01T11:33:50+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "monolog/monolog",
|
"name": "monolog/monolog",
|
||||||
"version": "2.1.1",
|
"version": "2.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Seldaek/monolog.git",
|
"url": "https://github.com/Seldaek/monolog.git",
|
||||||
"reference": "f9eee5cec93dfb313a38b6b288741e84e53f02d5"
|
"reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/f9eee5cec93dfb313a38b6b288741e84e53f02d5",
|
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/1cb1cde8e8dd0f70cc0fe51354a59acad9302084",
|
||||||
"reference": "f9eee5cec93dfb313a38b6b288741e84e53f02d5",
|
"reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1776,16 +1784,17 @@
|
|||||||
"require-dev": {
|
"require-dev": {
|
||||||
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
|
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
|
||||||
"doctrine/couchdb": "~1.0@dev",
|
"doctrine/couchdb": "~1.0@dev",
|
||||||
"elasticsearch/elasticsearch": "^6.0",
|
"elasticsearch/elasticsearch": "^7",
|
||||||
"graylog2/gelf-php": "^1.4.2",
|
"graylog2/gelf-php": "^1.4.2",
|
||||||
|
"mongodb/mongodb": "^1.8",
|
||||||
"php-amqplib/php-amqplib": "~2.4",
|
"php-amqplib/php-amqplib": "~2.4",
|
||||||
"php-console/php-console": "^3.1.3",
|
"php-console/php-console": "^3.1.3",
|
||||||
"php-parallel-lint/php-parallel-lint": "^1.0",
|
|
||||||
"phpspec/prophecy": "^1.6.1",
|
"phpspec/prophecy": "^1.6.1",
|
||||||
|
"phpstan/phpstan": "^0.12.59",
|
||||||
"phpunit/phpunit": "^8.5",
|
"phpunit/phpunit": "^8.5",
|
||||||
"predis/predis": "^1.1",
|
"predis/predis": "^1.1",
|
||||||
"rollbar/rollbar": "^1.3",
|
"rollbar/rollbar": "^1.3",
|
||||||
"ruflin/elastica": ">=0.90 <3.0",
|
"ruflin/elastica": ">=0.90 <7.0.1",
|
||||||
"swiftmailer/swiftmailer": "^5.3|^6.0"
|
"swiftmailer/swiftmailer": "^5.3|^6.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
@@ -1805,7 +1814,7 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "2.x-dev"
|
"dev-main": "2.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -1821,11 +1830,11 @@
|
|||||||
{
|
{
|
||||||
"name": "Jordi Boggiano",
|
"name": "Jordi Boggiano",
|
||||||
"email": "j.boggiano@seld.be",
|
"email": "j.boggiano@seld.be",
|
||||||
"homepage": "http://seld.be"
|
"homepage": "https://seld.be"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
|
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
|
||||||
"homepage": "http://github.com/Seldaek/monolog",
|
"homepage": "https://github.com/Seldaek/monolog",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"log",
|
"log",
|
||||||
"logging",
|
"logging",
|
||||||
@@ -1841,7 +1850,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2020-07-23T08:41:23+00:00"
|
"time": "2020-12-14T13:15:25+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nesbot/carbon",
|
"name": "nesbot/carbon",
|
||||||
@@ -6141,16 +6150,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phar-io/version",
|
"name": "phar-io/version",
|
||||||
"version": "3.0.3",
|
"version": "3.0.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phar-io/version.git",
|
"url": "https://github.com/phar-io/version.git",
|
||||||
"reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae"
|
"reference": "e4782611070e50613683d2b9a57730e9a3ba5451"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phar-io/version/zipball/726c026815142e4f8677b7cb7f2249c9ffb7ecae",
|
"url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451",
|
||||||
"reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae",
|
"reference": "e4782611070e50613683d2b9a57730e9a3ba5451",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -6184,7 +6193,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Library for handling version information and constraints",
|
"description": "Library for handling version information and constraints",
|
||||||
"time": "2020-11-30T09:21:21+00:00"
|
"time": "2020-12-13T23:18:30+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpdocumentor/reflection-common",
|
"name": "phpdocumentor/reflection-common",
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateChatLinksTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('chat_links', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('link');
|
||||||
|
$table->unsignedInteger('class_id');
|
||||||
|
$table->unsignedInteger('creator');
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->foreign('class_id')
|
||||||
|
->references('id')->on('school_classes')
|
||||||
|
->onDelete('cascade');
|
||||||
|
$table->foreign('creator')
|
||||||
|
->references('id')->on('users')
|
||||||
|
->onDelete('cascade');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('chat_links');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,12 +6,16 @@ use Illuminate\Support\Facades\Route;
|
|||||||
Route::group(['prefix' => 'auth'], function () {
|
Route::group(['prefix' => 'auth'], function () {
|
||||||
Route::post('register', 'Auth\RegisterController');
|
Route::post('register', 'Auth\RegisterController');
|
||||||
Route::post('login', 'Auth\LoginController');
|
Route::post('login', 'Auth\LoginController');
|
||||||
Route::post('logout', 'Auth\LogoutController');
|
Route::post('logout', 'Auth\LogoutController')->middleware('auth:api');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::get('users', 'Users\UserController@getUser')->middleware('auth:api');
|
||||||
|
|
||||||
|
Route::apiResource('chat/links', 'ChatLinkController')->except(['show'])->middleware('auth:api'); // ссылки чата
|
||||||
|
|
||||||
Route::apiResource('headteachers', 'Users\HeadTeacherController');
|
Route::apiResource('headteachers', 'Users\HeadTeacherController');
|
||||||
|
|
||||||
Route::apiResource('teachers', 'Users\TeacherController');
|
Route::apiResource('teachers', 'Users\TeacherController');//->middleware(['auth:api','role:headteacher|teacher']);
|
||||||
Route::get('teacher/{teacher}/classes', 'Users\TeacherController@getClasses'); //получить классы у которых ведет учитель
|
Route::get('teacher/{teacher}/classes', 'Users\TeacherController@getClasses'); //получить классы у которых ведет учитель
|
||||||
|
|
||||||
Route::apiResource('students', 'Users\StudentController');
|
Route::apiResource('students', 'Users\StudentController');
|
||||||
@@ -29,14 +33,14 @@ Route::apiResource('themes', 'ThemeController');
|
|||||||
|
|
||||||
Route::apiResource('timetables', 'TimetableController');
|
Route::apiResource('timetables', 'TimetableController');
|
||||||
|
|
||||||
Route::get('banktasks', 'BankTaskController@index'); //получение списка всех заданий
|
Route::get('banktasks', 'BankTask\BankTaskController@index'); //получение списка всех заданий
|
||||||
Route::group(['prefix' => 'banktask'], function () {
|
Route::group(['prefix' => 'banktask'], function () {
|
||||||
Route::post('', 'BankTaskController@store'); //создание задания
|
Route::post('', 'BankTask\BankTaskController@store'); //создание задания
|
||||||
Route::get('{banktask}', 'BankTaskController@show'); //получение задания
|
Route::get('{banktask}', 'BankTask\BankTaskController@show'); //получение задания
|
||||||
Route::put('{banktask}', 'BankTaskController@update'); //обновление задания
|
Route::put('{banktask}', 'BankTask\BankTaskController@update'); //обновление задания
|
||||||
Route::delete('{banktask}', 'BankTaskController@delete'); //удаление задания
|
Route::delete('{banktask}', 'BankTask\BankTaskController@delete'); //удаление задания
|
||||||
Route::post('{banktask}/addfile', 'BankTaskFileController@store');
|
Route::post('{banktask}/addfile', 'BankTask\BankTaskFileController@store');
|
||||||
Route::get('{banktask}/files', 'BankTaskFileController@showFiles');
|
Route::get('{banktask}/files', 'BankTask\BankTaskFileController@showFiles');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('/file/{file}/download', 'BankTaskFileController@download');
|
Route::get('/file/{file}/download', 'BankTaskFileController@download');
|
||||||
|
|||||||
Reference in New Issue
Block a user