Laravel Forum

Overview

No taking care of this package anymore.

Socieboy Forum

Package for Laravel 5.2

Total Downloads Latest Stable Version Latest Unstable Version License

Features

  • Create conversations.
  • Reply existing conversations.
  • Support for gravatar and custom avatars.
  • Fire email to the conversation owner when some user left a reply.
  • Broadcast notifications to the conversation owner when someone left a reply.
  • Include LESS files.

Installation

1.- Add to composer.json file the package

"socieboy/forum" : "2.0.*"

2.- After installing this package, you have to set the service provider on your config/app.php file

Socieboy\Forum\Providers\ForumServiceProvider::class,

3.- Publish the forum config file on your config folder and publish the default template to your resources/assets/less/ folder, hit the follow command.

php artisan vendor:publish

4.- Create migrations for the forum, make sure you have a migration already created for users. (Before to do this step, you may want to add a prefix to your forum database tables, see the config file)

php artisan forum:migrate

This command will create the migration files, for conversations, replies, and like_replies. Then just execute your migration:

php artisan migrate

Configuration

General

The forum provides a simple custom template, this is published on the resources/assets directory, feel free to edit.

On the config/forum.php file, set the right information of your app.

Template

This is the master template view of your project:

'template'  => 'app',

The key content is the name of your yield tag on your master template file where you would like to display the forum:

'content'   => 'content',

With those values the forum can be adapted to your project really easily and match your application design.

Topics

Define the array of topics for your forum. Now you can define the key for the topic, give a name and the representative icon for the topic, you can use any font class of your preference here. Also you can set the representative color for this topic in the las parameter (color is optional).

'topics' => [
    'general' => [
        'name' => 'General',
        'icon' => 'fa fa-tags',
        'color' => 'rgb(78, 137, 218)'
    ]
],

Database

Customize your own prefix for the forum database tables.

'database' => [
    'prefix' => 'forum'
],

User settings

The user configuration with the forum includes.

The model key, set the namespace + class name of your users model. By default is App\User as Laravel uses.

'model' => \App\User::class,

The username key is the field on your users table that would be used to display the name of the user who post a conversation/reply. You can set any field like email, username, full_name, name, etc, (Must be a field on your users table).

'username' => 'name',

Do you have avatars for the users on your project? (Set the key avatar to true if you want to use avatars).

'avatar' => true,

If you prefer to use gravatar for your avatars set the key gravatar to true.

'gravatar' => true,

If you want to use your own avatars, then define the field on your users table where the url to the image (avatar) is stored.

'user-avatar' => 'avatar',

Include link to profile users.

'profile' => true,

By default the forum include a simple user profile. If you want to implement your own just set the route name on this key, the route should receive one parameter as slug.

'profile-route' => 'forum.user.profile'

Specify the column of the users table that will be used as slug, by default the forum use the user id.

'profile-slug' => 'id',

Now if the user is not log in, the button for start a conversation will redirect the user to your login page, just set the url of your login page in this key.

'auth' => [
    'login-url' => 'auth/login'
],

If you want you can change the icons to do like and choose the best answer on replies.

'icons' => [
    'tags'              => 'glyphicon glyphicon-tags',
    'like'              => 'glyphicon glyphicon-thumbs-up',
    'correct-answer'    => 'glyphicon glyphicon-ok',
    'edit'              => 'glyphicon glyphicon-pencil',
    'delete'            => 'glyphicon glyphicon-trash'
    'home'              => 'glyphicon glyphicon-home',
],

Emails

On the array emails are 4 different values.

The key fire is set by the default false, no email would be fired when someone left a reply. Change to true if you want to implement fire emails to the conversation owner when some user left a reply.

'fire' => false,

The from key is the email of the admin of your app or whatever account that would be used to send the emails.

'from' => '',

The from-name key is the real name of the administrator of the forum or who is going to send the emails.

'from-name' => '',

Finally just set the subject for the emails fired.

'subject' => 'My app Forum - you have a new reply on your post',

Events

When some user left a reply on the conversation, starts a new conversation or marks a reply as the best answer, an event will fire and broadcast depending on your settings..

The key fire is set by the default true. As long as it is true, an event will be fired for new replies, new conversations and choosing a best answer.

'fire' => true,

Set the key broadcast to true on the forum config file and also add your Pusher keys to the broadcasting config file of Laravel. Once set to true, the events will also send out broadcasts that you can pick up. https://pusher.com/

'broadcast' => false,

Also on the bottom of you app or where your scripts section is located add this code.

@include('Forum::Broadcasting.index');

Now that's it, easy and you are ready to go!

Translations

  • English
  • Spanish
  • Danish
  • French
  • Arabic

If you want to contribute in this package with your native language copy the folder src/Lang/en/ translate all keys to your language and send a pull request.

Comments
  • undefined method during vendor publish

    undefined method during vendor publish

    Hey, am receiving this error when trying to publish the package

    Call to undefined method Illuminate\Foundation\Application::bindShared()

    I think it changes to app->singleton or something like that. How can we make this work?

    opened by z1haze 19
  • Some updates

    Some updates

    Before I start, I want to make it clear, I will be willing to add these and do a PR, but want to make sure you're on board first.

    • new events
      • trigger events on conversation start and on best answer selection
    • allow editing of existing posts/replies
    • order comments from oldest to newest.

    Also, not sure why the text for conversations and replies are links that dont actually point to an anchor tag. Same is true for the reply textarea. So it keeps forcing the page to the top for no reason.

    opened by stygiansabyss 16
  • Start Conversation

    Start Conversation

    I'am getting error when I run queue:listen after creation of new conversation.

    [InvalidArgumentException] No handler registered for command [Socieboy\Forum\Jobs\Conversations\StartConversation]

    opened by sugunak 3
  • Import Illuminate Controller instead of App namespaced Controller

    Import Illuminate Controller instead of App namespaced Controller

    This is my first time making a pull request, so sorry if I’m not doing it right or on the right branch.

    You’re importing \App\Http\Controllers\Controller, which won’t work if the user has their application namespace set to something else like I do. Importing the Illuminate base controller fixes this.

    opened by kylewardnz 3
  • Feat db prefix

    Feat db prefix

    First of all: I really appreciate you putting this package out here in the open source world. So big thumbs up.

    Now, I've might have gone a little overboard with this PR. Basicly I wanted to add the ability to use a prefix for database table names. Instead of having replies floating around in your database, you will now have the ability to prefix it from the configuration file with fx. "forum", so it will be named forum_replies.

    I started adding the functionality and sort of cleaned up some of the code. There was some inconsistency in terms of indentation etc, so I ended up cleaning all of the code. Some changes might be because of my OCD. Sorry.

    I thought I would create this PR so you could give me a response. Changes of this size would maybe be better just to create my own package, but since I'm still using 99% of your work, yeah ..

    Changes made:

    • Syntastic sugar (PSR-2 and stuff)
    • Added a BaseModel to add the database table prefix to the $table property. The entities will extend upon the BaseModel instead of the Model from Eloquent.
    • Edited files where the table name where hardcoded to instead read from config (forum.database.prefix)
    opened by ThomasBS 3
  • PostReply issue

    PostReply issue

    FatalErrorException in PostReply.php line 14: Class 'Socieboy\Forum\Jobs\Replies\Job' not found

    I use this class: // use Illuminate \ Queue \ Jobs \ Job; but also still it has problems..

    opened by gealberto 3
  • Replies

    Replies

    Hi, firstly, this looks amazing, and just what I need to drop into the Laravel site I'm working on. Only a minor request, I wonder if str_plural could be used on the "replies" count, for the correct "reply" if a post has one reply.

    opened by lethality 2
  • Issue

    Issue

    Hello, already upgrade to laravel 5.1, but I have the following error when I try to show the forum

    ErrorException in FileViewFinder.php line 137: View [app] not found. (View: C:\xampp\htdocs\foro\vendor\socieboy\forum\src\Views\index.blade.php)

    in FileViewFinder.php line 137 at CompilerEngine->handleViewException(object(InvalidArgumentException), '1') in PhpEngine.php line 42 at PhpEngine->evaluatePath('C:\xampp\htdocs\foro\storage\framework\views/1e19bd29b00ae667849c827162a76c57', array('__env' => object(Factory), 'app' => object(Application), 'template' => 'app', 'content' => 'content', 'errors' => object(ViewErrorBag), 'conversations' => object(LengthAwarePaginator))) in CompilerEngine.php line 58 at CompilerEngine->get('C:\xampp\htdocs\foro\vendor\socieboy\forum\src\Providers/../Views/index.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'template' => 'app', 'content' => 'content', 'errors' => object(ViewErrorBag), 'conversations' => object(LengthAwarePaginator))) in View.php line 137 at View->getContents() in View.php line 106 at View->renderContents() in View.php line 80

    opened by gealberto 2
  • Edit Reply not working

    Edit Reply not working

    Hey guys... i'm new to laravel...When you try to edit a reply, in the edit modal it shows you the message of the first reply in that conversation and when you try to edit that...it actually posts but update doesn't go to the intended This happens for every reply in a particular conversation.You can try to edit any reply and it will only view and edit the first reply on the thread. i tried to use socieboy.com but the same problem is also there

    Please help out

    opened by theInscriber 1
  • Login and Styles not working

    Login and Styles not working

    I am using custom package to handle laravel authentication for users by intrip, how can i make this work with this package? Also the styles are not working

    opened by gamingumar 1
  • More events?

    More events?

    Is it possible to add an event when a conversation is created and one for when a reply is marked as the correct answer? I would like to plug some listeners into these events to send an update to slack. Thanks!

    opened by stygiansabyss 1
Releases(2.0.2)
Owner
Frank Sepulveda
Software developer, Laravel, PHP, VueJS
Frank Sepulveda
A slim, lean forum package designed for quick and easy integration in Laravel projects

Complete documentation is available on teamteatime.net. Installation Requires Laravel 6+ and PHP 7.4+. Step 1: Install the package Install the package

TeamTeaTime 486 Dec 31, 2022
A forum created with Laravel, Socket.io, and Tailwind CSS.

A forum created with Laravel, Socket.io, and Tailwind CSS.

Steven Lei 164 Nov 21, 2022
PHPHub is a Forum project written in Laravel

PHPHub is a Forum project written in Laravel

Summer 1.8k Dec 26, 2022
This is a Laravel based Blog post forum.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Hossain Mohammad Shahidullah Jaber 4 Nov 17, 2022
Forum Diskusi Mahasiswa Informatika Berbasis Web menggunakan Framework Laravel & Bootstrap

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Aliffathur Risqi Hidayat 2 Oct 6, 2022
A discussion forum for coders

CodeQuery CodeQuery CODE WANTS TO BE SIMPLE is the place to find help with your coding and programming queries. Steps To Configurate Project Clone thi

Aman Sharma 1 Nov 3, 2021
Discussion (forum) and Q&A platform. Community based on PHP Micro-Framework HLEB.

Agouti Discussion (forum) and Q&A platform. Community based on PHP Micro-Framework HLEB. Ideas We like the classification system based on labels (tags

AgoutiDev 59 Dec 22, 2022
ECNU Forum based on Flarum.

ECNU Forum ECNU Forum based on Flarum. Welcome to ECNU Forum, where every ECNU student can speak freely. Note that this is not an official forum of EC

null 54 Dec 13, 2022
Laravel-Blog is a blog application written in Laravel 4.2.

创造不息,交付不止 Introduction Laravel-Blog is a blog project written in Laravel 4.2. Screenshots Article List Page Article composing page Single post page Ad

Summer 192 Dec 15, 2022
Projeto Web Site do Curso Laravel Developer utilizando o Framework PHP Laravel

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Pedro Leandro 1 Oct 22, 2021
A simple helpdesk tickets system for Laravel 5.1+ which integrates smoothly with Laravel default users and auth system

A simple helpdesk tickets system for Laravel 5.1+ which integrates smoothly with Laravel default users and auth system, demo is available at: http://ticketit.kordy.info/tickets

Ahmed Kordy 857 Dec 30, 2022
mini Project in Laravel and vue js. Real World Laravel 8x + vue js Dashboard.Task management and project management system

mini Project in Laravel and vue js. Real World Laravel 8x + vue js Dashboard.Task management and project management system. Dashboard features such as: Complete Dashboard, Custom Authentication, Email Verification, custom-login-register-forgot password (without jetstream).

Hasmukh Dharajiya 2 Sep 20, 2022
A powerful open source Laravel Blog with WYSWYG and CRUD (Create Read Update Delete) built on Laravel 5.8 and Bootstrap 4

Larablog A powerful open source Laravel Blog with WYSWYG and CRUD (Create Read Update Delete) built on Laravel 5.8 and Bootstrap 4 Table of contents F

Jeremy Kenedy 144 Oct 11, 2022
Laravel Angular Time Tracker is a simple time tracking application built on Laravel 5.2, Angular 2, and Bootstrap 3.

Laravel 5.2, Angular 2, and Bootstrap 3.3.* Time Tracker Laravel Angular Time Tracker is a simple time tracking application built on Laravel 5.2, Angu

Jeremy Kenedy 25 Oct 11, 2022
Mini is a small Laravel application with 2 modules to go with the book Laravel: The Modular Way

Mini Mini is a small Laravel application with 2 modules to go with the book Laravel: The Modular Way Install Clone this repo git clone [email protected]:

David Carr 5 Dec 4, 2022
Voyager - The Missing Laravel Admin

Voyager - The Missing Laravel Admin Made with ❤️ by The Control Group Website & Documentation: https://voyager.devdojo.com/ Video Tutorial Here: https

The Control Group 11.3k Dec 31, 2022
A platform to create documentation/wiki content built with PHP & Laravel

BookStack A platform for storing and organising information and documentation. Details for BookStack can be found on the official website at https://w

BookStackApp 10.6k Jan 3, 2023
Koel is a simple web-based personal audio streaming service written in Vue and Laravel

Koel (also stylized as koel, with a lowercase k) is a simple web-based personal audio streaming service written in Vue on the client side and Laravel on the server side. Targeting web developers, Koel embraces some of the more modern web technologies – CSS grid, audio, and drag-and-drop API to name a few – to do its job.

Koel 14.3k Jan 4, 2023
Krayin CRM is a hand tailored CRM framework built on Laravel and Vue.js

Krayin CRM is a hand tailored CRM framework built on some of the hottest opensource technologies such as Laravel (a PHP framework) and Vue.js a progressive Javascript framework.

Krayin CRM 1.1k Jan 3, 2023