PHP code example of manzadey / laravel-macros

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

    

manzadey / laravel-macros example snippets


use Illuminate\Support\Str;

Str::declination(15, ['друг', 'друга', 'друзей']); // 15 друзей

use Illuminate\Support\Str;

Str::declinationRuble(50); // 50 рублей

use Illuminate\Support\Str;

Str::youtubeCodeFromUrl('https://www.youtube.com/watch?v=rOjHhS5MtvA'); // rOjHhS5MtvA

use Illuminate\Support\Str;

Str::onlyNums('+7 (911) 152-52-25'); // 79111525225

use Illuminate\Support\Str;

Str::countLetters('Самый обычный текст'); // 19

use Illuminate\Support\Str;

Str::countWords('Самый обычный текст'); // 3

use Illuminate\Support\Str;

Str::mask('/^(\d{3})(\d{3})(\d{2})(\d{2})$/', '+7 (\1) \2-\3-\4', 9112223344); // +7 (911) 222-33-44

use Illuminate\Support\Facades\Schema;

Schema::create('models', function (Blueprint $table) {
    $table->active();
});

use Illuminate\Support\Facades\Schema;

Schema::create('models', function (Blueprint $table) {
    $table->description();
});

use Illuminate\Support\Facades\Schema;

Schema::create('models', function (Blueprint $table) {
    $table->rating();
});

use Illuminate\Support\Facades\Schema;

Schema::create('models', function (Blueprint $table) {
    $table->slug();
});