PHP code example of ejetar / laravel-decimal-locale

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

    

ejetar / laravel-decimal-locale example snippets


<? php
namespace App;

use Ejetar\DecimalLocale\Casts\Decimal;
use Illuminate\Database\Eloquent\Model;

class Product extends Model {
    protected $casts = [
        'price' => Decimal::class,
    ];
    protected $fillable = [
        'id',
        'price',
        'name'
    ];
}