condoedge / discussions
Channels, discussions and chat components for Kompo applications
Requires
- php: ^8.1
- condoedge/utils: ^0.2.0
- kompo/auth: *
- kompo/kompo: *
- laravel/framework: >=5.6.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v0.0.31
- v0.0.30
- v0.0.29
- v0.0.28
- v0.0.27
- v0.0.26
- v0.0.25
- v0.0.24
- v0.0.23
- v0.0.22
- v0.0.21
- v0.0.20
- v0.0.19
- v0.0.18
- v0.0.17
- v0.0.16
- v0.0.15
- v0.0.14
- v0.0.13
- v0.0.12
- v0.0.11
- v0.0.10
- v0.0.8
- v0.0.7
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-feature/discussion-details-mobile
- dev-feature/sisc-2-redesign
- dev-Refactor-mobile-friendly
- dev-dev
- dev-dstg/traduction
This package is auto-updated.
Last update: 2026-09-04 18:17:16 UTC
README
Channels, discussions and chat components for Kompo applications.
What it provides
- Models:
Channel,Discussion(self-referencing for replies/subjects),DiscussionRead(read receipts),DiscussionBox(archive/trash per user),Member(channel membership pivot). - Komponents:
ChannelsView(3-column chat page),ChannelsList/ChannelsListTeam,ChannelSubjectsList,ChannelDiscussionsPanel,DiscussionForm,SingleDiscussionCard,ProjectDiscussionThread,ChannelSettingsForm. - Policies:
ChannelPolicy/DiscussionPolicy, registered automatically (membership-based). - Broadcasting: a
DiscussionSentevent broadcast on the private channeldiscussion.{teamId}; the channel authorization callback is registered by the package's service provider.
Installation
composer require condoedge/discussions
The service provider is auto-discovered. Migrations load automatically (php artisan migrate).
Route registration
The package does not auto-register routes. Call the static registrars from your app's route files, inside your auth middleware group:
Route::middleware(['auth'])->group(function () { \Kompo\Discussions\Services\DiscussionsService::setAllRoutes(); // discussions pages \Kompo\Discussions\Services\DiscussionsService::setAllModalRoutes(); // channel-settings modal });
Live refresh (Pusher)
The chat lists refresh live through Laravel broadcasting. The host app must have broadcasting enabled:
- Enable
App\Providers\BroadcastServiceProviderinconfig/app.php(registers/broadcasting/auth). - Set
BROADCAST_DRIVER=pusherand thePUSHER_*/MIX_PUSHER_*env values. composer require pusher/pusher-php-server.- Make sure the front-end bundle initializes Echo (kompo's
withBroadcasting()).
The package takes care of the rest: the discussion.{teamId} channel authorization (team membership) and the event-name wiring between DiscussionSent::broadcastAs() and the komponents' pusherRefresh.
Styling
Import the package stylesheet in your app's scss:
@import "../../vendor/condoedge/discussions/resources/scss/discussions";
The chat page (.discussions-page) sizes itself to the area below your app's navbar; no fixed viewport heights are used.
Host integration points
- Listen to
Kompo\Discussions\Events\DiscussionSent(exposesgetDiscussion()) for notifications. - Override the team users available in a channel by defining
getAvailableUsersForChannel($channel, $search)on your Team model. - Translations are flat JSON keys (
discussions.*) for theenandfrlocales; app-level JSON translations override them.