diff --git a/app/Broadcasting/SaveChannel.php b/app/Broadcasting/SaveChannel.php new file mode 100644 index 0000000..991f8b2 --- /dev/null +++ b/app/Broadcasting/SaveChannel.php @@ -0,0 +1,29 @@ +isContributor($user) || + $save->owner->is($user) + ) + ) { + return new SimplestUserResource($user); + } + return false; + } +} diff --git a/app/Console/Commands/PurgeDeletedSaves.php b/app/Console/Commands/PurgeDeletedSaves.php new file mode 100644 index 0000000..a64c6a9 --- /dev/null +++ b/app/Console/Commands/PurgeDeletedSaves.php @@ -0,0 +1,67 @@ +isPast()) + static::$purgedBefore = $date; + } + + /** + * Gibt den Wert von $purgedBefore oder den Zeitpunkt vor einem Monat zurück + * @see $purgedBefore + * @return Carbon + */ + public static function getUserPurgedBeforeTime(){ + return static::$purgedBefore?:Carbon::now()->subMonth(); + } + + /** + * Führt das Kommando aus + */ + public function handle() + { + $count = Save::withTrashed()->where('deleted_at', '<', static::getUserPurgedBeforeTime())->forceDelete(); + $this->output->success("Deleted " . $count . " rows!"); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 1bf5458..e62f1b8 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -26,6 +26,7 @@ protected function schedule(Schedule $schedule) { $schedule->command('purge:deleted')->weekly(); $schedule->command('purge:anonymous')->weekly(); + $schedule->command("purge:saves")->weekly(); $schedule->command('passport:purge')->monthly(); $schedule->command('notify:userCount')->daily(); } diff --git a/app/Events/LiveSaveUpdate.php b/app/Events/LiveSaveUpdate.php new file mode 100644 index 0000000..e751c29 --- /dev/null +++ b/app/Events/LiveSaveUpdate.php @@ -0,0 +1,62 @@ +user = $user; + $this->save = $save; + $this->patches = $patches; + } + + /** + * Get the data to broadcast. + * + * @return array + */ + #[ArrayShape(["patches" => "string", "save" => "array", "sender" => "array"])] public function broadcastWith(): array + { + return [ + "patches" => $this->patches, + "save" => SimplerSaveResource::make($this->save)->resolve(), + "sender" => SimplestUserResource::make($this->user)->resolve() + ]; + } + + /** + * Get the channels the event should broadcast on. + * + * @return Channel|PresenceChannel|array + */ + public function broadcastOn(): Channel|PresenceChannel|array + { + return new PresenceChannel("savechannel.".$this->save->id); + } +} diff --git a/app/Http/Controllers/EmailController.php b/app/Http/Controllers/EmailController.php index 67dd042..e931773 100644 --- a/app/Http/Controllers/EmailController.php +++ b/app/Http/Controllers/EmailController.php @@ -4,6 +4,7 @@ use App\Models\EmailVerification; use Carbon\Carbon; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Http\Response; use Symfony\Component\HttpFoundation\Response as ResponseAlias; @@ -17,18 +18,18 @@ class EmailController extends Controller /** * Übernimmt die E-Mail aus der EmailVerification-Tabelle in die User-Tabelle * @param string $token token des E-Mail verifikation Prozesses - * @return Response Code 200 bei erfolgreicher Übernahme + * @return JsonResponse Code 200 bei erfolgreicher Übernahme */ - function verify(string $token): Response + function verify(string $token): JsonResponse { - $email_verification = EmailVerification::whereToken($token)->firstOrFail(); $user = $email_verification->user; $user->email_verified_at = Carbon::now(); $user->email = $email_verification->email; $user->save(); - - return response()->noContent(ResponseAlias::HTTP_OK); + return response()->json([ + "email" => $email_verification->email + ], Response::HTTP_OK); } } diff --git a/app/Http/Controllers/SaveController.php b/app/Http/Controllers/SaveController.php index 3e997b6..6d28838 100644 --- a/app/Http/Controllers/SaveController.php +++ b/app/Http/Controllers/SaveController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Events\LiveSaveUpdate; use App\Http\Resources\SaveResource; use App\Http\Resources\SimpleSaveResource; use App\Models\Save; @@ -43,12 +44,11 @@ public function index(): AnonymousResourceCollection */ public function store(Request $request): JsonResponse { - $this->authorize("create", Save::class); $validate = $request->validate([ - "name" => "required|string", - "description" => "string", + "name" => "required|string|max:255", + "description" => "string|max:300", "data" => "nullable|json", "tool_id" => "required|exists:tools,id" ]); @@ -86,6 +86,22 @@ public function show(Request $request, Save $save): SaveResource return new SaveResource($save); } + /** + * @throws AuthorizationException + */ + public function broadcastPatches(Request $request, Save $save): Response + { + $this->authorize("broadcast", $save); + $validate = $request->validate([ + "data" => "required|string", + ]); + $patches = $validate["data"]; + + broadcast(new LiveSaveUpdate($request->user(), $save, $patches))->toOthers(); + + return response()->noContent(Response::HTTP_OK); + } + /** Aktualisiert den ausgewählten Speicherstand mit den übergebenen Daten * * Response-Codes: @@ -126,8 +142,8 @@ public function update(Request $request, Save $save): Response } else { $validated = $request->validate([ "data" => "nullable|json", - "name" => "string", - "description" => "string", + "name" => "string|max:255", + "description" => "string|max:300", "lock" => "prohibited" ]); diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index c5eaf82..a775b76 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -28,14 +28,12 @@ */ class UserController extends Controller { - /** * Das regex, welches Benutzt wird um sicherzustellen, dass das User Password valide ist * @var string */ public static $passwordRegex = "/^(?=.*[a-zäöüß])(?=.*[A-ZÄÖÜ])(?=.*\d)(?=.*[$&§+,:;=?@#|'<>.^*()%!_-])[A-Za-zäöüßÄÖÜ\d$&§+,:;=?@#|'<>.^*()%!_-].+$/"; - /** * Zeigt alle User an * @return AnonymousResourceCollection Alle User als ResourceCollection @@ -153,6 +151,35 @@ public function update(Request $request, User $user, EmailService $emailService, return response()->noContent(Response::HTTP_OK); } + /** + * Portiert einen anonymen Benutzer in einen vollwertigen Benutzer + * + * @param Request $request + * @param EmailService $emailService + * @param UserService $userService + * @return Response + * @throws AuthorizationException + * @throws ValidationException + */ + public function portAnonymousUser(Request $request, EmailService $emailService, UserService $userService) + { + $user = \Auth::user(); + $this->authorize("anonport", $user); + + $validated = Validator::validate($request->all(), [ + "email" => ["email", "unique:users,email"], + "username" => ["string", "unique:users"], + "password" => ["string", "min:8", "max:120", "regex:" . UserController::$passwordRegex] + ], [ + "password.regex" => __("passwords.invalid_regex") + ]); + + $user->anonymous = false; + $userService->updateUser($user, $validated, $emailService); + + return response()->noContent(Response::HTTP_OK); + } + /** Löscht den ausgewählten User * @param User $user Den in der Url definierten User * @return Response Code 200, wenn das Löschen erfolgreich war diff --git a/app/Http/Controllers/UserSavesController.php b/app/Http/Controllers/UserSavesController.php index c112a12..3cbe29f 100644 --- a/app/Http/Controllers/UserSavesController.php +++ b/app/Http/Controllers/UserSavesController.php @@ -37,6 +37,7 @@ public function index(Request $request, User $user) "tool_id" => ["integer", "exists:tools,id"], "name" => ["string"], "description" => ["string"], + "deleted" => ["sometimes", "boolean"], "search_both" => ["boolean"] ]); @@ -51,7 +52,9 @@ public function index(Request $request, User $user) if (key_exists("tool_id", $validated)) { $query->where("tool_id", $validated["tool_id"]); } - + if (!key_exists("deleted", $validated)) { + $query->where("deleted_at", null); + } if (key_exists("name", $validated)) { $query->where("name", "Like", "%" . $validated["name"] . "%"); } diff --git a/app/Http/Controllers/UserSettingController.php b/app/Http/Controllers/UserSettingController.php index fe4f01a..8cd482d 100644 --- a/app/Http/Controllers/UserSettingController.php +++ b/app/Http/Controllers/UserSettingController.php @@ -23,7 +23,7 @@ public function index(User $user): AnonymousResourceCollection public function store(Request $request, User $user): Response { - $this->authorize("create",[UserSetting::class,$user]); + $this->authorize("create", [UserSetting::class, $user]); $validated = $request->validate([ "setting" => ["required","exists:settings,id"], @@ -39,22 +39,23 @@ public function store(Request $request, User $user): Response public function show(User $user, Setting $setting): UserSettingResource { - $m = $user->settings($setting->id)->firstOrFail(); - $this->authorize("view",$m); - return new UserSettingResource($m); + $userSetting = $user->getUserSetting($setting->id); + $this->authorize("view", [UserSetting::class, $userSetting]); + return new UserSettingResource($userSetting); } public function update(Request $request, User $user, Setting $setting) { + $userSetting = $user->getUserSetting($setting->id); + $this->authorize("update", [UserSetting::class, $userSetting]); - $m = $user->getSetting($setting->id)->firstOrFail(); - $this->authorize("update",$m); $validated = $request->validate([ "value" => ["json"] ]); - $m->fill($validated); - $m->save(); + $userSetting->fill($validated); + $userSetting->save(); + return \response()->noContent(Response::HTTP_OK); } diff --git a/app/Models/Setting.php b/app/Models/Setting.php index 3209771..0f9216d 100644 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -30,11 +30,13 @@ */ class Setting extends Model { - use HasFactory,Limitable; - + use HasFactory, Limitable; public $timestamps = false; + protected $fillable = [ + + ]; public function users(): \Illuminate\Database\Eloquent\Relations\BelongsToMany { diff --git a/app/Models/User.php b/app/Models/User.php index aa0c6d3..8e75968 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -223,9 +223,9 @@ public function settings($setting_id = -1): BelongsToMany return $q; } - public function getSetting($setting_id) + public function getUserSetting(int $setting_id): \Illuminate\Database\Eloquent\Model|HasMany { - return $this->hasMany(UserSetting::class); + return $this->hasMany(UserSetting::class)->where("setting_id", "=", $setting_id)->firstOrFail(); } diff --git a/app/Models/UserSetting.php b/app/Models/UserSetting.php index 0051267..cbd77f9 100644 --- a/app/Models/UserSetting.php +++ b/app/Models/UserSetting.php @@ -4,6 +4,7 @@ use App\Traits\Limitable; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\Pivot; @@ -21,7 +22,6 @@ */ class UserSetting extends Pivot { - use Limitable; protected $table = "user_settings"; diff --git a/app/Policies/SavePolicy.php b/app/Policies/SavePolicy.php index 124845a..e9aba8d 100644 --- a/app/Policies/SavePolicy.php +++ b/app/Policies/SavePolicy.php @@ -2,6 +2,7 @@ namespace App\Policies; +use App\Broadcasting\SaveChannel; use App\Helper\PermissionHelper; use App\Models\Save; use App\Models\User; @@ -82,6 +83,17 @@ public function restore(User $user, Save $save): bool return false; } + /** + * Wenn der User broadcasten darf + * + * @param User $user Der aktuelle authentifizierte User + * @param Save $save Der Speicherstand + * @return bool + */ + public function broadcast(User $user, Save $save): bool { + return (new SaveChannel())->join($user, $save) !== false; + } + /** * Kein User darf einen Speicherstand komplett löschen * diff --git a/app/Policies/SettingPolicy.php b/app/Policies/SettingPolicy.php index e717abe..6f325cd 100644 --- a/app/Policies/SettingPolicy.php +++ b/app/Policies/SettingPolicy.php @@ -54,6 +54,7 @@ public function create(User $user) public function update(User $user, Setting $setting) { return false; + return $setting->users()->find($user->id) !== null; } /** diff --git a/app/Policies/UserPolicy.php b/app/Policies/UserPolicy.php index bfb9893..4858944 100644 --- a/app/Policies/UserPolicy.php +++ b/app/Policies/UserPolicy.php @@ -5,6 +5,7 @@ use App\Models\User; use Illuminate\Auth\Access\HandlesAuthorization; + class UserPolicy { use HandlesAuthorization; @@ -79,4 +80,13 @@ public function searchAny(User $user, string $searchString): bool { return true; } + + /** + * Prüft ob der User anonym ist und sich porten darf + * @param User $user + * @return bool + */ + public function anonport(User $user): bool { + return $user->anonymous; + } } diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 30ac2e8..5662edb 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -3,7 +3,9 @@ namespace App\Providers; use App\Http\Controllers\AuthTokenController; +use App\Models\UserSetting; use App\Policies\AuthTokenPolicy; +use App\Policies\UserSettingPolicy; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; use Laravel\Passport\Passport; diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 28a566c..da49a07 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -17,7 +17,7 @@ class BroadcastServiceProvider extends ServiceProvider */ public function boot() { - Broadcast::routes(); + Broadcast::routes(['prefix' => 'api', 'middleware' => ['auth:api']]); require base_path('routes/channels.php'); } diff --git a/app/Services/EmailService.php b/app/Services/EmailService.php index 8164cbb..2dd0385 100644 --- a/app/Services/EmailService.php +++ b/app/Services/EmailService.php @@ -7,6 +7,7 @@ use App\Mail\EmailVerificationEmail; use App\Models\EmailVerification; use App\Models\User; +use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Mail; /** @@ -31,17 +32,14 @@ public function __construct(TokenService $tokenService) * @param User $user Der betroffene User * @param string $email Die neue Email */ - public function requestEmailChangeOfUser(User $user, string $email) + public function requestEmailChangeOfUser(User &$user, string $email) { $emailVerification = new EmailVerification(); $emailVerification->email = $email; - $emailVerification->token = $this->tokenService->createToken(); - $user->emailVerification()->save($emailVerification); - // is queued because of the ShouldQueue interface of EmailVerificationEmail Mail::to($emailVerification->email)->send(new EmailVerificationEmail($emailVerification->token, $user->username)); } diff --git a/app/Services/UserService.php b/app/Services/UserService.php index 6b5086f..d967ac2 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -53,10 +53,10 @@ public function checkEmail(string $email): bool * @param array $data array with the new data * @param EmailService $emailService the email service */ - public function updateUser(User $u, array $data, EmailService $emailService) + public function updateUser(User &$u, array $data, EmailService $emailService) { - $u->fill($data); + if (is_null($u->last_activity)) $u->last_activity = Carbon::now(); if (key_exists("password", $data)) { diff --git a/composer.json b/composer.json index 3510775..278705f 100644 --- a/composer.json +++ b/composer.json @@ -9,11 +9,13 @@ "license": "MIT", "require": { "php": "^8.0.2", + "beyondcode/laravel-websockets": "^1.13", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "laravel/framework": "^9.0", "laravel/passport": "^10.3", - "laravel/tinker": "^2.5" + "laravel/tinker": "^2.5", + "pusher/pusher-php-server": "^7.0" }, "require-dev": { "barryvdh/laravel-ide-helper": "^2.10", diff --git a/composer.lock b/composer.lock index 3646a52..1dfcaf6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "658c1d6269bc142da0299884a7fd31da", + "content-hash": "ca4e101bf9de7444c467638184aed4ee", "packages": [ { "name": "asm89/stack-cors", @@ -62,6 +62,88 @@ }, "time": "2022-01-18T09:12:03+00:00" }, + { + "name": "beyondcode/laravel-websockets", + "version": "1.13.1", + "source": { + "type": "git", + "url": "https://github.com/beyondcode/laravel-websockets.git", + "reference": "f0649b65fb5562d20eff66f61716ef98717e228a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beyondcode/laravel-websockets/zipball/f0649b65fb5562d20eff66f61716ef98717e228a", + "reference": "f0649b65fb5562d20eff66f61716ef98717e228a", + "shasum": "" + }, + "require": { + "cboden/ratchet": "^0.4.1", + "ext-json": "*", + "facade/ignition-contracts": "^1.0", + "guzzlehttp/psr7": "^1.7|^2.0", + "illuminate/broadcasting": "^6.0|^7.0|^8.0|^9.0", + "illuminate/console": "^6.0|^7.0|^8.0|^9.0", + "illuminate/http": "^6.0|^7.0|^8.0|^9.0", + "illuminate/routing": "^6.0|^7.0|^8.0|^9.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0", + "php": "^7.2|^8.0", + "pusher/pusher-php-server": "^3.0|^4.0|^5.0|^6.0|^7.0", + "react/dns": "^1.1", + "react/http": "^1.1", + "symfony/http-kernel": "^4.0|^5.0|^6.0", + "symfony/psr-http-message-bridge": "^1.1|^2.0" + }, + "require-dev": { + "mockery/mockery": "^1.3.3", + "orchestra/testbench": "^4.0|^5.0|^6.0", + "phpunit/phpunit": "^8.0|^9.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "BeyondCode\\LaravelWebSockets\\WebSocketsServiceProvider" + ], + "aliases": { + "WebSocketRouter": "BeyondCode\\LaravelWebSockets\\Facades\\WebSocketRouter" + } + } + }, + "autoload": { + "psr-4": { + "BeyondCode\\LaravelWebSockets\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marcel Pociot", + "email": "marcel@beyondco.de", + "homepage": "https://beyondcode.de", + "role": "Developer" + }, + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "An easy to use WebSocket server", + "homepage": "https://github.com/beyondcode/laravel-websockets", + "keywords": [ + "beyondcode", + "laravel-websockets" + ], + "support": { + "issues": "https://github.com/beyondcode/laravel-websockets/issues", + "source": "https://github.com/beyondcode/laravel-websockets/tree/1.13.1" + }, + "time": "2022-03-03T08:41:47+00:00" + }, { "name": "brick/math", "version": "0.9.3", @@ -122,6 +204,69 @@ ], "time": "2021-08-15T20:50:18+00:00" }, + { + "name": "cboden/ratchet", + "version": "v0.4.4", + "source": { + "type": "git", + "url": "https://github.com/ratchetphp/Ratchet.git", + "reference": "5012dc954541b40c5599d286fd40653f5716a38f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ratchetphp/Ratchet/zipball/5012dc954541b40c5599d286fd40653f5716a38f", + "reference": "5012dc954541b40c5599d286fd40653f5716a38f", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.7|^2.0", + "php": ">=5.4.2", + "ratchet/rfc6455": "^0.3.1", + "react/event-loop": ">=0.4", + "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5", + "symfony/http-foundation": "^2.6|^3.0|^4.0|^5.0|^6.0", + "symfony/routing": "^2.6|^3.0|^4.0|^5.0|^6.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ratchet\\": "src/Ratchet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "role": "Developer" + }, + { + "name": "Matt Bonneau", + "role": "Developer" + } + ], + "description": "PHP WebSocket library", + "homepage": "http://socketo.me", + "keywords": [ + "Ratchet", + "WebSockets", + "server", + "sockets", + "websocket" + ], + "support": { + "chat": "https://gitter.im/reactphp/reactphp", + "issues": "https://github.com/ratchetphp/Ratchet/issues", + "source": "https://github.com/ratchetphp/Ratchet/tree/v0.4.4" + }, + "time": "2021-12-14T00:20:41+00:00" + }, { "name": "defuse/php-encryption", "version": "v2.3.1", @@ -559,6 +704,162 @@ ], "time": "2021-10-11T09:18:27+00:00" }, + { + "name": "evenement/evenement", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7", + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Evenement": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/master" + }, + "time": "2017-07-23T21:35:13+00:00" + }, + { + "name": "facade/ignition-contracts", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/facade/ignition-contracts.git", + "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267", + "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^v2.15.8", + "phpunit/phpunit": "^9.3.11", + "vimeo/psalm": "^3.17.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Facade\\IgnitionContracts\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://flareapp.io", + "role": "Developer" + } + ], + "description": "Solution contracts for Ignition", + "homepage": "https://github.com/facade/ignition-contracts", + "keywords": [ + "contracts", + "flare", + "ignition" + ], + "support": { + "issues": "https://github.com/facade/ignition-contracts/issues", + "source": "https://github.com/facade/ignition-contracts/tree/1.0.2" + }, + "time": "2020-10-16T08:27:54+00:00" + }, + { + "name": "fig/http-message-util", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message-util.git", + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765", + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0 || ^8.0" + }, + "suggest": { + "psr/http-message": "The package containing the PSR-7 interfaces" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Fig\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "issues": "https://github.com/php-fig/http-message-util/issues", + "source": "https://github.com/php-fig/http-message-util/tree/1.1.5" + }, + "time": "2020-11-24T22:02:12+00:00" + }, { "name": "firebase/php-jwt", "version": "v5.5.1", @@ -2735,6 +3036,92 @@ }, "time": "2020-10-15T08:29:30+00:00" }, + { + "name": "paragonie/sodium_compat", + "version": "v1.17.1", + "source": { + "type": "git", + "url": "https://github.com/paragonie/sodium_compat.git", + "reference": "ac994053faac18d386328c91c7900f930acadf1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/ac994053faac18d386328c91c7900f930acadf1e", + "reference": "ac994053faac18d386328c91c7900f930acadf1e", + "shasum": "" + }, + "require": { + "paragonie/random_compat": ">=1", + "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" + }, + "suggest": { + "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", + "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." + }, + "type": "library", + "autoload": { + "files": [ + "autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com" + }, + { + "name": "Frank Denis", + "email": "jedisct1@pureftpd.org" + } + ], + "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", + "keywords": [ + "Authentication", + "BLAKE2b", + "ChaCha20", + "ChaCha20-Poly1305", + "Chapoly", + "Curve25519", + "Ed25519", + "EdDSA", + "Edwards-curve Digital Signature Algorithm", + "Elliptic Curve Diffie-Hellman", + "Poly1305", + "Pure-PHP cryptography", + "RFC 7748", + "RFC 8032", + "Salpoly", + "Salsa20", + "X25519", + "XChaCha20-Poly1305", + "XSalsa20-Poly1305", + "Xchacha20", + "Xsalsa20", + "aead", + "cryptography", + "ecdh", + "elliptic curve", + "elliptic curve cryptography", + "encryption", + "libsodium", + "php", + "public-key cryptography", + "secret-key cryptography", + "side-channel resistant" + ], + "support": { + "issues": "https://github.com/paragonie/sodium_compat/issues", + "source": "https://github.com/paragonie/sodium_compat/tree/v1.17.1" + }, + "time": "2022-03-23T19:32:04+00:00" + }, { "name": "php-http/message-factory", "version": "v1.0.2", @@ -3414,31 +3801,952 @@ "time": "2022-02-28T15:28:54+00:00" }, { - "name": "ralouphie/getallheaders", - "version": "3.0.3", + "name": "pusher/pusher-php-server", + "version": "7.0.2", "source": { "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" + "url": "https://github.com/pusher/pusher-http-php.git", + "reference": "af3eeaefc0c7959f5b3852f0a4dd5547245d33df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", + "url": "https://api.github.com/repos/pusher/pusher-http-php/zipball/af3eeaefc0c7959f5b3852f0a4dd5547245d33df", + "reference": "af3eeaefc0c7959f5b3852f0a4dd5547245d33df", "shasum": "" }, "require": { - "php": ">=5.6" - }, + "ext-curl": "*", + "ext-json": "*", + "guzzlehttp/guzzle": "^7.2", + "paragonie/sodium_compat": "^1.6", + "php": "^7.3|^8.0", + "psr/log": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "overtrue/phplint": "^2.3", + "phpunit/phpunit": "^8.5|^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Pusher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Library for interacting with the Pusher REST API", + "keywords": [ + "events", + "messaging", + "php-pusher-server", + "publish", + "push", + "pusher", + "real time", + "real-time", + "realtime", + "rest", + "trigger" + ], + "support": { + "issues": "https://github.com/pusher/pusher-http-php/issues", + "source": "https://github.com/pusher/pusher-http-php/tree/7.0.2" + }, + "time": "2021-12-07T13:09:00+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "ramsey/collection", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/cccc74ee5e328031b15640b51056ee8d3bb66c0a", + "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8", + "symfony/polyfill-php81": "^1.23" + }, + "require-dev": { + "captainhook/captainhook": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "ergebnis/composer-normalize": "^2.6", + "fakerphp/faker": "^1.5", + "hamcrest/hamcrest-php": "^2", + "jangregor/phpstan-prophecy": "^0.8", + "mockery/mockery": "^1.3", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1", + "phpstan/phpstan": "^0.12.32", + "phpstan/phpstan-mockery": "^0.12.5", + "phpstan/phpstan-phpunit": "^0.12.11", + "phpunit/phpunit": "^8.5 || ^9", + "psy/psysh": "^0.10.4", + "slevomat/coding-standard": "^6.3", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/1.2.2" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2021-10-10T03:01:02+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.2.3", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "shasum": "" + }, + "require": { + "brick/math": "^0.8 || ^0.9", + "ext-json": "*", + "php": "^7.2 || ^8.0", + "ramsey/collection": "^1.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php80": "^1.14" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "moontoast/math": "^1.1", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-mockery": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^8.5 || ^9", + "slevomat/coding-standard": "^7.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-ctype": "Enables faster processing of character classification using ctype functions.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.x-dev" + }, + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.2.3" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2021-09-25T23:10:38+00:00" + }, + { + "name": "ratchet/rfc6455", + "version": "v0.3.1", + "source": { + "type": "git", + "url": "https://github.com/ratchetphp/RFC6455.git", + "reference": "7c964514e93456a52a99a20fcfa0de242a43ccdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ratchetphp/RFC6455/zipball/7c964514e93456a52a99a20fcfa0de242a43ccdb", + "reference": "7c964514e93456a52a99a20fcfa0de242a43ccdb", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^2 || ^1.7", + "php": ">=5.4.2" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "react/socket": "^1.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ratchet\\RFC6455\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "role": "Developer" + }, + { + "name": "Matt Bonneau", + "role": "Developer" + } + ], + "description": "RFC6455 WebSocket protocol handler", + "homepage": "http://socketo.me", + "keywords": [ + "WebSockets", + "rfc6455", + "websocket" + ], + "support": { + "chat": "https://gitter.im/reactphp/reactphp", + "issues": "https://github.com/ratchetphp/RFC6455/issues", + "source": "https://github.com/ratchetphp/RFC6455/tree/v0.3.1" + }, + "time": "2021-12-09T23:20:49+00:00" + }, + { + "name": "react/cache", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "4bf736a2cccec7298bdf745db77585966fc2ca7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/4bf736a2cccec7298bdf745db77585966fc2ca7e", + "reference": "4bf736a2cccec7298bdf745db77585966fc2ca7e", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.1.1" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-02-02T06:47:52+00:00" + }, + { + "name": "react/dns", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb", + "reference": "6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.0 || ^2.7 || ^1.2.1", + "react/promise-timer": "^1.8" + }, + "require-dev": { + "clue/block-react": "^1.2", + "phpunit/phpunit": "^9.3 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-12-20T08:46:54+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "187fb56f46d424afb6ec4ad089269c72eec2e137" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/187fb56f46d424afb6ec4ad089269c72eec2e137", + "reference": "187fb56f46d424afb6ec4ad089269c72eec2e137", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "suggest": { + "ext-event": "~1.0 for ExtEventLoop", + "ext-pcntl": "For signal handling support when using the StreamSelectLoop", + "ext-uv": "* for ExtUvLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-03-17T11:10:22+00:00" + }, + { + "name": "react/http", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/http.git", + "reference": "4a1e85382e8c2a9e0fdb8ac04e94585da2083bfa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/http/zipball/4a1e85382e8c2a9e0fdb8ac04e94585da2083bfa", + "reference": "4a1e85382e8c2a9e0fdb8ac04e94585da2083bfa", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "fig/http-message-util": "^1.1", + "php": ">=5.3.0", + "psr/http-message": "^1.0", + "react/event-loop": "^1.2", + "react/promise": "^2.3 || ^1.2.1", + "react/promise-stream": "^1.1", + "react/socket": "^1.9", + "react/stream": "^1.2", + "ringcentral/psr7": "^1.2" + }, + "require-dev": { + "clue/http-proxy-react": "^1.7", + "clue/reactphp-ssh-proxy": "^1.3", + "clue/socks-react": "^1.3", + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/async": "^4 || ^3 || ^2", + "react/promise-timer": "^1.9" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Http\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven, streaming HTTP client and server implementation for ReactPHP", + "keywords": [ + "async", + "client", + "event-driven", + "http", + "http client", + "http server", + "https", + "psr-7", + "reactphp", + "server", + "streaming" + ], + "support": { + "issues": "https://github.com/reactphp/http/issues", + "source": "https://github.com/reactphp/http/tree/v1.7.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-08-23T12:31:28+00:00" + }, + { + "name": "react/promise", + "version": "v2.9.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-02-11T10:27:51+00:00" + }, + { + "name": "react/promise-stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise-stream.git", + "reference": "ef05517b99e4363beaa7993d4e2d6c50f1b22a09" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise-stream/zipball/ef05517b99e4363beaa7993d4e2d6c50f1b22a09", + "reference": "ef05517b99e4363beaa7993d4e2d6c50f1b22a09", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/promise": "^3 || ^2.1 || ^1.2", + "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.6" + }, + "require-dev": { + "clue/block-react": "^1.0", + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3", + "react/promise-timer": "^1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "The missing link between Promise-land and Stream-land for ReactPHP", + "homepage": "https://github.com/reactphp/promise-stream", + "keywords": [ + "Buffer", + "async", + "promise", + "reactphp", + "stream", + "unwrap" + ], + "support": { + "issues": "https://github.com/reactphp/promise-stream/issues", + "source": "https://github.com/reactphp/promise-stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-06-20T10:36:51+00:00" + }, + { + "name": "react/promise-timer", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise-timer.git", + "reference": "aa7a73c74b8d8c0f622f5982ff7b0351bc29e495" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/aa7a73c74b8d8c0f622f5982ff7b0351bc29e495", + "reference": "aa7a73c74b8d8c0f622f5982ff7b0351bc29e495", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/event-loop": "^1.2", + "react/promise": "^3.0 || ^2.7.0 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\Timer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", + "homepage": "https://github.com/reactphp/promise-timer", + "keywords": [ + "async", + "event-loop", + "promise", + "reactphp", + "timeout", + "timer" + ], + "support": { + "issues": "https://github.com/reactphp/promise-timer/issues", + "source": "https://github.com/reactphp/promise-timer/tree/v1.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-06-13T13:41:03+00:00" + }, + { + "name": "react/socket", + "version": "v1.12.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "81e1b4d7f5450ebd8d2e9a95bb008bb15ca95a7b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/81e1b4d7f5450ebd8d2e9a95bb008bb15ca95a7b", + "reference": "81e1b4d7f5450ebd8d2e9a95bb008bb15ca95a7b", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.8", + "react/event-loop": "^1.2", + "react/promise": "^3 || ^2.6 || ^1.2.1", + "react/promise-timer": "^1.9", + "react/stream": "^1.2" + }, "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/async": "^4 || ^3 || ^2", + "react/promise-stream": "^1.4" }, "type": "library", "autoload": { - "files": [ - "src/getallheaders.php" - ] + "psr-4": { + "React\\Socket\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3446,58 +4754,77 @@ ], "authors": [ { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "A polyfill for getallheaders.", + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.12.0" }, - "time": "2019-03-08T08:55:37+00:00" + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-08-25T12:32:25+00:00" }, { - "name": "ramsey/collection", - "version": "1.2.2", + "name": "react/stream", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/ramsey/collection.git", - "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a" + "url": "https://github.com/reactphp/stream.git", + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/cccc74ee5e328031b15640b51056ee8d3bb66c0a", - "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a", + "url": "https://api.github.com/repos/reactphp/stream/zipball/7a423506ee1903e89f1e08ec5f0ed430ff784ae9", + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9", "shasum": "" }, "require": { - "php": "^7.3 || ^8", - "symfony/polyfill-php81": "^1.23" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" }, "require-dev": { - "captainhook/captainhook": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "ergebnis/composer-normalize": "^2.6", - "fakerphp/faker": "^1.5", - "hamcrest/hamcrest-php": "^2", - "jangregor/phpstan-prophecy": "^0.8", - "mockery/mockery": "^1.3", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1", - "phpstan/phpstan": "^0.12.32", - "phpstan/phpstan-mockery": "^0.12.5", - "phpstan/phpstan-phpunit": "^0.12.11", - "phpunit/phpunit": "^8.5 || ^9", - "psy/psysh": "^0.10.4", - "slevomat/coding-standard": "^6.3", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.4" + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" }, "type": "library", "autoload": { "psr-4": { - "Ramsey\\Collection\\": "src/" + "React\\Stream\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3506,133 +4833,113 @@ ], "authors": [ { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "A PHP library for representing and manipulating collections.", + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", "keywords": [ - "array", - "collection", - "hash", - "map", - "queue", - "set" + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" ], "support": { - "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.2.2" + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.2.0" }, "funding": [ { - "url": "https://github.com/ramsey", + "url": "https://github.com/WyriHaximus", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", - "type": "tidelift" + "url": "https://github.com/clue", + "type": "github" } ], - "time": "2021-10-10T03:01:02+00:00" + "time": "2021-07-11T12:37:55+00:00" }, { - "name": "ramsey/uuid", - "version": "4.2.3", + "name": "ringcentral/psr7", + "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/ramsey/uuid.git", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" + "url": "https://github.com/ringcentral/psr7.git", + "reference": "360faaec4b563958b673fb52bbe94e37f14bc686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "url": "https://api.github.com/repos/ringcentral/psr7/zipball/360faaec4b563958b673fb52bbe94e37f14bc686", + "reference": "360faaec4b563958b673fb52bbe94e37f14bc686", "shasum": "" }, "require": { - "brick/math": "^0.8 || ^0.9", - "ext-json": "*", - "php": "^7.2 || ^8.0", - "ramsey/collection": "^1.0", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-php80": "^1.14" + "php": ">=5.3", + "psr/http-message": "~1.0" }, - "replace": { - "rhumsaa/uuid": "self.version" + "provide": { + "psr/http-message-implementation": "1.0" }, "require-dev": { - "captainhook/captainhook": "^5.10", - "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", - "moontoast/math": "^1.1", - "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-mockery": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^8.5 || ^9", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" - }, - "suggest": { - "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-ctype": "Enables faster processing of character classification using ctype functions.", - "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", - "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", - "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.x-dev" - }, - "captainhook": { - "force-install": true + "dev-master": "1.0-dev" } }, "autoload": { "files": [ - "src/functions.php" + "src/functions_include.php" ], "psr-4": { - "Ramsey\\Uuid\\": "src/" + "RingCentral\\Psr7\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "PSR-7 message implementation", "keywords": [ - "guid", - "identifier", - "uuid" + "http", + "message", + "stream", + "uri" ], "support": { - "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.2.3" + "source": "https://github.com/ringcentral/psr7/tree/master" }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", - "type": "tidelift" - } - ], - "time": "2021-09-25T23:10:38+00:00" + "time": "2018-05-29T20:21:04+00:00" }, { "name": "symfony/console", @@ -6712,59 +8019,6 @@ ], "time": "2022-03-03T08:28:38+00:00" }, - { - "name": "facade/ignition-contracts", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/facade/ignition-contracts.git", - "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267", - "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^v2.15.8", - "phpunit/phpunit": "^9.3.11", - "vimeo/psalm": "^3.17.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Facade\\IgnitionContracts\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://flareapp.io", - "role": "Developer" - } - ], - "description": "Solution contracts for Ignition", - "homepage": "https://github.com/facade/ignition-contracts", - "keywords": [ - "contracts", - "flare", - "ignition" - ], - "support": { - "issues": "https://github.com/facade/ignition-contracts/issues", - "source": "https://github.com/facade/ignition-contracts/tree/1.0.2" - }, - "time": "2020-10-16T08:27:54+00:00" - }, { "name": "fakerphp/faker", "version": "v1.19.0", @@ -9348,5 +10602,5 @@ "php": "^8.0.2" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } diff --git a/config/app.php b/config/app.php index 58a0ceb..a798b0e 100644 --- a/config/app.php +++ b/config/app.php @@ -171,7 +171,7 @@ */ App\Providers\AppServiceProvider::class, App\Providers\AuthServiceProvider::class, - // App\Providers\BroadcastServiceProvider::class, + App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, diff --git a/config/broadcasting.php b/config/broadcasting.php index 2d52982..2720632 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -37,7 +37,11 @@ 'app_id' => env('PUSHER_APP_ID'), 'options' => [ 'cluster' => env('PUSHER_APP_CLUSTER'), - 'useTLS' => true, + 'useTLS' => false, + 'encrypted' => true, + 'host' => '127.0.0.1', + 'port' => 6001, + 'scheme' => 'http' ], ], diff --git a/config/websockets.php b/config/websockets.php new file mode 100644 index 0000000..56be642 --- /dev/null +++ b/config/websockets.php @@ -0,0 +1,141 @@ + [ + 'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001), + ], + + /* + * This package comes with multi tenancy out of the box. Here you can + * configure the different apps that can use the webSockets server. + * + * Optionally you specify capacity so you can limit the maximum + * concurrent connections for a specific app. + * + * Optionally you can disable client events so clients cannot send + * messages to each other via the webSockets. + */ + 'apps' => [ + [ + 'id' => env('PUSHER_APP_ID'), + 'name' => env('APP_NAME'), + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'path' => env('PUSHER_APP_PATH'), + 'capacity' => null, + 'enable_client_messages' => true, + 'enable_statistics' => true, + ], + ], + + /* + * This class is responsible for finding the apps. The default provider + * will use the apps defined in this config file. + * + * You can create a custom provider by implementing the + * `AppProvider` interface. + */ + 'app_provider' => BeyondCode\LaravelWebSockets\Apps\ConfigAppProvider::class, + + /* + * This array contains the hosts of which you want to allow incoming requests. + * Leave this empty if you want to accept requests from all hosts. + */ + 'allowed_origins' => [ + // + ], + + /* + * The maximum request size in kilobytes that is allowed for an incoming WebSocket request. + */ + 'max_request_size_in_kb' => 250, + + /* + * This path will be used to register the necessary routes for the package. + */ + 'path' => 'laravel-websockets', + + /* + * Dashboard Routes Middleware + * + * These middleware will be assigned to every dashboard route, giving you + * the chance to add your own middleware to this list or change any of + * the existing middleware. Or, you can simply stick with this list. + */ + 'middleware' => [ + 'web', + Authorize::class, + ], + + 'statistics' => [ + /* + * This model will be used to store the statistics of the WebSocketsServer. + * The only requirement is that the model should extend + * `WebSocketsStatisticsEntry` provided by this package. + */ + 'model' => \BeyondCode\LaravelWebSockets\Statistics\Models\WebSocketsStatisticsEntry::class, + + /** + * The Statistics Logger will, by default, handle the incoming statistics, store them + * and then release them into the database on each interval defined below. + */ + 'logger' => BeyondCode\LaravelWebSockets\Statistics\Logger\HttpStatisticsLogger::class, + + /* + * Here you can specify the interval in seconds at which statistics should be logged. + */ + 'interval_in_seconds' => 60, + + /* + * When the clean-command is executed, all recorded statistics older than + * the number of days specified here will be deleted. + */ + 'delete_statistics_older_than_days' => 60, + + /* + * Use an DNS resolver to make the requests to the statistics logger + * default is to resolve everything to 127.0.0.1. + */ + 'perform_dns_lookup' => false, + ], + + /* + * Define the optional SSL context for your WebSocket connections. + * You can see all available options at: http://php.net/manual/en/context.ssl.php + */ + 'ssl' => [ + /* + * Path to local certificate file on filesystem. It must be a PEM encoded file which + * contains your certificate and private key. It can optionally contain the + * certificate chain of issuers. The private key also may be contained + * in a separate file specified by local_pk. + */ + 'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null), + + /* + * Path to local private key file on filesystem in case of separate files for + * certificate (local_cert) and private key. + */ + 'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null), + + /* + * Passphrase for your local_cert file. + */ + 'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null), + ], + + /* + * Channel Manager + * This class handles how channel persistence is handled. + * By default, persistence is stored in an array by the running webserver. + * The only requirement is that the class should implement + * `ChannelManager` interface provided by this package. + */ + 'channel_manager' => \BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager::class, +]; diff --git a/database/migrations/0000_00_00_000000_create_websockets_statistics_entries_table.php b/database/migrations/0000_00_00_000000_create_websockets_statistics_entries_table.php new file mode 100644 index 0000000..1b89b4a --- /dev/null +++ b/database/migrations/0000_00_00_000000_create_websockets_statistics_entries_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->string('app_id'); + $table->integer('peak_connection_count'); + $table->integer('websocket_message_count'); + $table->integer('api_message_count'); + $table->nullableTimestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('websockets_statistics_entries'); + } +} diff --git a/database/migrations/2021_08_20_091331_add_description_to_save.php b/database/migrations/2021_08_20_091331_add_description_to_save.php index 8b1a54a..827d092 100644 --- a/database/migrations/2021_08_20_091331_add_description_to_save.php +++ b/database/migrations/2021_08_20_091331_add_description_to_save.php @@ -14,7 +14,7 @@ class AddDescriptionToSave extends Migration public function up() { Schema::table('saves', function (Blueprint $table) { - $table->string('description')->nullable(); + $table->text('description')->nullable(); }); } diff --git a/database/seeders/SettingsSeeder.php b/database/seeders/SettingsSeeder.php index f17ba5a..3e41db0 100644 --- a/database/seeders/SettingsSeeder.php +++ b/database/seeders/SettingsSeeder.php @@ -23,6 +23,14 @@ public function run() "type" => "toggle", "extras" => null, "default" => "false" + ], + [ + "id" => 2, + "name" => "Portfolio-Analyse Quadranten", + "description" => "Es lassen sich die Beschriftung der Quadranten einstellen oder komplett ausblenden.", + "type" => "portfolio-quadrants", + "extras" => null, + "default" => '{"toggled":false,"quadrants":[{"value":"Oben Links","header":"Oben Links"},{"value":"Oben Rechts","header":"Oben Rechts"},{"value":"Unten Links","header":"Unten Links"},{"value":"Unten Rechts","header":"Unten Rechts"}]}' ] ]); } diff --git a/routes/api.php b/routes/api.php index 836f3d2..ca07486 100644 --- a/routes/api.php +++ b/routes/api.php @@ -38,39 +38,38 @@ Route::put('update-password/{token}', [PasswordController::class, 'updatePassword']); Route::group(["middleware" => ["auth:api", "activityLog"]], function () { + // API-Resources Route::apiResources([ "tools" => ToolController::class, "saves" => SaveController::class, "invitation-link" => InvitationLinkController::class, ]); - Route::apiResource('settings', SettingController::class)->only(["index", "show"]); + // Save + Route::post("/saves/{save}/broadcast", [SaveController::class, "broadcastPatches"]); + // Settings + Route::apiResource('settings', SettingController::class)->only(["index", "show"]); Route::apiResource('users.settings', UserSettingController::class); - - Route::put("/contribution/{sharedSave}/accept", [SharedSaveController::class, "accept"]); - Route::put("/contribution/{sharedSave}/decline", [SharedSaveController::class, "decline"]); // contributors Route::apiResource("contribution", SharedSaveController::class, [ "except" => ["store"] ])->parameter("contribution", "sharedSave"); - - + Route::put("/contribution/{sharedSave}/accept", [SharedSaveController::class, "accept"]); + Route::put("/contribution/{sharedSave}/decline", [SharedSaveController::class, "decline"]); Route::get("/saves/{save}/contributors", [SharedSaveController::class, "indexSave"])->name("contributions.index.save"); Route::get("/users/{user}/contributions", [SharedSaveController::class, "indexUser"])->name("contributions.index.user"); Route::post("/saves/{save}/contributors/{user}", [SharedSaveController::class, "store"])->name("contribution.store.save"); Route::post("/users/{user}/contributions/{save}", [SharedSaveController::class, "storeReverse"])->name("contribution.store.user"); - // Users - Route::get('users/{user}/saves', [\App\Http\Controllers\UserSavesController::class, 'index']); + Route::get('users/{user}/saves', [\App\Http\Controllers\UserSavesController::class, 'index']); Route::get('users/search', [UserController::class, 'searchUser']); + Route::post('/user/port', [UserController::class, 'portAnonymousUser']); Route::apiResource('users', UserController::class)->except('store'); // InvitationLink Route::get('saves/{save}/invitation-links', [InvitationLinkController::class, "saveIndex"]); Route::put('invitation-link/{token}/accept', [InvitationLinkController::class, "acceptInvite"]); - - }); diff --git a/routes/channels.php b/routes/channels.php index 28b4539..a29eac0 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -13,6 +13,8 @@ | */ -Broadcast::channel('App.Models.User.{id}', function ($user, $id) { - return (int)$user->id === (int)$id; -}); +//Broadcast::channel('App.Models.User.{id}', function ($user, $id) { +// return (int)$user->id === (int)$id; +//}); + +Broadcast::channel('savechannel.{save}', \App\Broadcasting\SaveChannel::class);