PHP code example of alfasix / alfakit-ops

1. Go to this page and download the library: Download alfasix/alfakit-ops 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/ */

    

alfasix / alfakit-ops example snippets


use AlfaSix\AlfakitOps\OpsPlugin;

$panel->plugin(
    OpsPlugin::make()
        ->authorize(fn (User $user): bool => $user->is_admin)
        ->navigationGroup('System'),
);

Gate::define('viewAlfakitOps', fn (User $user): bool => $user->is_admin);

OpsPlugin::make()
    ->authorizeActions(fn (string $ability, User $user): bool => $ability !== OpsPlugin::ABILITY_MAINTENANCE_MODE || $user->is_owner)
    ->readOnly(fn (): bool => app()->isProduction())
    ->   ->logDirectory(storage_path('logs'))
    ->dashboardWidget()
    ->allowOnTenantPanels();