Package Data | |
---|---|
Maintainer Username: | PrivateSniper |
Package Create Date: | 2015-06-05 |
Package Last Update: | 2016-12-30 |
Language: | PHP |
License: | GPL-3.0 |
Last Refreshed: | 2024-11-14 15:16:37 |
Package Statistics | |
---|---|
Total Downloads: | 674 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 6 |
Total Watchers: | 5 |
Total Forks: | 4 |
Total Open Issues: | 1 |
A drop-in forum module for Laravel 5.
Integration Testing:
Fully Functional Forum (/forum)
Admin Interface (/admin/forums)
Database Tables
Laravel 5.2:
require {
"taskforcedev/laravel-forum": "1.0.2"
}
Laravel 5.3+:
require {
"taskforcedev/laravel-forum": "dev-master"
}
In development (steps for 5.0-5.2 may work as long as you dont require a package requiring the newer laravel-support package).
composer update
'providers' => [
Taskforcedev\LaravelSupport\ServiceProvider::class,
Taskforcedev\LaravelForum\ServiceProvider::class,
]
Run the migrations
php artisan migrate
If you haven't previously published the config from the LaravelSupport package please do this also with the following command:
php artisan vendor:publish --tag="taskforce-support"
If you haven't previously edited the config/taskforce-support.php file please add your sites details into this.
'layout' => 'layouts.master',
'sitename' => 'Your Site Name',
Once you have done the installation steps above in order to setup the forums for public use you must first create at least one category and a forum, you do this by visiting
/admin/forums
Once you have done this you can add the link to /forum into your sites navigation as you please.
In order to provide administrators access to add/edit/manage the forums we use laravel policies.
The following must return true for a user to be able to visit the admin section:
$user->can('create', Forum::class);
We recommended you have a policy which proves a user has administration powers on your application:
see: https://laravel.com/docs/5.3/authorization#creating-policies
Then you can add the following to your app/Providers/AuthServiceProvider.php file
use Taskforcedev\LaravelForum\Models\Forum;
use Taskforcedev\LaravelForum\Models\ForumCategory;
Then apply your admin policy to each of the models [example:]
protected $policies = [
...
Forum::class => AdminPolicy::class,
ForumCategory::class => AdminPolicy::class,
];
As it stands any authenticated user is able to post or reply in any forum.
The following events are fired within the package and can be listened for in your main application.
Version 1.* follows the semantic version numbering system.
Future versions will use the laravel major and minor version numbers followed by release number.