PHP code example of oblak / vocative-laravel

1. Go to this page and download the library: Download oblak/vocative-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/ */

    

oblak / vocative-laravel example snippets




return [
    'dictionary' => [],
    'ignore_dictionary' => false,
];

use Oblak\Vocative\Facades\Vocative;

// Transform a name to vocative case
echo Vocative::make('Милица'); // "Милице"
echo Vocative::make('Марко');  // "Марко"

// Force transformation (bypass dictionary)
echo Vocative::make('Лука', true); // Forces transformation even if in dictionary

// config/vocative.php
return [
    'dictionary' => [
        'CUSTOM_NAME' => 'CUSTOM_VOCATIVE_FORM',
        'Лука' => 'Луко',
    ],
    'ignore_dictionary' => false, // Set to true to always force transformation
];
bash
php artisan vendor:publish --tag="vocative-config"