PHP code example of neura-ui / neura-kit

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

    

neura-ui / neura-kit example snippets


use Neura\Kit\Support\Modal\ModalComponent;
use Neura\Kit\Concerns\InteractsWithNeuraKit;

class UserEdit extends ModalComponent
{
    use InteractsWithNeuraKit;

    public User $user;

    public function save(): void
    {
        $this->user->save();
        $this->toast('User saved!')->success();
        $this->closeModal();
    }

    public static function modalMaxWidth(): string
    {
        return 'lg';
    }

    public function render()
    {
        return view('livewire.user-edit');
    }
}

$this->openModal(UserEdit::class, ['user' => $user]);

// or fluent API
$this->modal(UserEdit::class)->with(['user' => $user])->maxWidth('xl')->open();

$this->toast('Saved!')->success();
$this->toast('Something went wrong')->error();
$this->toast('Processing…')->duration(6000)->info();

$this->dialog('Delete user?')
    ->danger()
    ->message('This action cannot be undone.')
    ->confirmText('Delete')
    ->onConfirm('deleteUser', $userId)
    ->show();

// config/neura-kit.php
return [
    'component_prefix' => 'neura',

    'routes' => [
        // Default `web` works for public pages (e.g. documentation).
        // Use `web,auth` when upload/editor routes must X_SIZE', 100),
        'allowed_mimes' => env('NEURA_KIT_UPLOAD_ALLOWED_MIMES'),
    ],

    'editor' => [
        'allow_remote_image_download' => (bool) env('NEURA_KIT_EDITOR_ALLOW_REMOTE_IMAGES', false),
    ],
];
bash
php artisan neura-kit:install-deps
bash
php artisan neura-kit:make-modal UserEdit
bash
php artisan vendor:publish --tag=neura-kit-config