PHPackages                             denis-kisel/helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. denis-kisel/helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

denis-kisel/helper
==================

:description

1.2(5y ago)092↓100%MITPHP

Since May 9Pushed 5y ago1 watchersCompare

[ Source](https://github.com/denis-kisel/helper-laravel)[ Packagist](https://packagist.org/packages/denis-kisel/helper)[ Docs](https://github.com/denis-kisel/helper-laravel)[ RSS](/packages/denis-kisel-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Helper for laravel
==================

[](#helper-for-laravel)

Helper package for laravel

Installation
------------

[](#installation)

Via Composer

```
$ composer require denis-kisel/helper
```

Usage
-----

[](#usage)

### String

[](#string)

Namespace *DenisKisel\\Helper\\AStr*

MethodDescription`AStr::getContent(string $mask, string $str) : string`Get substring by mask`AStr::rm(string $mask, string &$str) : string`Remove substring by mask`AStr::is(string $mask, string $str) : string`Check substring by mask`AStr::formatText(string $text [, int $countTabs = 0]) : string`Format text`AStr::pathByClass(string $model) : string`Get path by class`AStr::append(string $search, string $append, string $text [, int $countTabs = 0]) : string`Append substring`AStr::prepend(string $search, string $prepend, string $text [, int $countTabs = 0]) : string`Prepend substringExample
-------

[](#example)

### String

[](#string-1)

```
use DenisKisel\Helper\AStr;

...

// Get substring by mask
AStr::getContent('{*}', 'some {placeholder} text');
// Return:
// placeholder

AStr::getContent('Hello * world', 'Hello wonderful world');
// Return:
// wonderful

// Remove substring by mask
$text = 'some {placeholder} text';
AStr::rm('{*}', $text);
// Return:
// {placeholder}

echo $text;
// Output:
// some text

// Check substring by mask
AStr::is('Hello * world', 'Hello wonderful world');
// Return:
// (boolean)true

// Format text
AStr::formatText('Some text', 3);
// Return:
// \t\t\tSome text\n

// Get path by class
AStr::pathByClass('App\\Models\\Page');
// Return: absolute path to input class

// Append substring
$text =
