for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LaravelModulize\Support;
use Illuminate\Support\Str;
class Entity
{
public static function getClassName($name)
return Str::contains($name, '/')
? array_reverse(explode('/', $name, 2))[0]
: $name;
}
public static function getClassNamespace($name)
? self::convertPathToNamespace($name)
: '';
public static function convertPathToNamespace($name)
? Str::start(
str_replace('/', '', self::getPathBeforeClassName($name)),
'\\'
)
public static function getPathBeforeClassName($name)
return Str::before($name, self::getClassName($name));