ramzyvirani/rateandreview

There is no license information available for the latest version (v1.0) of this package.

Rate and Review Module for ramzyvirani/laravel-boilerplate

v1.0 2020-01-10 07:16 UTC

This package is auto-updated.

Last update: 2024-04-14 20:52:51 UTC


README

Maintainability Test Coverage

Install this package with my boilerplate to add Rate and Review feature in your application. This module registers below components in the application.

This module implements Laravel's polymorphic relations so that you can easily attach one or more models.

PS: This module is highly dependant on the Boilerplate. Because this module extends some of the base classes Boilerplate has.

General

  • Configuration
  • Helper
  • Migration
  • Model
  • Repository

Admin

  • Controller
  • Data Table
  • Request Classes
  • Routes
  • Views

API

  • Controllers
  • Criteria
  • Request Classes
  • Routes

How to install

Please make sure that you have completely installed the boilerplate including and most importantly executed the migration from the boilerplate.

Execute below command to add this package in your project's composer dependencies.

composer require ramzyvirani/rateandreview "*"

Execute below command to publish views and config

php artisan vendor:publish --tag=RamzyVirani\RateAndReview\RateAndReviewServiceProvider

Execute migrations to create Reviews Table, Module, Menu, Permissions

php artisan migrate

PS: You will need to login with Super Admin to grant permissions to the admin and other roles.

How to Add Reviewable Options

Follow below points to add reviewable options in Admin Panel's Create/Edit forms and also use human readable instance type in Index Details Views.

  • Create a new Review Model in your application.
  • Extend it from RamzyVirani\RateAndReview\Models\Review.
  • Declare a public static property (array) named $INSTANCE_TYPE (E.g. in the original model).
    • Use FQDN of the polymorphic relations as the key and Human readable text as value
  • Change the fqdn in config/rateandreview.php

How to Extend Features

To Modify/Extend any functionality, Create a new class and extend it from the original Then, change the namespaces and fqdn in the config/rateandreview.php. Implement only those methods you want to modify.

  • RamzyVirani\RateAndReview\Criteria\ReviewCriteria
  • RamzyVirani\RateAndReview\DataTables\ReviewDataTable
  • RamzyVirani\RateAndReview\Models\Review
  • RamzyVirani\RateAndReview\Controllers\Admin\ReviewController
  • RamzyVirani\RateAndReview\Controllers\Api\ReviewAPIController
  • RamzyVirani\RateAndReview\Repositories\ReviewRepository