PHP code example of awcodes / trov-components

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

    

awcodes / trov-components example snippets


public static function form(Form $form): Form
{
    return FixedSidebar::make()
        ->schema([
            // Main section form components
        ], [
            // Sidebar form components
        ]);
}

protected bool $hasMultiActionButton = true;

DateInput::make(string $fieldname)
    ->label('Publish Date')
    ->withoutTime() //optional

PasswordGenerator::make(string $fieldname)
    ->passwordLength(int $length = 12)
    ->hasNumbers(bool $hasNumbers = true)
    ->hasSymbols(bool $hasSymbols = true)

TitleWithSlug::make(
    string $titleFieldName = 'title',
    string $slugFieldName = 'slug',
    string|Closure $basePathForResource = '/'
)->columnSpan('full')

Separator::make()

Timestamps::make()

VideoEmbed::make(string $fieldname)
    ->label('label')
    ->rows()

TitleWithStatus::make(string $fieldname = 'title')
    ->statusField(string $fieldname = 'status') // optional
    ->statuses(array | Arrayable (Enum) Status::class)
    ->colors(array | Arrayable (Enum) Status::colors())
    ->hiddenOn(string | null Status::Published->name) //optional

SoftDeleteFilter::make()
bash
php artisan trov-components:make-multi-action-button