Coder Social home page Coder Social logo

vigstudio / livewire-comments Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 3.0 1.57 MB

Livewire comments packages for Laravel

Home Page: https://vgcomment.nghiane.com

License: MIT License

PHP 7.35% JavaScript 5.75% SCSS 9.75% Blade 16.75% CSS 60.41%
laravel php comments comments-system laravel-comments livewire laravel-admin livewire-component livewire-components livewire-comment

livewire-comments's Introduction

Latest Version on Packagist Total Downloads

Livewire Comments Package

Features

  • Add comments to any model
  • Multiple comment systems on the same page
  • Multiple auth guards
  • Image and File upload support
  • Drag and drop, copy and paste upload files support
  • reCaptcha v3 support
  • Emoji support
  • Markdown support
  • NSFW image upload check support

Pending Features

  • Allow guest to comment
  • Admin panel
  • Mention user with @
  • Emoji Suggestion Popup
  • Delete Report comment
  • Ratting system
  • Toolbar for comment
  • Comment history
  • Show Nested comments
  • Unit test

Packages

Introduction

Package use Macroable trait to add comments to any model. It uses Livewire and AlpineJs to create a comment system with a lot of features.

Package support multiple comment systems on the same page.

Package support multiple auth guards.

Prerequisites

Install Livewire Comments Package

In your terminal run:

composer require vigstudio/livewire-comments

Publish the assets files with:

php artisan vendor:publish --tag=vgcomment-assets-livewire

You can publish the config with:

php artisan vendor:publish --tag=vgcomment-config

Edit prefix route in config/vgcomment.php file.

    /*
    |--------------------------------------------------------------------------
    | Route Prefix
    |--------------------------------------------------------------------------
    |
    | This is the URI path where VgComment will be accessible from. Feel free to
    | change this path to anything you like.
    |
    */
    'prefix' => 'vgcomment',

Edit connection name in config/vgcomment.php file.

    /*
    |--------------------------------------------------------------------------
    | Database Connection
    |--------------------------------------------------------------------------
    |
    | Here you may specify which of the database connections below you wish
    | to use as your default connection for all of your database work.
    |
    */
    'connection' => env('DB_CONNECTION', 'mysql'),

Edit table names in config/vgcomment.php file.

    /*
    |--------------------------------------------------------------------------
    | Name of Tables in Database
    |--------------------------------------------------------------------------
    |
    | This is the name of the table that will be created by the migration and
    | used by the Comment model shipped with this package.
    |
    | "comments"    : Comments Table
    | "files"       : Files Attachment Table
    | "reactions"   : Reactions Table
    | "reports"     : Reports Table
    | "settings"    : Settings Table
    |
    */
    'table' => [
        'comments' => 'vgcomments',
        'files' => 'vgcomment_files',
        'reactions' => 'vgcomment_reactions',
        'reports' => 'vgcomment_reports',
        'settings' => 'vgcomment_settings',
    ],

Config Column or Attribute User Model in config/vgcomment.php file.

        /*
    |--------------------------------------------------------------------------
    | Column of User Table for get Data
    |--------------------------------------------------------------------------
    |
    | This is the setting for column of user table for get data.
    | "user_column_name"  : Column name for get name user
    | "user_column_email" : Column name for get email user
    | "user_column_url"   : Column name for get url user
    |
    */
    'user_column_name' => 'name',
    'user_column_email' => 'email',
    'user_column_url' => 'url',
    'user_column_avatar_url' => 'avatar_url',

Set moderation user in config/vgcomment.php file.

        /*
    |--------------------------------------------------------------------------
    | Users Manager Comments
    |--------------------------------------------------------------------------
    |
    | This is the setting for users manager comments.
    | 'guard' => [user_id]
    |
    | Example:
    | 'web' => [1, 2, 3]
    | 'api' => [1, 2, 3]
    |
    */
    'moderation_users' => [
        'web' => [1],
    ],

Run the migrate command to create the necessary tables: Before running the migrate command, you can edit the config/vgcomment.php file to change the table names.

php artisan migrate

Additionally you may want to clear the config, cache, etc:

php artisan optimize:clear

"Buy Me A Coffee"

"Donate Me!"

livewire-comments's People

Contributors

vigstudio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

livewire-comments's Issues

Release for livewire 3?

Would it be possible to get a release for Livewire 3 support, i see work has been started 5 months ago. If this is no longer supported i would be happy to carry it on for you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.