PHP code example of reaper / ui

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

    

reaper / ui example snippets




return [
    'edit-user' => [
        'component-path' => \App\Livewire\Users\EditUserForm::class, // or the Livewire alias string
        'header-name'     => 'Edit user',       // optional, default "Modal"
        'header-style'    => 'font-weight: 600; font-size: 1rem;', // optional
        'max-width'       => '600px',           // optional, default "1140px"
        'stable'          => false,              // optional, default false — see note below
    ],
];

$this->dispatch('open-global-modal', component: 'edit-user', params: ['id' => 42]);

use Livewire\Attributes\On;

class EditUserForm extends Component
{
    public array $params = [];

    #[On('global-modal-component-ready')]
    public function onReady(): void
    {
        // e.g. load the user record now that params are set
    }
}
bash
php artisan vendor:publish --provider="Reaper\Ui\ReaperUiServiceProvider"
bash
php artisan vendor:publish --tag=reaper-ui-config
php artisan vendor:publish --tag=reaper-ui-assets
blade
<x-reaper-ui::btn text="Save" type="pri.sm" />

<x-reaper-ui::btn text="Delete" type="dan" icon="trash" action="delete" param="{{ $id }}" />
js
window.dispatchEvent(new CustomEvent('open-application-modal', {
    detail: { modal: 'global', component: 'edit-user', params: { id: 42 } }
}));