resto-dhepot/app/Helpers/RouteCommandDescriptor.php

26 lines
589 B
PHP

<?php
namespace App\Helpers;
use Closure;
use Illuminate\Routing\Route;
class RouteCommentDescriptor
{
public static function register()
{
if (!Route::hasMacro('comment')) {
Route::macro('comment', function ($params = null) {
$this->_comment = $params;
});
}
if (!Route::hasMacro('getComment')) {
Route::macro('getComment', function () {
if (!property_exists($this, '_comment'))
return null;
return $this->_comment;
});
}
}
}