PHP code example of lopatin96 / laravel-nova

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

    

lopatin96 / laravel-nova example snippets


public function getConfigCategories(): array
{
    return [
        ConfigCategory::Platform->value => ConfigCategory::Platform->value,
        ConfigCategory::Documents->value => ConfigCategory::Documents->value,
        ConfigCategory::Analysis->value => ConfigCategory::Analysis->value,
        ConfigCategory::Reports->value => ConfigCategory::Reports->value,
        ConfigCategory::Tools->value => ConfigCategory::Tools->value,
    ];
}

public function getPlatformSpecificFields(): array
{
    return [
        Number::make(__('D.'), fn (): string => \Illuminate\Support\Number::format($this->documents->count())),

        Number::make(__('T.'), fn (): string => \Illuminate\Support\Number::format($this->toolContents->count())),
    ];
}

public function getPlatformSpecificRelations(): array
{
    return [
        HasMany::make('Documents'),

        HasMany::make('Tool Contents'),
    ];
}