PHP code example of rhaima / voltpanel

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

    

rhaima / voltpanel example snippets


use App\Panels\AdminPanel;
use Rhaima\VoltPanel\Facades\VoltPanel;

public function boot(): void
{
    VoltPanel::register(new AdminPanel());
}

use Rhaima\VoltPanel\Authorization\Traits\HasRoles;

class User extends Authenticatable
{
    use HasRoles;
}

use Rhaima\VoltPanel\Resources\Resource;
use Rhaima\VoltPanel\Forms\Form;
use Rhaima\VoltPanel\Tables\Table;
use Rhaima\VoltPanel\Forms\Components\TextInput;
use Rhaima\VoltPanel\Forms\Components\RichEditor;
use Rhaima\VoltPanel\Forms\Components\Select;
use Rhaima\VoltPanel\Tables\Columns\TextColumn;
use Rhaima\VoltPanel\Tables\Columns\BadgeColumn;
use Rhaima\VoltPanel\Tables\Columns\DateColumn;

class PostResource extends Resource
{
    protected static ?string $model = Post::class;

    public static function form(Form $form): Form
    {
        return $form->schema([
            TextInput::make('title')->
bash
php artisan voltpanel:install
bash
php artisan migrate
bash
php artisan voltpanel:panel Admin
bash
php artisan voltpanel:resource Post
bash
php artisan vendor:publish --tag=voltpanel-config