PHP code example of sebastiansulinski / laravel-currency
1. Go to this page and download the library: Download sebastiansulinski/laravel-currency 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/ */
sebastiansulinski / laravel-currency example snippets
namespace App\Components\Currencies;
use SSD\Currency\Currencies\BaseCurrency;
class PLN extends BaseCurrency
{
/**
* Get symbol.
*
* @return string
*/
public static function symbol(): string
{
return 'zł';
}
/**
* Get code.
*
* @return string
*/
public static function code(): string
{
return 'PLN';
}
/**
* Determine if symbol should be placed after the value.
*
* @return bool
*/
protected static function symbolAfterValue(): bool
{
return true;
}
/**
* Determine if there is a space between symbol and the value.
*
* @return bool
*/
protected static function symbolSpace(): bool
{
return true;
}
}