A slim, lean forum package designed for quick and easy integration in Laravel projects

Overview

Tests phpcs StyleCI Packagist Downloads Packagist License

Laravel Forum Logo

Complete documentation is available on teamteatime.net.

Installation

Requires Laravel 6+ and PHP 7.4+.

Step 1: Install the package

Install the package via composer:

composer require riari/laravel-forum:~5.0

Package Discovery should take care of registering the service provider automatically, but if you need to do so manually, add the service provider to your config/app.php:

TeamTeaTime\Forum\ForumServiceProvider::class,

Step 2: Publish the package files

Run the vendor:publish command to publish the package config, translations and migrations to your app's directories:

php artisan vendor:publish

Step 3: Update your database

Run your migrations:

php artisan migrate

Additional steps

Configuration

Several configuration files are published to your application's config directory, each prefixed with forum.. Refer to these for a variety of options for changing the behaviour of the forum and how it integrates with key parts of your application code.

You may need to modify the forum.integration.user_name config option according to your user model. This specifies which attribute on the user model should be used as a display name in the forum views.

Translations

Laravel Forum currently supports 13 languages: German, English, Spanish, French, Italian, Dutch, Romanian, Russian, Thai, Turkish, Serbian, Portuguese (Brazil) and Swedish. The translation files are published to resources/lang/vendor/forum/{locale}. Some new language strings have been introduced in 5.0 but not yet translated; PRs to translate these would be greatly appreciated.

Development

If you wish to contribute, an easy way to set up the package for local development is Team-Tea-Time/laravel-studio, which is set up to load a local working copy of this repository (see the readme for usage details).

Running tests

Bring up the MySQL service:

docker-compose up -d mysql

Install Composer dependencies:

docker-compose run --rm composer install

Run the phpunit container to execute tests:

docker-compose run --rm phpunit

Seeding

The DB can be seeded with sample categories, threads, posts, and a user via ForumSeeder:

docker-compose exec php-fpm php artisan db:seed --class=TeamTeaTime\\Forum\\Database\\Seeds\\ForumSeeder
Comments
  • Massive query count on forum index

    Massive query count on forum index

    I'm just getting to grips with the codebase at the moment, and have written a set of importers to import our current forum from phpBB.

    We have about 2000 threads and 20,000 posts - I have successfully imported our users separately, and then populated forum_categories, forum_threads and forum_posts and everything appears to be working the only issue at the moment is the massive number of queries that occurs on the forum index.

    I am currently getting 4082 queries on forum index, which is 9 categories (under 3 title categories) - which seems way too much.

    Taking a look at laravel debugbar I am seeing this - http://i.imgur.com/SCw1DSa.png

    It repeats alternating between querying users and forum_posts for the majority of the 4000 queries.

    So, two questions I suppose;

    • Is there another table I should be populating with additional information? I thought perhaps threads read might be the issue, perhaps?
    • Any ideas what else could be causing this? Have you tested the forums with a large amount of threads and posts?

    Cheers

    opened by unbolt 30
  • How to re-doing category links to subdomain form?

    How to re-doing category links to subdomain form?

    Hi! Now category format in url represent as like "https://forum.site/category/thread/post". How use subdomains with names equal category, like "https://category.forum.site/thread/post" for all content? I see you have a complex routing system, I would like to use something like:

    Route::group(['domain' => '{subdomain}.forum.site'], function () {

    in router file like /vendor/riari/laravel-forum/routes.php

    Also, how publish it to it not changing if I update package?

    type: question 
    opened by NDanilov2015 20
  • Array to String Conversion Error Present via PHP 7

    Array to String Conversion Error Present via PHP 7

    this is what i currently see when upgrading to PHP7 Image

    Specifically it has to deal with this line:

    $this->collections[$model] = $this->$map_model_repos[$model]->getByID($id, $with);
    

    would you have any idea on how to fix this?

    opened by Teranode 15
  • Invalid argument supplied for foreach() (View: /var/www/html/resources/views/vendor/forum/category/index.blade.php)

    Invalid argument supplied for foreach() (View: /var/www/html/resources/views/vendor/forum/category/index.blade.php)

    i followed bellow instructions

    1.composer require riari/laravel-forum:~3.0

    2.Then add the service provider to your config/app.php: Riari\Forum\ForumServiceProvider::class,

    3.composer require riari/laravel-forum-frontend:~1.0 Riari\Forum\Frontend\ForumFrontendServiceProvider::class,

    4.php artisan vendor:publish

    5.php artisan migrate

    6.then click on mydomaiin.com/forum

    i got a this error

    Invalid argument supplied for foreach() (View: /var/www/html/resources/views/vendor/forum/category/index.blade.php)

    in Category_controller you guys are mention columns name 'category_id ' but in db table only 'id ' column there .any reason for that ?

    opened by LakshmanKatragadda 14
  • [Feature] Thread moving & title editing

    [Feature] Thread moving & title editing

    Can you add the ability to move threads to different categories and Edit thread titles cause sometimes someone makes a mistake and there isnt a way to edit the title besides the db)

    opened by Teranode 13
  • 404 | NOT FOUND

    404 | NOT FOUND

    Hello Rick.

    The short story: I'm having issues with your system when integrated with Wave SAAS (https://github.com/thedevdojo/wave). Would you be able to help?

    A bit more info: Devdojo is kindly working with me quite some time after I integrated laravel-forum. But it's getting kind of difficult now since seems that any possible solution might be done at laravel-forum. Here is the post related to this issue: https://devdojo.com/question/404-not-found

    Would you be able to do the same effort? I mean, install their software and then your package. If you kindly be able to do so, then here is my installation process:

    1. Install Wave SAAS
    • https://wave.devdojo.com/docs/installation
    • If you get redis error, try composer update --ignore-platform-req=ext-redis
    • If you get migration error copy the below code at config/database php, Ln: 60 (mysql engine) --> 'engine' => 'InnoDB ROW_FORMAT=DYNAMIC',
    1. Proof that Wave Blog works before laravel-forum.
    • Visit: Wave Blog link, click any article. You should be able to read any article. Meaning, that there no error.
    1. Install laravel-forum 5.0 --> You might want to ignore redis if you had trouble before. --> composer require riari/laravel-forum:~5.0 --ignore-platform-req=ext-redis

    2. Re-visit Wave Blog Page and click any article. You should get an 404 | NOT FOUND error.

    Thank you in advance

    opened by CyberEkklesiaOwner 11
  • added support for paging via API methods

    added support for paging via API methods

    Hi, I’ve noticed that paging doesn’t work on API methods (not implemented). I’ve added support to enable paging on the API calls (thread, categories, posts). Only category list is not perfect - there is a filter which removes private categories after the query is done. The paginate will return data, but the total count is not accurate (based on the private settings).

    We can disable paging for categories by setting 0.

    To enable paging set true in the config: forum.preferences.pagination.enabled

    opened by pionl 11
  • How to add forum routes to 'web' route groups to avoid errors

    How to add forum routes to 'web' route groups to avoid errors

    i have succeeded in integrating laravel and forum but one thing is left, the web guard middleware enbles session in laravel 5.2, so when i run /forum i get this errors:

    ErrorException in 6829460faf86e4b23bc8a19c8baa92dc4b035c9e.php line 7: Undefined variable: errors (View: C:\wamp\www\agron\resources\views\vendor\forum\partials\alerts.blade.php) (View: C:\wamp\www\agron\resources\views\vendor\forum\partials\alerts.blade.php) (View: C:\wamp\www\agron\resources\views\vendor\forum\partials\alerts.blade.php)

    opened by jerryOkafor 11
  • Can't get the permission working

    Can't get the permission working

    Hello, thanks for the amazing work!

    I've finally managed to get it working, but there's one problem that I can't seem to solve after reading documents and articles online, which is to use policy to permit certain action.

    What I wanna do is just like the demo, different user has their own permission, however no matter how I configure the code it's always allowed any users to do something only the admin should be able to do.

    I have been searching for the policy code, but can't find it, I was wondering if you could help~

    opened by Edan0615 10
  • Need help overriding Controllers

    Need help overriding Controllers

    I'm trying to override the create and store method in the Thread Controller. I extended it, and made a create method, but it doesn't work. The reason for this is because i disabled the integrated permissions and would like to use my own and the one you have is directly in the controller file.

    opened by Teranode 10
  • Missing required parameter for [Route: forum.thread.show]

    Missing required parameter for [Route: forum.thread.show]

    Missing required parameter for [Route: forum.thread.show] [URI: forum/t/{thread}-{thread_slug}] [Missing parameter: thread_slug].

    Hello, it's me again it's kinda werid that it works fine on my localhost, but when I uploaded it onto my server and when I tried to test it, I accidently leave content as blank, and it gave me the above message.

    and when I am typing this here, I figure I might as well just delete the post from the DB, and when I went in there I found five or six same posts, and when delete them it's back and works fine.

    I was wondering if this could cause any problem since user tend to make this kind of mistake.

    opened by Edan0615 9
  • Accepted post

    Accepted post

    The package should support an optional 'accepted post' feature, whereby a post can be marked as accepted by a user who has permission (by default, the thread author) to do so. This can be useful for Q&A categories, but could have other use cases.

    type: feature 
    opened by Riari 0
  • Feature flags

    Feature flags

    The package should support optional feeatures via a feature flagging system. Initially, the API and web routes could be enabled/disabled via this system.

    type: feature 
    opened by Riari 0
  • Content read/write pipelines

    Content read/write pipelines

    The package should have configurable and overridable pipelines for transforming post content before it's written to or after it's read from the database. This will make integration of WYSIWYGs much easier.

    By default, it should provide a pipeline for Markdown support.

    More details in https://github.com/Team-Tea-Time/laravel-forum/issues/275.

    type: feature 
    opened by Riari 0
  • UI Presets

    UI Presets

    The package should be able to provide multiple presets, similar to how Laravel UI works. Initially, it should support Bootstrap and Tailwind presets.

    • It should support UIs that consume the API using Vue (either as an SPA or using Inertia, or possibly both).
    • It should retain the option to publish a specific UI to the application directory for easier overriding.
    • It will require changes to config to support more than one UI, as well as UIs that use the API routes instead of web routes.
    type: feature 
    opened by Riari 0
Releases(5.4.2)
  • 5.4.2(Nov 27, 2022)

    • Fix undefined variable error in Web/PostController (7491dac970ffdc65edaa56ea47869adfaed7dc0d)
    • Fix null post in Web/PostController (347acb61647b6b97ef4b9e46d2586b3311d923ca)

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.4.1...5.4.2

    Source code(tar.gz)
    Source code(zip)
  • 5.4.1(Nov 19, 2022)

  • 5.4.0(Nov 13, 2022)

    What's Changed

    • Allow custom resource classes by @puzzledmonkey in https://github.com/Team-Tea-Time/laravel-forum/pull/331

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.3.8...5.4.0

    Source code(tar.gz)
    Source code(zip)
  • 5.3.8(Nov 2, 2022)

    What's Changed

    • Add support for auth_middleware to API to match web functionality by @puzzledmonkey in https://github.com/Team-Tea-Time/laravel-forum/pull/328

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.3.7...5.3.8

    Source code(tar.gz)
    Source code(zip)
  • 5.3.7(Oct 24, 2022)

    What's Changed

    • API routing fixes and return type fixes for PHP 8.1 by @puzzledmonkey in https://github.com/Team-Tea-Time/laravel-forum/pull/326

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.3.6...5.3.7

    Source code(tar.gz)
    Source code(zip)
  • 5.3.6(Oct 24, 2022)

    What's Changed

    • Update ResolveApiParameters.php by @puzzledmonkey in https://github.com/Team-Tea-Time/laravel-forum/pull/325

    New Contributors

    • @puzzledmonkey made their first contribution in https://github.com/Team-Tea-Time/laravel-forum/pull/325

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.3.5...5.3.6

    Source code(tar.gz)
    Source code(zip)
  • 5.3.5(Oct 15, 2022)

    What's Changed

    • Replace route model bindings with a middleware-based alternative by @Riari in https://github.com/Team-Tea-Time/laravel-forum/pull/322

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.3.4...5.3.5

    Source code(tar.gz)
    Source code(zip)
  • 5.3.4(Oct 13, 2022)

    What's Changed

    • Move route model binding outside of route groups by @Riari in https://github.com/Team-Tea-Time/laravel-forum/pull/320

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.3.3...5.3.4

    Source code(tar.gz)
    Source code(zip)
  • 5.3.3(Sep 24, 2022)

    What's Changed

    • Fix Delete Thread action by @Riari in https://github.com/Team-Tea-Time/laravel-forum/pull/313

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.3.2...5.3.3

    Source code(tar.gz)
    Source code(zip)
  • 5.3.2(Jun 16, 2022)

    What's Changed

    • Fixing Error On Category API & Add Indonesian Translation [api] by @aldok10 in https://github.com/Team-Tea-Time/laravel-forum/pull/307

    New Contributors

    • @aldok10 made their first contribution in https://github.com/Team-Tea-Time/laravel-forum/pull/307

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.3.1...5.3.2

    Source code(tar.gz)
    Source code(zip)
  • 5.3.1(Jun 10, 2022)

    What's Changed

    • Updated browser tab title to include thread title by @Fot0n in https://github.com/Team-Tea-Time/laravel-forum/pull/305
    • Updated route registration and route load from service provider by @pr4u4t in https://github.com/Team-Tea-Time/laravel-forum/pull/306
    • Updated title slug generation to fall back to a basic string when an empty one is generated

    New Contributors

    • @Fot0n made their first contribution in https://github.com/Team-Tea-Time/laravel-forum/pull/305
    • @pr4u4t made their first contribution in https://github.com/Team-Tea-Time/laravel-forum/pull/306

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.3.0...5.3.1

    Source code(tar.gz)
    Source code(zip)
  • 5.3.0(Mar 6, 2022)

  • 5.2.5(Feb 10, 2022)

  • 5.2.3(Feb 6, 2022)

    What's Changed

    • Improved eager loading for thread listings by @Riari in https://github.com/Team-Tea-Time/laravel-forum/pull/301
    • Fixed a few minor issues in the frontend

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.2.2...5.2.3

    Source code(tar.gz)
    Source code(zip)
  • 5.2.2(Jan 15, 2022)

    What's Changed

    • Fix some unhandled client-side errors by @Riari in https://github.com/Team-Tea-Time/laravel-forum/pull/295
    • Fix stat changes when moving threads by @Riari in https://github.com/Team-Tea-Time/laravel-forum/pull/296
    • Use Bootstrap 4 pagination view by @Riari in https://github.com/Team-Tea-Time/laravel-forum/pull/297

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.2.1...5.2.2

    Source code(tar.gz)
    Source code(zip)
  • 5.2.1(Dec 11, 2021)

    What's Changed

    • Implement forum:seed command by @Riari in https://github.com/Team-Tea-Time/laravel-forum/pull/287
    • Fix permanent bulk deletion of threads by @Riari in https://github.com/Team-Tea-Time/laravel-forum/pull/288

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.2.0...5.2.1

    Source code(tar.gz)
    Source code(zip)
  • 5.2.0(Nov 21, 2021)

  • 5.1.1(Nov 18, 2021)

  • 5.1.0(Nov 18, 2021)

    What's Changed

    See PRs for detailed changelogs.

    • Cascading privacy: https://github.com/Team-Tea-Time/laravel-forum/pull/279
    • Update doctrine/dbal: https://github.com/Team-Tea-Time/laravel-forum/pull/280
    • Fix inconsistencies in category and thread ability checks: https://github.com/Team-Tea-Time/laravel-forum/pull/282

    Misc Changes

    • Updated the doctrine/dbal dependency to include 3.1.4 onwards.

    Full Changelog: https://github.com/Team-Tea-Time/laravel-forum/compare/5.0.10...5.1.0

    Source code(tar.gz)
    Source code(zip)
  • 5.0.10(Oct 3, 2021)

  • 5.0.9(Oct 3, 2021)

  • 5.0.8(Sep 1, 2021)

    • Updated NL translations (#269).
    • Fixed some issues related to the ForumSeeder seeder.
    • Fixed some minor layout/style issues in the thread.show view.
    Source code(tar.gz)
    Source code(zip)
  • 5.0.7(Aug 12, 2021)

    • Updated the category.partials.list view:
      • "Re: [thread]" now only displays if there's more than one post in the thread.
      • Subcategory row content is now center-aligned to match top-level category rows.
    • Fixed an issue with the "Recent" and "Updated & unread" thread views that was causing threads in categories inaccessible to the current user to be included in the list.
    Source code(tar.gz)
    Source code(zip)
  • 5.0.6(Aug 9, 2021)

    • Updated the default master.blade.php to specify Vue version to use.
    • Fixed an issue in the default master.blade.php that was preventing navbar dropdowns on small displays from working.
    • Improved consistency in Gate/Policy checks for deleting and restoring posts and threads.
    • Updated and simplified Policy defaults.
    Source code(tar.gz)
    Source code(zip)
  • 5.0.5(Aug 5, 2021)

  • 5.0.4(Aug 5, 2021)

  • 5.0.3(Aug 4, 2021)

  • 5.0.2(Aug 4, 2021)

  • 5.0.1(Aug 4, 2021)

  • 5.0.0(Aug 4, 2021)

Class used for health analysis results. It returns BMI, BMR, TDEE, Pollock 7 sinfolds stats (body fat, body density, lean mass, fat mass)

php-health Class used for health analysis results. It returns BMI, BMR, TDEE, Polock 7 sinfolds stats (body fat, body density, lean mass, fat mass) Th

Vinicius Marques de Souza 2 Oct 5, 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
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
Laravel Forum

No taking care of this package anymore. Socieboy Forum Package for Laravel 5.2 Features Create conversations. Reply existing conversations. Support fo

Frank Sepulveda 71 Oct 2, 2020
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
Quick-and-dirty script for calculating cryptocurrency capital gains for tax purposes.

Software for calculating cryptocurrency capital gains for tax purposes. Calculation with LIFO method, developed with Italy in mind.

Cristian Livella 10 Oct 6, 2022
Quick and dirty PHP script to turn a Twitter feed into an RSS feed using Twitter's v2 API

Twitter to RSS Quick and dirty PHP script that turns a given Twitter feed into a RSS feed using Twitter's API v2 (the free version!) Does some basic l

Jon W 0 Aug 11, 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
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
Akaunting is a free, open source and online accounting software designed for small businesses and freelancers

Akaunting is a free, open source and online accounting software designed for small businesses and freelancers

jahidul alam mishuk 1 Jan 9, 2022
Vigil is a free client and hosting account management system designed especially for MyOwnFreeHost resellers.

Vigil is a free client and hosting account management system designed especially for MyOwnFreeHost resellers. It comes out of the box with a ticket support system, free SSL generator and elegant design.

JAI KRISHNA 1 Nov 21, 2021
La Fattura is a system designed for companies and individuals of all sizes to manage invoices

La Fattura La Fattura is a system designed for companies and individuals of all sizes to manage invoices, it integrates with Stripe for payments and w

Sofia Vicedomini 5 Feb 25, 2022
This app is designed to help Romanian teenagers and adults with learning

This app is designed to help Romanian teenagers and adults with learning. The app has a lot of good resources to support students in every possible way. The main resource we have are high school lesons. ??

StudentApp 3 Apr 27, 2022
3DS Town Square (3DSTS) is a website built and designed for the Nintendo 3DS. Also see GitHub pages for more info.

3DSTownSquare 3DS Town Square (3DSTS) is a website built and designed for the Nintendo 3DS. Supported PHP versions The only tested versions is 7.4.29,

HotPizzaYT 2 May 26, 2022
ControlPanel's Dashboard is a dashboard application designed to offer clients a management tool to manage their pterodactyl servers.

Features PayPal Integration Email Verification Audit Log Admin Dashboard User/Server Management Store (credit system) Vouchers and so much more! Contr

ControlPanel.gg 223 Jan 5, 2023
UserFrosting is a secure, modern user management system written in PHP and built on top of the Slim Microframework, Twig templating engine, and Eloquent ORM.

UserFrosting 4.6 Branch Version Build Coverage Style master hotfix develop https://www.userfrosting.com If you simply want to show that you like this

UserFrosting 1.6k Jan 1, 2023
Public append-only ledger microservice built with Slim Framework

Chronicle is a self-hostable microservice, built with Slim Framework, which enables authorized users to commit arbitrary data to an immutable, append-only public ledger.

Paragon Initiative Enterprises 460 Dec 22, 2022