PHP code example of snoeren-development / laravel-currency-casting

1. Go to this page and download the library: Download snoeren-development/laravel-currency-casting 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/ */

    

snoeren-development / laravel-currency-casting example snippets



use Illuminate\Database\Eloquent\Model;
use SnoerenDevelopment\CurrencyCasting\Currency;

class Plan extends Model
{
    //

    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    protected $casts = [
        'price' => Currency::class,
        'price_with_digits' => Currency::class . ':4',
    ];

    //
}