PHP code example of ofcold / nova-configurations-field

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

    

ofcold / nova-configurations-field example snippets



use Ofcold\Configurations\Configurations;

/**
 * Get the fields displayed by the resource.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return array
 */
public function fields(Request $request)
{
    return [
        ID::make()->sortable(),
        Configurations::make('Configurations')
            ->setConfigurations([
                Text::make('foo'),
                Text::make('bar')
            ], 'example')
    ];
}



use Ofcold\Configurations\Repository;

Repository::scopeItems($scope)



use Ofcold\Configurations\Repository;
// Use scope and key
// Example: example::foo
Repository::get('example::foo')



use Ofcold\Configurations\Repository;
// Use scope and key
// Example: example::foo
Repository::getValue('example::foo')

bash
php artisan vendor:publish --provider="Ofcold\\Configurations\\FieldServiceProvider"
bash
php artisan migrate