PHP code example of ralphjsmit / laravel-filament-components

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

    

ralphjsmit / laravel-filament-components example snippets


use RalphJSmit\Filament\Components\Forms\Sidebar;

Sidebar::make([
    // Components for the main section here
],[
    // Components for the sidebar section here
])

use Filament\Forms\Components\Section;
use Filament\Forms\Components\TextInput;
use Filament\Resources\Form;
use RalphJSmit\Filament\Components\Forms\Timestamps;
use RalphJSmit\Filament\Components\Forms\Sidebar;

public static function form(Form $form): Form
{
    return $form->schema([
        Sidebar::make([
            Section::make()
                ->schema([
                    TextInput::make('title')->label('Title'),
                    // ...
                ]),
            // ...
        ], [
            Section::make()
                ->schema([
                    ...Timestamps::make(),
                    // ...
                ]),
            // ...
        ]),
    ]);
}

use RalphJSmit\Filament\Components\Forms\Timestamps;

return $form->schema([
    ...Timestamps::make(),
    //
]);

use RalphJSmit\Filament\Components\Forms\CreatedAt;

return $form->schema([
    CreatedAt::make(),
    //
]);

use RalphJSmit\Filament\Components\Forms\UpdatedAt;

return $form->schema([
    UpdatedAt::make(),
    //
]);

use RalphJSmit\Filament\Components\Forms\DeletedAt;

return $form->schema([
    DeletedAt::make(),
    //
]);

use RalphJSmit\Filament\Components\Forms\Timestamp;

return $form->schema([
    Timestamp::make('email_verified_at'),
    //
]);