daycode/charable

Get expected return value from char such as Alphabetic, Alphanumeric, Digit, Upper and Lower Case

v1.0.1 2023-07-17 02:06 UTC

This package is auto-updated.

Last update: 2024-05-16 13:43:18 UTC


README

Get expected return value from char such as Alphabetic, Alphanumeric, Digit, Upper and Lower Case.

Installation Guide

composer require daycode/charable

Update to the newest laravel project vendor

composer update

Go to config/app.php, then put these code on service providers

'providers' => [
    /*
    * Package Service Providers...
    */
    DayCod\Charable\CharableServiceProvider::class,
],

Put this code also on the class aliases

'aliases' => [
    /*
    * Class Aliases
    */
    'Charable'=> DayCod\Charable\Charable::class,
],

Last, for make sure this package installed correctly.

composer dump-autoload && php artisan optimize:clear

Usage Guide

Get Only Alphabet

Charable::getOnlyAlphabet(string $char, bool $remove_whitespace = false);

// ex: 123abcdef*&^0
// return: abcdef

Get Only Number or Digit

Charable::getOnlyNumberOrDigit(string $char, bool $remove_whitespace = false);

// ex: 123abcdef*&^0
// return: 1230

Get Only Lower Alphabet

Charable::getOnlyLowerAlphabet(string $char, bool $remove_whitespace = false);

// ex: 123abcdef*&^0
// return: abcdef

Get Only Upper Alphabet

Charable::getOnlyUpperAlphabet(string $char, bool $remove_whitespace = false);

// ex: 123abcdef*&^0
// return: ""

Get Only Alphabet Numeric

Charable::getOnlyAlphabetNumeric(string $char, bool $remove_whitespace = false);

// ex: 123abcdef*&^0
// return: 123abcdef0

Credits

Tested on

Release Supported Versions
Laravel Charable 1.0.0 Laravel 8/9/10