无法更改 Laravel 应用程序名称
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41379957/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cannot change the laravel app name
提问by Isuru
I'm using php artisan app:name L&K Biomedics
to set the name of the app. But I get an error saying,
我正在php artisan app:name L&K Biomedics
用来设置应用程序的名称。但是我收到一个错误说,
'L' is not recognized as an internal or external command,
operable program or batch file.
I'm new to Laravel. What I'm doing wrong here.
我是 Laravel 的新手。我在这里做错了什么。
And is there a way to undo this command? I mean, if it changed the name to L&how can I change back it?
有没有办法撤销这个命令?我的意思是,如果它把名字改成了L&我怎么改回来呢?
回答by Alexey Mezenin
回答by M A SIDDIQUI
You need to study the naming standard a name can't include &
您需要研究名称不能包含的命名标准 &
回答by Vadim
You can have spaces in app name.You can achieve this by using single quotes in your .envfile, set:
应用名称中可以有空格。您可以通过在.env文件中使用单引号来实现这一点,设置:
APP_NAME='Company Name'
Restart your application by running command:
通过运行命令重新启动您的应用程序:
php artisan serve
Refresh your application in the browser.
在浏览器中刷新您的应用程序。
It works fine, however i don't know if the space in the app name will be affecting any specific functionality of the app.
它工作正常,但我不知道应用程序名称中的空格是否会影响应用程序的任何特定功能。
回答by AddWeb Solution Pvt Ltd
Spacesand ¬ allow so you can try this:
空格和&不允许这样你可以试试这个:
php artisan app:name KLBiomedicsEnterprices
Hope this helps you.
希望这对你有帮助。
回答by Igor Taskovski
Check the Laravel Docs. As other people mentioned before, spaces and special characters are not allowed.
检查Laravel 文档。正如其他人之前提到的,不允许使用空格和特殊字符。
Use the artisan command: php artisan app:name KLBiomedicsEnterprices
What this will do, is change the application Namespace from App to KLBiomedicsEnterprices.
使用 artisan 命令:php artisan app:name KLBiomedicsEnterprices
这将做的是将应用程序命名空间从 App 更改为 KLBiomedicsEnterprices。
回答by Kenneth Bregat
Try to change the name in the .env
file, and don't use spaces or any special character.
尝试更改.env
文件中的名称,不要使用空格或任何特殊字符。
Regards,
问候,
回答by RileyManda
in your terminal:php artisan app:name Yourapplicationname
在您的终端中:php artisan app:name Yourapplicationname
then in your editor(eg:brackets or notepad)
然后在您的编辑器中(例如:括号或记事本)
Open config,then in app.php,alter the following 'name' => env('APP_NAME', 'Yourapplicationname'),
打开配置,然后在 app.php 中,更改以下 'name' => env('APP_NAME', 'Yourapplicationname'),
then
然后
restart your application: "php artisan serve" in your terminal then refresh your application in the browser(locahost:8000 etc) This worked for me
重新启动您的应用程序:在您的终端中使用“php artisan serve”,然后在浏览器中刷新您的应用程序(locahost:8000 等)这对我有用
NB:You cant have spaces in your app name
注意:应用名称中不能有空格