https://github.com/andreaselia/laravel-firefly
Firefly is a simple forum package for Laravel, created for ease of use and expansion.
https://github.com/andreaselia/laravel-firefly
discussion forum laravel laravel-forum
Last synced: over 1 year ago
JSON representation
Firefly is a simple forum package for Laravel, created for ease of use and expansion.
- Host: GitHub
- URL: https://github.com/andreaselia/laravel-firefly
- Owner: andreaselia
- License: mit
- Created: 2018-09-22T19:17:32.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-28T19:13:44.000Z (over 3 years ago)
- Last Synced: 2024-10-13T11:24:17.231Z (almost 2 years ago)
- Topics: discussion, forum, laravel, laravel-forum
- Language: PHP
- Homepage:
- Size: 2.35 MB
- Stars: 24
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://packagist.org/packages/AndreasElia/laravel-firefly)
[](https://packagist.org/packages/AndreasElia/laravel-firefly)
[](https://packagist.org/packages/AndreasElia/laravel-firefly)
[](https://github.styleci.io/repos/149909240?branch=master)

# Laravel Firefly
Firefly is a simple forum package for Laravel, created for ease of use and expansion.
The package ships with a frontend included, but by publishing the packages assets you have the flexibility to customize the available templates and make them match your current applications templates, should you so desire.
## Installation
Install the package:
```bash
composer require andreaselia/laravel-firefly
```
Publish package files (config, migrations, assets and views):
```bash
php artisan vendor:publish --provider="Firefly\FireflyServiceProvider"
```
Run the migrations:
```bash
php artisan migrate
```
Add the FireflyUser trait to your User model:
```php
[
'watchers' => true,
// ...
],
```
This will allow watchers to be notified when new posts are made in the discussion
### WYSIWYG Editor
The WYSIWYG Editor uses the Quill library, and the docs can be found [here](https://quilljs.com/docs).
You can enable a WYSIWYG editor by adding/updating the flag in the config like so:
```php
'features' => [
// ...
'wysiwyg' => [
'enabled' => true,
'theme' => 'snow', // More about themes at https://quilljs.com/docs/themes/
'toolbar_options' => [ // Docs at https://quilljs.com/docs/modules/toolbar/
['bold', 'italic', 'underline', 'strike'],
[['list' => 'ordered'], ['list'=> 'bullet']],
['clean'],
],
],
// ...
],
```
The snow theme and basic editing controls are provided out of the box in the config, but these can be modified to fit your needs.
### Correct Posts
You can enable the ability to mark a post as "correct" indicating that it answers the question or is a promoted post. Correct posts are promoted to the top, directly under the initial post.
**Note:** If you are enabling this on an existing install, you should make sure to run database migrations and then run the `posts:set-initial-flag` command, to bring your database up to date. This also introduces two new policies, `mark` and `unmark`.
```php
'features' => [
'correct_posts' => true,
// ...
],
```
### Reactions
Enabling reactions allows users to react to posts with emojis. This work similarly to Discord, Slack and other popluar messaging systems. Clicking a reaction will add it to the post. Clicking the same one again will remove it.
If you are running an older version or older charset in mySQL or using another database that does not handle native emojis correctly, enabling the `convert` flag will convert the emojis to and from html entities so they are stored correctly on the back-end. If you are using`utf8mb4` charsets or newer, this is not needed.
**Note:** If you are enabling this on an existing install, you should make sure to run database migrations. This also introduces a new policy `react`.
```php
'features' => [
'reactions' => [
'enabled' => true,
'convert' => true
]
// ...
],
```
## Policies
By default, Firefly policies are very permissive. In order to customize the permissions for your own application, please use your `AuthServiceProvider` file to overwrite the policies by following the steps below.
1. Create your policy files via `php artisan make:policy MyGroupPolicy`
2. In the generated class, extend the base Firefly policy:
```php
'App\Policies\MyGroupPolicy',
];
```
Learn more about Laravel policies [here](https://laravel.com/docs/8.x/authorization#registering-policies).
## Contributing
You're more than welcome to submit a pull request, or if you're not feeling up to it - create an issue so someone else can pick it up.