PHP code example of porro / filament-connector

1. Go to this page and download the library: Download porro/filament-connector 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/ */

    

porro / filament-connector example snippets


use Porro\Filament\PorroPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(PorroPlugin::make());
}

PorroPlugin::make()
    ->widget(false)                 // no dashboard widget
    ->navigationGroup('Settings')   // instead of "Porro": the pages become "Porro Site Health" and "Porro Blocking"
    ->navigationSort(90)
    ->authorize(fn ($user) => $user->can('view site health'))
    ->authorizeManage(fn ($user) => $user->can('block ips'));   // who can block and safelist

use Illuminate\Support\Facades\Gate;

Gate::define('viewPorroSiteHealth', fn (User $user) => in_array($user->email, ['[email protected]']));

PorroPlugin::make()->authorize(fn (User $user) => $user->hasVerifiedEmail() && str_ends_with($user->email, '@youragency.com'));
bash
php artisan porro:connect <site key>

* * * * * cd /path/to/site && php artisan schedule:run > /dev/null 2>&1