PHP code example of oriondevelops / filament-feedback

1. Go to this page and download the library: Download oriondevelops/filament-feedback library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

oriondevelops / filament-feedback example snippets




namespace App\Providers\Filament;

use Filament\Panel;
use Filament\PanelProvider;
use Orion\FilamentFeedback\FeedbackPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ...
            ->plugin(
                FeedbackPlugin::make()
                    ->sendResponsesTo(email: '[email protected]')
            );
    }
}



namespace App\Providers\Filament;

use Filament\Panel;
use Filament\PanelProvider;
use Orion\FilamentFeedback\FeedbackPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ...
            ->plugin(
                FeedbackPlugin::make()
                    ->visible(fn() => auth()->user()->can('view feedback page'))
            );
    }
}



namespace App\Providers\Filament;

use Filament\Panel;
use Filament\PanelProvider;
use Orion\FilamentFeedback\FeedbackPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ...
            ->plugin(
                FeedbackPlugin::make()
                    ->slug('feedback')
                    ->label('Feedback')
                    ->icon('heroicon-o-face-smile')
                    ->group('Help')
                    ->sort(3),
            );
    }
}



namespace App\Providers\Filament;

use Filament\Panel;
use Filament\PanelProvider;
use Orion\FilamentFeedback\FeedbackPlugin;
use App\Filament\Pages\ExtendedFeedbackPage;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ...
            ->plugin(
                FeedbackPlugin::make()
                    ->page(ExtendedFeedbackPage::class),
            );
    }
}