function rr(){
local options=''
local kwd=''
if [ $# == 2 ];then
set -- $1 ${2/#\//}
options="--method $1 --path $2"
kwd=$2
else
set -- ${1/#\//}
options="--path $1"
kwd=$1
fi
local content=$(php artisan route:list $options | head -n -2)
if [ -z "$content" ]; then
if [ $# == 2 ];then
color green $FUNCNAME $1 ${2%/*}
$FUNCNAME $1 ${2%/*}
else
color green $FUNCNAME ${1%/*}
$FUNCNAME ${1%/*}
fi
return 0
fi
echo ''
php artisan route:list $options | head -n -2 | sed -E "s/@/::/; s/\.+/ /; s/\s+/ /" | grep -P "\s$kwd"
echo ''
}
