PHPackages                             kikter/discussions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. kikter/discussions

ActiveLibrary[Framework](/categories/framework)

kikter/discussions
==================

Discussions is a Simple Laravel Discussions Package

01PHP

Since May 7Pushed 3y agoCompare

[ Source](https://github.com/Temian1/laradiscussions)[ Packagist](https://packagist.org/packages/kikter/discussions)[ RSS](/packages/kikter-discussions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Foundation Discussions Package
==============================

[](#foundation-discussions-package)

> Warning: This package is still in development and is not ready for use.

Installation
------------

[](#installation)

This package assumes that you have created a [new Laravel application](https://laravel.com/docs/#your-first-laravel-project) and included the [TALL Stack preset](https://github.com/laravel-frontend-presets/tall) in your application.

In this package we also make use of the [Filament Notifications package](https://filamentphp.com/docs/notifications/installation), which is used to show alert notifications.

[![Notification Animated GIF](/assets/img/notifications.gif)](/assets/img/notifications.gif)

To [install this package](https://filamentphp.com/docs/notifications/installation): we can do the following:

In the root directory of your app, run:

```
npm install alpinejs @awcodes/alpine-floating-ui postcss tailwindcss --save-dev

```

Then add to your main `app.js`

```
import AlpineFloatingUI from '@awcodes/alpine-floating-ui'
import NotificationsAlpinePlugin from '../../vendor/filament/notifications/dist/module.esm'

Alpine.plugin(AlpineFloatingUI)
Alpine.plugin(NotificationsAlpinePlugin)

```

Add the filament `'./vendor/filament/**/*.blade.php'` folder to your tailwind asset watcher under `content`:

> Additionally, extend some new colors in your tailwind.config.js theme 🎨

```
const colors = require('tailwindcss/colors')

module.exports = {
    content: [
        './resources/**/*.blade.php',
        './vendor/filament/**/*.blade.php',
    ],
    theme: {
        extend: {
            colors: {
                danger: colors.rose,
                primary: colors.blue,
                success: colors.green,
                warning: colors.yellow,
            },
        },
    },
}

```

Finally, add the following before the `` tag in your `app.blade.php` file:

```
@livewire('notifications')

```

That's it. You're ready to start using the discussions package.

Events
------

[](#events)

The events are useful when you want to perform additional actions or trigger custom logic based on the creation of a new discussion or post like sending an email notification to the discussion participants.

EventDescription`Foundationapp\Discussions\Events\NewDiscussionCreated`Dispatched when a new discussion is created.`Foundationapp\Discussions\Events\NewDiscussionPostCreated`Dispatched when a new discussion post is created.#### Events Usage

[](#events-usage)

The `event(new NewDiscussionCreated($discussion));` is dispatched after a new discussion is created. You can listen for this event in your application and perform any custom logic as needed. The same applies to the `NewDiscussionPostCreated` event which is dispatched after a new discussion post is created.

#### Creating a Listener for the `NewDiscussionCreated` Event

[](#creating-a-listener-for-the-newdiscussioncreated-event)

To create a listener to handle the `NewDiscussionCreated` event, follow these steps:

1. Create a Listener class Create a new class for your listener in the appropriate directory (e.g., `app/Listeners`). The class should implement the handle() method, which will receive the `NewDiscussionCreated` event as a parameter.

    ```
