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

ActiveLibrary

seoservice2020/laravel-phpmorphy
================================

laravel-phpmorphy - Laravel wrapper for phpMorphy.

2.2.1(5y ago)21752[2 issues](https://github.com/SEOService2020/laravel-phpmorphy/issues)[1 PRs](https://github.com/SEOService2020/laravel-phpmorphy/pulls)MITPHPPHP ^7.2

Since Dec 20Pushed 3y ago2 watchersCompare

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

READMEChangelog (6)Dependencies (2)Versions (7)Used By (0)

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

[](#laravel-phpmorphy)

[![Latest Stable Version](https://camo.githubusercontent.com/42705ef4d70c0cfb9a8d47e0784ef02ccbf48de141ad55a2dea0729fbfbc59e6/68747470733a2f2f706f7365722e707567782e6f72672f73656f73657276696365323032302f6c61726176656c2d7068706d6f727068792f76657273696f6e)](https://packagist.org/packages/seoservice2020/laravel-phpmorphy)[![Total Downloads](https://camo.githubusercontent.com/6d8669831c7924f0186175824117a61d04d17eb3b6e582d5e44450a55baf44b6/68747470733a2f2f706f7365722e707567782e6f72672f73656f73657276696365323032302f6c61726176656c2d7068706d6f727068792f646f776e6c6f616473)](https://packagist.org/packages/seoservice2020/laravel-phpmorphy)[![tests](https://github.com/seoservice2020/laravel-phpmorphy/workflows/tests/badge.svg)](https://github.com/seoservice2020/laravel-phpmorphy/actions)[![codecov](https://camo.githubusercontent.com/7874972c37fef1df0a6231a23f595967ae21ad2aa3523af4805942e97f6e2648/68747470733a2f2f636f6465636f762e696f2f67682f73656f73657276696365323032302f6c61726176656c2d7068706d6f727068792f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/seoservice2020/laravel-phpmorphy)[![License](https://camo.githubusercontent.com/012397428769b1cf806b6fdafc40116b09aa2537fdfed19acc9ca35f470b9977/68747470733a2f2f706f7365722e707567782e6f72672f73656f73657276696365323032302f6c61726176656c2d7068706d6f727068792f6c6963656e7365)](https://packagist.org/packages/seoservice2020/laravel-phpmorphy)

`laravel-phpmorphy` is a Laravel wrapper for phpMorphy library with PHP7 support.

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

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

[](#installation)

Run the following command from your terminal:

```
composer require seoservice2020/laravel-phpmorphy
```

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

```
{
    "require": {
        "seoservice2020/laravel-phpmorphy": "~2.2"
    }
}
```

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="SEOService2020\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' => SEOService2020\Morphy\Morphy::russianLang,

            // phpMorphy language
            // see Morphy class for available values
            'language' => SEOService2020\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 SEOService2020\Morphy\Morphy;
$morphy = new Morphy(Morphy::englishLang);
echo $morphy->getPseudoRoot('fighty');
```

Or via Laravel Facade:

```
use SEOService2020\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`

```
SEOService2020\Morphy\MorphyServiceProvider::class,
```

Section `aliases`

```
'Morphy' => SEOService2020\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

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~8 days

Total

6

Last Release

1928d ago

Major Versions

1.0.0 → 2.0.02020-12-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4c6037739b19ae1486e27da55b25640b62c2e7df61e5d8fd9d50762529e255f?d=identicon)[sergotail](/maintainers/sergotail)

---

Top Contributors

[![sergotail](https://avatars.githubusercontent.com/u/17298627?v=4)](https://github.com/sergotail "sergotail (21 commits)")

---

Tags

laravelnlpphpmorphy

### Embed Badge

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

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

###  Alternatives

[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)[glhd/linen

21135.6k](/packages/glhd-linen)

PHPackages © 2026

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