Refactor chat functionality: remove ChatController, enhance MessageSent event with broadcasting capabilities, and update Conversation and Message models for improved relationships. Update API routes for chat operations and adjust CORS settings for broadcasting authentication.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Chat\Conversation;
|
||||
use App\Models\Concerns\HasEcommerceChannels;
|
||||
use App\Models\Concerns\HasSchemalessAttributes;
|
||||
use App\Models\Concerns\InteractsWithNova;
|
||||
@@ -15,6 +16,7 @@ use App\Models\System\Settings\Location\UserAddress;
|
||||
use App\Repositories\System\Cache\CacheRepository;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
@@ -112,6 +114,14 @@ class User extends Authenticatable
|
||||
return $this->hasMany(UserAddress::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Chat conversations
|
||||
*/
|
||||
public function conversations(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Conversation::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* User's carts
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user