Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to Laravel 10 ,update stun and Laravel echo configuration #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Controllers/VideoChatController.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function callUser(Request $request)
$data['signalData'] = $request->signal_data;
$data['from'] = Auth::id();
$data['type'] = 'incomingCall';

broadcast(new StartVideoChat($data))->toOthers();
}
public function acceptCall(Request $request)
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Kernel extends HttpKernel
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
Expand Down
9 changes: 7 additions & 2 deletions app/Http/Middleware/TrustProxies.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Middleware;

use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;

class TrustProxies extends Middleware
Expand All @@ -19,5 +19,10 @@ class TrustProxies extends Middleware
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}
29 changes: 28 additions & 1 deletion app/Models/User.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class User extends Authenticatable
];


public function getAvatarUrlAttribute()
/*public function getAvatarUrlAttribute()
{

$exists = Storage::disk('s3')->exists($this->avatar_path);
Expand All @@ -65,4 +65,31 @@ public function getAvatarUrlAttribute()
}
return null;
}
*/

public function getAvatarUrlAttribute()
{
// Use the md5 hash of the user's email address to generate a Gravatar URL
$emailHash = md5(strtolower(trim($this->attributes['email'])));

// Gravatar URL format
$gravatarUrl = "https://www.gravatar.com/avatar/{$emailHash}?s=200";

return $gravatarUrl;
}

protected static function boot()

{
parent::boot();

// Add an event listener to the 'created' event
static::created(function ($user) {
// Set the avatar url when the user is created
$user->avatar_path = $user->getAvatarUrlAttribute();
$user->save();
});
}


}
23 changes: 12 additions & 11 deletions composer.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,24 @@
],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"php": "^8.1",
"beyondcode/laravel-websockets": "^1.14",
"doctrine/dbal": "^3.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.12",
"laravel/sanctum": "^2.8",
"laravel/framework": "^10.0",
"laravel/passport": "^11.0",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.0",
"league/flysystem-aws-s3-v3": "~1.0",
"pusher/pusher-php-server": "~4.0"
"laravel/ui": "^4.0",
"league/flysystem-aws-s3-v3": "^3.0",
"pusher/pusher-php-server": "^7.0"
},
"require-dev": {
"facade/ignition": "^2.5",
"spatie/laravel-ignition": "^2.0",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.0"
},
"config": {
"optimize-autoloader": true,
Expand Down
Loading