PHP code example of smoke585 / ru-declension-laravel

1. Go to this page and download the library: Download smoke585/ru-declension-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

smoke585 / ru-declension-laravel example snippets


use SmoKE585\RUDeclensionLaravel\Facades\RUDeclension;

RUDeclension::make(3, 'балл'); // 3 балла
RUDeclension::make('балл', 3); // 3 балла
RUDeclension::make(3, 'балл', RUDeclension::MODE_WORD); // балла

RUDeclension(5, 'балл'); // 5 баллов

return [
    'sqlite_path' => null, // null = встроенная база пакета
    'strict' => false,
    'user_dictionary' => [
        'комментарий' => ['комментарий', 'комментария', 'комментариев'],
    ],
];

'слово' => ['слово', 'слова', 'слов']

'слово' => ['one' => 'слово', 'few' => 'слова', 'many' => 'слов']
bash
php artisan vendor:publish --tag=ru-declension-config