有些時候是需要獲取項目命名空間的,比如動態生成模版文件,我們可以直接使用框架提供的 `AppNamespaceDetectorTrait` 來獲取:
~~~
<?php
use Illuminate\Console\AppNamespaceDetectorTrait as AppName;
class TestName
{
use AppName;
public function getAppName()
{
return $this->getAppNamespace();
}
}
~~~