PHP code example of awcodes / pounce

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

    

awcodes / pounce example snippets


public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            PouncePlugin::make(),
        ]);
}

return [
    'modal_max_width' => \Awcodes\Pounce\Enums\MaxWidth::Medium,
    'modal_alignment' => \Awcodes\Pounce\Enums\Alignment::MiddleCenter,
    'modal_slide_over' => \Awcodes\Pounce\Enums\SlideDirection::None,
    'close_modal_on_click_away' => true,
    'close_modal_on_escape' => true,
    'close_modal_on_escape_is_forceful' => true,
    'dispatch_close_event' => false,
    'destroy_on_close' => false,
];

namespace App\Http\Livewire;

use Awcodes\Pounce\PounceComponent;

class CustomModal extends PounceComponent
{
    public function render()
    {
        return view('livewire.custom-modal');
    }
}

use Awcodes\Pounce\Enums\Alignment;

public static function getAlignment(): Alignment
{
    return Alignment::MiddleCenter;
}

use Awcodes\Pounce\Enums\MaxWidth;

public static function getMaxWidth(): MaxWidth
{
    return MaxWidth::Medium;
}

use Awcodes\Pounce\Enums\SlideDirection;

public static function getSlideDirection(): SlideDirection
{
    return SlideDirection::Left;
}

public static function isSlideOver(): bool
{
    return false;
}
js
content: [
    ...
    './vendor/awcodes/pounce/resources/**/*.blade.php',
]
bash
php artisan vendor:publish --tag="pounce-config"
bash
php artisan vendor:publish --tag="pounce-views"
bash
php artisan make:pounce {name?} {--form} {--F|force}
bash
php artisan make:livewire CustomModal