Installation Add the package via Composer (note: this is a Symfony2 bundle, not Laravel-compatible):
composer require avro/support-bundle:dev-master
For Laravel users: Since this is a Symfony2 bundle, you’ll need to adapt it or use a similar Laravel package like backpack/crud or laravel-support for support systems.
Bundle Registration
In config/app.php, register the bundle in the config['bundles'] array (Symfony2 only):
Avro\SupportBundle\AvroSupportBundle::class => ['all' => true],
First Use Case
Route::resource, Eloquent models) to create a support system. Example:
// routes/web.php
Route::resource('support', SupportController::class);
// app/Http/Controllers/SupportController.php
public function index() {
return view('support.index', ['questions' => Question::latest()->get()]);
}
Question/Answer System
Question and Answer with relationships:
// app/Models/Question.php
public function answers() {
return $this->hasMany(Answer::class);
}
Use Laravel’s hasMany/belongsTo for threading.Styling
KnpLabs/KnpPaginatorBundle.// resources/js/app.js
require('bootstrap');
Pagination
$questions = Question::paginate(10);
Form Handling
use Illuminate\Support\Facades\Validator;
$validator = Validator::make($request->all(), [
'title' => 'required|max:255',
'body' => 'required',
]);
Symfony2 Dependency
Under Development
Missing Documentation
Bootstrap Dependency
<!-- resources/views/layouts/app.blade.php -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
Symfony2-Specific Issues
/app_dev.php/_profiler) to debug bundle behavior.barryvdh/laravel-debugbar).Form Validation
$request->validate([
'title' => 'required',
'body' => 'required|min:10',
]);
Database Migrations
php artisan make:migration create_questions_table
Schema::create('questions', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('body');
$table->boolean('is_solved')->default(false);
$table->timestamps();
});
Custom Fields
// app/Http/Requests/StoreQuestionRequest.php
public function rules() {
return [
'tags' => 'sometimes|array',
'tags.*' => 'exists:tags,name',
];
}
Notifications
use Illuminate\Support\Facades\Notification;
Notification::route('mail', $user->email)
->notify(new NewQuestionCreated($question));
API Endpoints
Route::apiResource('api/questions', ApiQuestionController::class);
How can I help you explore Laravel packages today?