kanvas/moderation

Kanvas App Content Moderation Subsystem

Installs: 9 821

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 1

Type:project

v0.1.5 2021-12-23 13:39 UTC

This package is auto-updated.

Last update: 2024-11-06 10:25:34 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require Tests

This package allows you to add a moderation layer to any Kanvas Application

Usage

For the public facing controller , create a route and implement the ReportableRoute Trait

class ReportsController
{
    use ReportableRoutes;
}

To list the different report types for the current app , use the ReportableTypesRoutes Trait

class TypesController
{
    use ReportableTypesRoutes;
}

Exposing the route to block users

class UsersController
{
    use BlockedUserRoutes;
}

Routes

User report creation:

Route::post('/reports')->controller('Moderation\ReportsController')->action('create'),
Route::get('/report-types')->controller('Moderation\TypesController')->action('index'),

Blocked / Unblock user routes:

Route::get('/block-users')->controller('Users\BlockUserController')->action('index'),
Route::post('/block-users/{id}')->controller('Users\BlockUserController')->action('blockUser'),