Optional migrations.
Install the complete review experience, choose an interface, and configure customer and team workflows.
← All Pro topicsOptional modules
All Pro modules are included in both paid plans at no additional charge. In these instructions, "optional" means a feature is enabled through configuration and its migrations only when your application needs it—not that it is a separately priced add-on. Core's photo support is also included free.
Each setup below follows the same order: publish the migration, inspect and run it, then edit the published configuration. Turning a feature off hides its functionality without dropping its data. Core's base reviews/ratings migrations must already be installed.
Publish configuration once
If you have not already published the configuration files, run:
php artisan vendor:publish --provider="Codebyray\ReviewRateable\ReviewRateableServiceProvider" --tag=config
php artisan vendor:publish --tag=review-rateable-pro-config
Core's settings live in config/review-rateable.php; Pro's settings live in config/review-rateable-pro.php. The PHP snippets below are entries inside those files' existing return [...] arrays, not complete replacement files. Replace the matching entry and keep the other settings intact. Do not append a second entry with the same key or use --force to overwrite a customized file.
Module setup index
| Feature and setup | Publish tag | Schema |
|---|---|---|
| Photos | review-images-migrations (Core provider) |
review_images |
| Titles | review-rateable-pro-titles-migrations |
Nullable title on reviews |
| Author editing | review-rateable-pro-editing-migrations |
review_edit_states, review_updates |
| Official replies | review-rateable-pro-replies-migrations |
review_replies |
| Helpful votes | review-rateable-pro-helpful-votes-migrations |
review_helpful_votes |
| Verified badges | review-rateable-pro-verification-migrations |
review_verifications |
| Reader reports | review-rateable-pro-reports-migrations |
review_reports |
| Invitations | review-rateable-pro-invitations-migrations |
review_invitations |
| Content filtering | review-rateable-pro-content-moderation-migrations |
review_content_flags |
Moderation, basic forms/listing, and the one-review-per-user form setting do not require separate Pro tables. Base reviews/ratings are always required. Optional features are independently disabled by default.
Enabling a feature without its migration causes database errors. Rolling back an optional migration permanently deletes its saved metadata; disable the feature rather than rolling it back in a populated application.
Module: photos
Publish Core's image migration and run it. The storage-link command is needed only when serving Laravel's public disk through its usual symlink:
php artisan vendor:publish --provider="Codebyray\ReviewRateable\ReviewRateableServiceProvider" --tag=review-images-migrations
php artisan migrate
php artisan storage:link
In config/review-rateable.php, configure image storage and limits:
'images' => [
'disk' => 'public',
'directory' => 'review-images',
'thumbnail_directory' => 'review-images/thumbnails',
'max_count' => 5,
'max_file_size' => 5120,
'allowed_mime_types' => [
'image/jpeg',
'image/png',
'image/webp',
'image/gif',
],
'delete_files_on_delete' => true,
],
max_file_size is kilobytes per image (5120 = 5 MB). Core's image API works after the table is installed; it has no separate enable flag. If using Pro's upload form and gallery, also set this in config/review-rateable-pro.php:
'images' => ['enabled' => true],
The disk must exist in config/filesystems.php. Public URLs are not protected by review approval, and thumbnails are not generated automatically. See image APIs, eager loading, cleanup, and private-storage considerations.
Module: titles
php artisan vendor:publish --tag=review-rateable-pro-titles-migrations
php artisan migrate
In config/review-rateable-pro.php:
'titles' => [
'enabled' => true,
'max_length' => 150,
],
Pro adds a plain-text headline field to its form and shows saved titles in reviews. The length is measured in characters and cannot exceed 255. Existing reviews retain a null title. See titles and the separate one-review-per-user setting.
Module: author editing
php artisan vendor:publish --tag=review-rateable-pro-editing-migrations
php artisan migrate
In config/review-rateable-pro.php:
'editing' => [
'enabled' => true,
'ability' => null,
'require_reapproval' => true,
'updates_enabled' => true,
'update_label' => 'EDIT',
'update_min_length' => 2,
'update_max_length' => 5000,
'changes_per_minute' => 10,
],
Signed-in authors see the management action on their own review. A null ability retains mandatory ownership checks; use a named Gate/policy for additional eligibility rules. require_reapproval makes the entire review pending after a change. Set updates_enabled to false if you want editing without dated follow-ups. Titles and photo editing also require their own modules. See editor integration, dated updates, and stale-edit protection.
Module: official replies
php artisan vendor:publish --tag=review-rateable-pro-replies-migrations
php artisan migrate
In config/review-rateable-pro.php:
'replies' => [
'enabled' => true,
'ability' => 'replyToReview',
'min_length' => 2,
'max_length' => 5000,
],
Define the replyToReview Gate/policy for your owners/team; it receives the reviewable model and review. Enabling the flag does not grant reply permission, and a null reply ability denies access. The private moderation component includes the reply editor when permitted; alternatively embed the dedicated reply form on an authorized page. See the Gate example, component, and reply service.
Module: helpful votes
php artisan vendor:publish --tag=review-rateable-pro-helpful-votes-migrations
php artisan migrate
In config/review-rateable-pro.php:
'helpful_votes' => [
'enabled' => true,
'ability' => null,
'changes_per_minute' => 30,
],
The Pro list adds counts, voting controls, and Most helpful sorting. A null ability allows eligible signed-in readers to vote on another author's published review; authors cannot vote for themselves. Supply a named ability for extra restrictions. See voting rules, service calls, and eager-loading counts.
Module: verified badges
php artisan vendor:publish --tag=review-rateable-pro-verification-migrations
php artisan migrate
In config/review-rateable-pro.php:
'verification' => [
'enabled' => true,
'verifier' => App\Reviews\PurchaseReviewVerifier::class,
'label' => 'Verified Purchase',
],
Create your application's PurchaseReviewVerifier first; this example class is not included in Pro. It must implement Codebyray\ReviewRateablePro\Contracts\ReviewVerifier and return evidence only from trusted purchase/booking records. Set the label to Verified Booking, Verified Customer, or your own text. Enabling badges without a verifier provides no verification, and email verification is not purchase evidence. Copy the complete verifier implementation and learn how to refresh/revoke badges.
Module: reader reports
php artisan vendor:publish --tag=review-rateable-pro-reports-migrations
php artisan migrate
In config/review-rateable-pro.php:
'reports' => [
'enabled' => true,
'ability' => null,
'reasons' => [
'spam' => 'Spam or advertising',
'inappropriate' => 'Inappropriate content',
'misleading' => 'Misleading review',
'other' => 'Other concern',
],
'details_max_length' => 2000,
'submissions_per_minute' => 5,
'per_page' => 10,
],
The public list adds reporting for eligible signed-in readers. Define the moderation ability and embed the report queue on a private, authorized page so your team can resolve/dismiss reports. Reason keys are persisted identifiers; keep them stable. Reports never automatically hide a review. See the private queue component, permissions, and report service.
Module: invitations
php artisan vendor:publish --tag=review-rateable-pro-invitations-migrations
php artisan migrate
In config/review-rateable-pro.php:
'invitations' => [
'enabled' => true,
'ability' => null,
'route' => 'reviews.invitation',
'expires_in_days' => 14,
'changes_per_minute' => 10,
'email_enabled' => false,
'mailer' => null,
'queue' => null,
'mail_class' => Codebyray\ReviewRateablePro\Mail\ReviewInvitationMail::class,
'mail_subject' => 'How was your experience?',
],
Register the named reviews.invitation route before issuing invitations. It needs an {invitation} parameter, authentication using Pro's guard, signed-link validation, and the invitation manager's recipient/token checks. Pro does not register this route. Issuers must pass moderation and view permissions; a null invitation ability does not make issuing public.
The example disables email so links can be issued without a mail transport. For delivery, configure Laravel mail, set email_enabled to true, request sendEmail: true when issuing/renewing, and run an asynchronous queue worker in production. Copy the complete signed route, form, and invitation-service examples.
Module: content filtering
php artisan vendor:publish --tag=review-rateable-pro-content-moderation-migrations
php artisan migrate
In config/review-rateable-pro.php:
'content_moderation' => [
'enabled' => true,
'words' => [
'your blocked word',
'your blocked phrase',
],
'replacement' => '[redacted]',
],
Replace the example terms with your application's literal words/phrases; no profanity dictionary is bundled. Pro redacts matching review bodies, enabled titles, and new dated updates and forces moderation even when automatic approval is enabled. Keep APP_KEY stable and protect the private moderation page because originals are encrypted and visible only to authorized moderators. Custom core/API writers must call the filtering service explicitly. See matching rules, private history, and custom-writer integration.
Apply configuration changes
After editing the settings, clear any cached configuration in local development:
php artisan config:clear
If your production deployment caches configuration, rebuild it after the migrations and final configuration are in place, through your normal deployment process:
php artisan config:cache
Restart long-running queue workers through your deployment process when their configuration changes. Verify each enabled feature using an eligible account, and check that unauthorized users cannot access management actions. Publish each module's migration only once; repeated timestamped publishes can produce duplicate migrations. To disable a module later, set its enabled flag to false rather than deleting its tables. Core's image API has no enable flag, so stop calling it when photos are not used.