zachleigh /
laravel-property-bag
| 1 | <?php |
||
| 2 | |||
| 3 | namespace LaravelPropertyBag\Helpers; |
||
| 4 | |||
| 5 | use Illuminate\Container\Container; |
||
| 6 | |||
| 7 | class NameResolver |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Get the app namespace from the container. |
||
| 11 | * |
||
| 12 | * @return string |
||
| 13 | */ |
||
| 14 | public static function getAppNamespace() |
||
| 15 | { |
||
| 16 | return Container::getInstance()->getNamespace(); |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Make config file name for resource. |
||
| 21 | * |
||
| 22 | * @param string $resourceName |
||
| 23 | * |
||
| 24 | * @return string |
||
| 25 | */ |
||
| 26 | public static function makeConfigFileName($resourceName) |
||
| 27 | { |
||
| 28 | $appNamespace = static::getAppNamespace(); |
||
| 29 | |||
| 30 | return $appNamespace.'Settings\\'.$resourceName.'Settings'; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Make rules file name. |
||
| 35 | * |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | public static function makeRulesFileName() |
||
| 39 | { |
||
| 40 | $appNamespace = static::getAppNamespace(); |
||
| 41 | |||
| 42 | return $appNamespace.'Settings\\Resources\\Rules'; |
||
| 43 | } |
||
| 44 | } |
||
| 45 |