abdulmajidcse/laravel-code-mask 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

abdulmajidcse/laravel-code-mask

最新稳定版本:v1.0.1

Composer 安装命令:

composer require abdulmajidcse/laravel-code-mask

包简介

This is a simple Laravel package that help you to manipulate your data.

README 文档

README

This is a simple Laravel package that help you to manipulate your data.

Requirements

  • PHP >=7.4 | >=8.0
  • Laravel >= 8.0 | >= 9.0 | >= 10.0 | >= 11.0

Installation

composer require abdulmajidcse/laravel-code-mask

Optional: The service provider will automatically get registered. Or you may manually add the service provider.

  • For Laravel v10 or lower (In your config/app.php file).
'providers' => [
    // ...
    Abdulmajidcse\LaravelCodeMask\LaravelCodeMaskServiceProvider::class,
];
  • For Laravel v11 or upper (In your bootstrap/providers.php file).
return [
    // ...
    Abdulmajidcse\LaravelCodeMask\LaravelCodeMaskServiceProvider::class,
];

Optional: The aliases will automatically get registered. Or you may manually add the aliases in your config/app.php file.

'aliases' => Facade::defaultAliases()->merge([
    // ...
    'CodeMaskFacade' => Abdulmajidcse\LaravelCodeMask\Facades\CodeMaskFacade::class,
])->toArray(),

Usage

You'll see code example so that you can guess where you have to use it.

Hide String

Sometimes, you need to hide phone, email or any other text with your special letter like 12****90. For this type of tasks, you can follow below code sample.

use Abdulmajidcse\LaravelCodeMask\Facades\CodeMaskFacade;

$phoneNumber = "1234567890";
$hidePhoneNumber = CodeMaskFacade::hideString($phoneNumber, 2, 2);

echo $hidePhoneNumber; // output: 12******90

Generate ID

Suppose, you have to generate an ID or any other string based ID with a special format. To do this, you can follow below code sample.

use Abdulmajidcse\LaravelCodeMask\Facades\CodeMaskFacade;

$id = CodeMaskFacade::generateId(123, 10, 0, '2701');

echo $id; // output: 27010000000123

Money Format

Suppose, you have a number that need to format with your country money format. To do this, you can follow below code sample.

use Abdulmajidcse\LaravelCodeMask\Facades\CodeMaskFacade;

$moneyWithLeftCurrency = CodeMaskFacade::moneyFormat(100000000.556, 'TK');
echo $moneyWithLeftCurrency; // output: TK 10,00,00,000.56

$moneyWithRightCurrency = CodeMaskFacade::moneyFormat(100000000.556, '', 'BDT');
echo $moneyWithRightCurrency; // output: 10,00,00,000.56 BDT

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-29