PHP code example of jeffersonsimaogoncalves / nova-advanced-number-field
1. Go to this page and download the library: Download jeffersonsimaogoncalves/nova-advanced-number-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/ */
jeffersonsimaogoncalves / nova-advanced-number-field example snippets
namespace App\Nova;
use SimpleSquid\Nova\Fields\AdvancedNumber\AdvancedNumber;
class User extends Resource
{
// ...
public function fields(Request $request)
{
return [
// ...
AdvancedNumber::make('Price')
->prefix('$')
->thousandsSeparator(','),
// AdvancedNumber extends Number, so you can use Number methods too:
AdvancedNumber::make('Markup')
->decimals(0)
->suffix('%')
->min(0)->max(100),
// ...
];
}
}