PHP code example of adereksisusanto / filament-shlink

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

    

adereksisusanto / filament-shlink example snippets


// AppServiceProvider.php or PanelProvider
use Adereksisusanto\FilamentShlink\FilamentShlinkPlugin;

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

FilamentShlinkPlugin::make()->modal(true)

use Adereksisusanto\FilamentShlink\Enums\ModalType;
use Filament\Support\Enums\Alignment;
use Filament\Support\Enums\SlideOverPosition;
use Filament\Support\Enums\Width;

FilamentShlinkPlugin::make()->modal(
    enabled: true,
    type: ModalType::SlideOver,
    position: SlideOverPosition::End,
    width: Width::FourExtraLarge,
    alignment: Alignment::Center,
)

FilamentShlinkPlugin::make()->multiClient()

FilamentShlinkPlugin::make()->multiClient(tablePrefix: 'myapp')

return [
    'server_url' => env('SHLINK_SERVER_URL', ''),
    'api_key' => env('SHLINK_API_KEY', ''),
    'table_prefix' => 'fs',
];
bash
php artisan vendor:publish --tag="filament-shlink-config"
bash
php artisan vendor:publish --tag="filament-shlink-migrations"
php artisan migrate