A comprehensive Laravel package for managing feature requests with voting, commenting, and categorization capabilities. Built with modern design principles and a beautiful shadcn/ui inspired interface.
- Feature Request Management: Create, edit, and manage feature requests
- Voting System: Users can vote on feature requests
- Comments & Discussions: Threaded comments for each feature request
- Categorization: Organize requests with categories
- Status Tracking: Track request status (pending, in progress, completed, rejected)
- Priority Levels: Set priority levels (low, medium, high)
- User Management: User authentication and authorization
- Modern UI: Beautiful shadcn/ui inspired admin interface
- API Support: Full REST API for all operations
- Search & Filtering: Advanced search and filtering capabilities
- Responsive Design: Mobile-friendly interface
- Soft Deletes: Safe deletion with recovery options
composer require laravelplus/feature-requestsphp artisan vendor:publish --provider="LaravelPlus\FeatureRequests\Providers\FeatureRequestsServiceProvider"php artisan migratephp artisan feature-requests:create-default-categoriesThe package configuration is located in config/feature-requests.php:
return [
'middleware' => ['web', 'auth'],
'prefix' => 'feature-requests',
'user' => [
'model' => App\Models\User::class,
],
'default_categories' => [
'User Interface',
'Performance',
'Security',
'API',
'Mobile',
'Integration',
],
];use LaravelPlus\FeatureRequests\Models\FeatureRequest;
$featureRequest = FeatureRequest::create([
'title' => 'Dark Mode Support',
'description' => 'Add dark mode theme to the application',
'category_id' => 1,
'priority' => 'medium',
'user_id' => auth()->id(),
'is_public' => true,
]);use LaravelPlus\FeatureRequests\Models\Vote;
$vote = Vote::create([
'user_id' => auth()->id(),
'feature_request_id' => $featureRequest->id,
'vote_type' => 'up',
]);use LaravelPlus\FeatureRequests\Models\Comment;
$comment = Comment::create([
'user_id' => auth()->id(),
'feature_request_id' => $featureRequest->id,
'content' => 'This would be a great addition!',
]);The package provides the following web routes:
// Feature Requests
GET /feature-requests // Index
GET /feature-requests/create // Create form
POST /feature-requests // Store
GET /feature-requests/{slug} // Show
GET /feature-requests/{slug}/edit // Edit form
PUT /feature-requests/{slug} // Update
DELETE /feature-requests/{slug} // Destroy
// Voting
POST /feature-requests/{slug}/vote // Vote
DELETE /feature-requests/{slug}/vote // Unvote
// Comments
POST /feature-requests/{slug}/comments // Store comment
PUT /feature-requests/comments/{comment} // Update comment
DELETE /feature-requests/comments/{comment} // Delete comment
// Categories
GET /feature-requests/categories // Index
GET /feature-requests/categories/create // Create form
POST /feature-requests/categories // Store
GET /feature-requests/categories/{slug} // Show
GET /feature-requests/categories/{slug}/edit // Edit form
PUT /feature-requests/categories/{slug} // Update
DELETE /feature-requests/categories/{slug} // DestroyThe package also provides comprehensive API routes:
// Feature Requests API
GET /api/feature-requests // List all
POST /api/feature-requests // Create
GET /api/feature-requests/{slug} // Show
PUT /api/feature-requests/{slug} // Update
DELETE /api/feature-requests/{slug} // Delete
PATCH /api/feature-requests/{slug}/status // Update status
PATCH /api/feature-requests/{slug}/assign // Assign to user
PATCH /api/feature-requests/{slug}/toggle-featured // Toggle featured
// Voting API
POST /api/feature-requests/{slug}/vote // Vote
DELETE /api/feature-requests/{slug}/vote // Unvote
GET /api/feature-requests/votes/statistics // Vote statistics
// Comments API
GET /api/feature-requests/comments // List comments
POST /api/feature-requests/comments // Create comment
PUT /api/feature-requests/comments/{id} // Update comment
DELETE /api/feature-requests/comments/{id} // Delete comment
// Categories API
GET /api/feature-requests/categories // List categories
POST /api/feature-requests/categories // Create category
PUT /api/feature-requests/categories/{slug} // Update category
DELETE /api/feature-requests/categories/{slug} // Delete categoryThe package includes Vue.js components for easy frontend integration:
<template>
<FeatureRequestsIndex />
</template>
<script>
import FeatureRequestsIndex from '@laravelplus/feature-requests/components/FeatureRequestsIndex.vue'
export default {
components: {
FeatureRequestsIndex
}
}
</script>Use the included Blade views with your existing Laravel application:
@extends('feature-requests::layouts.app')
@section('content')
<div class="container">
<h1>Feature Requests</h1>
<!-- Your content here -->
</div>
@endsectionuse LaravelPlus\FeatureRequests\Models\FeatureRequest;
// Scopes
$featureRequests = FeatureRequest::published()->get();
$featureRequests = FeatureRequest::featured()->get();
$featureRequests = FeatureRequest::byStatus('pending')->get();
$featureRequests = FeatureRequest::byPriority('high')->get();
$featureRequests = FeatureRequest::byCategory($categoryId)->get();
$featureRequests = FeatureRequest::mostVoted()->get();
$featureRequests = FeatureRequest::recent()->get();
// Relationships
$featureRequest->user; // BelongsTo User
$featureRequest->category; // BelongsTo Category
$featureRequest->votes; // HasMany Vote
$featureRequest->comments; // HasMany Commentuse LaravelPlus\FeatureRequests\Models\Category;
// Scopes
$categories = Category::active()->get();
$categories = Category::bySlug('user-interface')->get();
$categories = Category::withFeatureRequests()->get();
// Relationships
$category->featureRequests; // HasMany FeatureRequestuse LaravelPlus\FeatureRequests\Models\Vote;
// Scopes
$votes = Vote::byType('up')->get();
$votes = Vote::byUser($userId)->get();
$votes = Vote::byFeatureRequest($featureRequestId)->get();
$votes = Vote::upVotes()->get();
$votes = Vote::downVotes()->get();
// Relationships
$vote->user; // BelongsTo User
$vote->featureRequest; // BelongsTo FeatureRequestuse LaravelPlus\FeatureRequests\Models\Comment;
// Scopes
$comments = Comment::approved()->get();
$comments = Comment::pinned()->get();
$comments = Comment::byUser($userId)->get();
$comments = Comment::byFeatureRequest($featureRequestId)->get();
$comments = Comment::parentComments()->get();
$comments = Comment::replies()->get();
$comments = Comment::recent()->get();
// Relationships
$comment->user; // BelongsTo User
$comment->featureRequest; // BelongsTo FeatureRequest
$comment->parent; // BelongsTo Comment (parent)
$comment->replies; // HasMany Comment (replies)Run the test suite:
# Run all tests
./vendor/bin/phpunit
# Run specific test
./vendor/bin/phpunit tests/Unit/Models/FeatureRequestTest.php
# Run with coverage
./vendor/bin/phpunit --coverage-html coveragetests/
βββ Unit/
β βββ Models/
β β βββ FeatureRequestTest.php
β β βββ CategoryTest.php
β β βββ VoteTest.php
β β βββ CommentTest.php
β βββ Services/
β βββ Repositories/
βββ Feature/
β βββ FeatureRequestControllerTest.php
β βββ VoteControllerTest.php
β βββ CommentControllerTest.php
β βββ CategoryControllerTest.php
βββ TestCase.php
Publish and customize the views:
php artisan vendor:publish --tag=feature-requests-viewsThe package uses Tailwind CSS with shadcn/ui design tokens. You can customize the styling by:
- Publishing the views
- Modifying the CSS classes
- Adding your own custom styles
Add custom middleware in the configuration:
'middleware' => ['web', 'auth', 'custom-middleware'],- Authentication: All routes require authentication by default
- Authorization: Users can only edit their own feature requests
- Validation: Comprehensive input validation
- CSRF Protection: All forms include CSRF tokens
- XSS Protection: Output is properly escaped
The package provides built-in statistics:
use LaravelPlus\FeatureRequests\FeatureRequests;
// Get overall statistics
$stats = FeatureRequests::getStatistics();
// Get vote statistics
$voteStats = FeatureRequests::getVoteStatistics();
// Get category statistics
$categoryStats = FeatureRequests::getCategoryStatistics();- Eager Loading: Relationships are properly eager loaded
- Database Indexing: Optimized database indexes
- Caching: Built-in caching for frequently accessed data
- Pagination: Efficient pagination for large datasets
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This package is open-sourced software licensed under the MIT license.
- Documentation: GitHub Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Built with Laravel
- UI inspired by shadcn/ui
- Icons by Lucide
- Styling with Tailwind CSS
Made with β€οΈ by the LaravelPlus team