PHPackages                             igramnet/laravel-phpmorphy - 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. igramnet/laravel-phpmorphy

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

igramnet/laravel-phpmorphy
==========================

laravel-phpmorphy - Laravel wrapper for phpMorphy.

00PHP

Since May 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/igramnet/laravel-phpmorphy)[ Packagist](https://packagist.org/packages/igramnet/laravel-phpmorphy)[ RSS](/packages/igramnet-laravel-phpmorphy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-phpmorphy
=================

[](#laravel-phpmorphy)

[![Latest Stable Version](https://camo.githubusercontent.com/5b4bd672a2ea1b2e540291a2bbb19ba6730f5b85948a03d03cd78dc919f7c7fb/68747470733a2f2f706f7365722e707567782e6f72672f696772616d6e65742f6c61726176656c2d7068706d6f727068792f76657273696f6e)](https://packagist.org/packages/igramnet/laravel-phpmorphy)[![Total Downloads](https://camo.githubusercontent.com/d2db960acd1c6948339e279ceda2bed97d98fd982886ffebb0759dcd2f9b3177/68747470733a2f2f706f7365722e707567782e6f72672f696772616d6e65742f6c61726176656c2d7068706d6f727068792f646f776e6c6f616473)](https://packagist.org/packages/igramnet/laravel-phpmorphy)[![tests](https://github.com/igramnet/laravel-phpmorphy/workflows/tests/badge.svg)](https://github.com/igramnet/laravel-phpmorphy/actions)[![codecov](https://camo.githubusercontent.com/23e7f18bc336db5cf43c67347ba20533f26e26623ae821bbee655419e8fa8a01/68747470733a2f2f636f6465636f762e696f2f67682f696772616d6e65742f6c61726176656c2d7068706d6f727068792f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/igramnet/laravel-phpmorphy)[![License](https://camo.githubusercontent.com/e11c9237812a0806c8dd877c34dfadcf55d47401b8a5024d5f457af6093ef7a0/68747470733a2f2f706f7365722e707567782e6f72672f696772616d6e65742f6c61726176656c2d7068706d6f727068792f6c6963656e7365)](https://packagist.org/packages/igramnet/laravel-phpmorphy)

`laravel-phpmorphy` is a Laravel wrapper for phpMorphy library with PHP7-8 support. This packed extend on [SEOService2020/laravel-phpmorphy](https://github.com/SEOService2020/laravel-phpmorphy)

phpMorphy is a morphological analyzer library for Russian, Ukrainian, English and German languages.

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

[](#installation)

Run the following command from your terminal:

```
composer require igramnet/laravel-phpmorphy
```

Or add this to require section in your `composer.json` file:

```
{
    "require": {
        "igramnet/laravel-phpmorphy": "~1.0"
    }
}
```

then run `composer update`

Configuration
-------------

[](#configuration)

The defaults are set in `config/morphy.php`. Copy this file to your own config directory to modify the values. You can publish the config using this command:

```
php artisan vendor:publish --provider="igramnet\Morphy\MorphyServiceProvider"
```

This is the contents of the published file:

```
return [
    'common_options' => [
        'storage' => phpMorphy::STORAGE_FILE,
        'predict_by_suffix' => true,
        'predict_by_db' => true,
        'graminfo_as_text' => true,
    ],

    'morphies' => [
        [
            // phpMorphy instance name
            // specific morphy can be accessed through Morphy::morphy($name) method
            'name' => igramnet\Morphy\Morphy::russianLang,

            // phpMorphy language
            // see Morphy class for available values
            'language' => igramnet\Morphy\Morphy::russianLang,

            // phpMorphy options
            // if not specified or null specified, default options will be used
            // to use common options from this config, specify []
            'options' => [],

            // dicts directory path
            // if not specified or null specified, default dicts path will be used
            'dicts_path' => null,

            // values are 'storage', 'filesystem'
            // 'storage': dicts will be taken from laravel storage (storage/app folder)
            // 'filesystem': dicts will be taken by specified path as-is
            // must be specified when dicts_path is not null
            'dicts_storage' => 'storage',
        ],
    ],
];
```

Usage
-----

[](#usage)

Wrapper automatically prepares input word for phpMorphy: it applies `trim` to word and converts it to uppercase or lowercase, depending on the dictionary options.

Using the wrapper directly:

```
use igramnet\Morphy\Morphy;
$morphy = new Morphy(Morphy::englishLang);
echo $morphy->getPseudoRoot('fighty');
```

Or via Laravel Facade:

```
use igramnet\Morphy\Facade\Morphy as Morphies;
// first parameter is the name of morphy in config
Morphies::getPseudoRoot('ru', 'Бойцовый');

// get morphy and call methods in regular manner
Morphies::morphy('ru')->lemmatize('   бойцовый');  // word will be trimmed

// get all morphies, returns array like ['name' => Morphy]
Morphies::morphies();

// get all morphies with specific locale, returns array like ['name' => Morphy]
Morphies::morphies(Morphy::russianLang);

// you can call phpMorphy static methods as well
Morphies::getDefaultDictsDir();
```

Note:

> You can access morphy properties only directly from morphy object, not facade.

### Add facade support

[](#add-facade-support)

This package allows Laravel to support facade out of the box, but you may explicitly add facade support to config/app.php:

Section `providers`

```
igramnet\Morphy\MorphyServiceProvider::class,
```

Section `aliases`

```
'Morphy' => igramnet\Morphy\Facade\Morphy::class,
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/93e9048e5735eb06600ad89d3f6e75079ec9e2c43b03bbfcf74105da165b44a7?d=identicon)[igramnet](/maintainers/igramnet)

---

Top Contributors

[![igramnet](https://avatars.githubusercontent.com/u/15707768?v=4)](https://github.com/igramnet "igramnet (3 commits)")

### Embed Badge

![Health badge](/badges/igramnet-laravel-phpmorphy/health.svg)

```
[![Health](https://phpackages.com/badges/igramnet-laravel-phpmorphy/health.svg)](https://phpackages.com/packages/igramnet-laravel-phpmorphy)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
