PHP code example of tutorigo / laravel-ide-macros

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

    

tutorigo / laravel-ide-macros example snippets


php artisan vendor:publish --provider="Tutorigo\LaravelMacroHelper\IdeMacrosServiceProvider"

php artisan ide-helper:macros

/**
 * Gets the amount of route parameters
 *
 * @return array
 * @instantiated
 */
\Illuminate\Routing\Route::macro('parameterCount', function () {
    /** @var \Illuminate\Routing\Route $this */
    return count($this->parameters);
});