PHP code example of marshmallow / nova-fields-size

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

    

marshmallow / nova-fields-size example snippets


// In short:
Size::make('Column')
		->sortable(),


/**
 * Extended
 */
Size::make('Database Size')

	/**
	 * Options: ['bytes', 'Kb', 'Mb', 'Gb']
	 * Default: bytes
	 */
	->isStoredAs('bytes')		//

	/**
	 * Options: ['bytes', 'Kb', 'Mb', 'Gb', 'Auto']
	 * Default: Auto
	 */
	->displayAs('Auto')

	/**
	 * Default: 2
	 */
	->precision(2),