承接 permafrost-dev/laravel-str-extras 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

permafrost-dev/laravel-str-extras

最新稳定版本:1.0.1

Composer 安装命令:

composer require permafrost-dev/laravel-str-extras

包简介

Extra helper methods for the Laravel Str helper class.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Extra helper methods for the Laravel Str helper class.

Additional Methods

  • insert() - inserts a string at the specified position in the given string.
  • insertAfterMatch() - inserts a string after the specified pattern match.
  • insertAfter() - inserts a string after the specified substring.

Examples

$new = Str::insert('HelloWorld', '--', 5); //returns 'Hello--World'
$new = Str::insertAfterMatch('HelloWorld', '/(Hello)/', ' '); // returns 'Hello World'
$new = Str::insertAfter('HelloWorld', 'H', '_'); // returns 'H_elloWorld'

As far as making building web applications easier - consider the following use case:

// the identifier in the database is UA-1001, but we want to
// allow the user to provide the identifier without a dash for ease of entry:

$providedIdentifier = 'UA1001';
$actualIdentifier = Str::insertAfter($providedIdentifier, 'UA', '-'); 
$userExists = User::where('identifier', $actualIdentifier)->exists();

Installation

You can install the package via composer:

composer require permafrost-dev/laravel-str-extras

Usage

$new = Str::insert('HelloWorld', '--', 5); //returns 'Hello--World'

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-09