Laravel 5.1 重命名项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36151182/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 17:18:27  来源:igfitidea点击:

Laravel 5.1 rename project

laravellaravel-5laravel-5.1rename

提问by John Does Legacy

What is the best solution if I want to rename my laravel 5.1 project, I just tried to rename one but it did not work properly got some errors.

如果我想重命名我的 laravel 5.1 项目,最好的解决方案是什么,我只是尝试重命名一个,但它没有正常工作,但出现了一些错误。

Are there some kind of steps one has to do to rename a laravel project?

是否需要执行某种步骤来重命名 Laravel 项目?

回答by Alexey Mezenin

You should use php artisan app:namecommand to rename your app. It will change namespace in all project files for you. This is the only right way to rename your app.

您应该使用php artisan app:name命令来重命名您的应用程序。它将为您更改所有项目文件中的命名空间。这是重命名应用程序的唯一正确方法。

https://laravel.com/docs/5.0/configuration#after-installation

https://laravel.com/docs/5.0/configuration#after-installation

回答by lewis4u

From laravel version 5.3^ there is a function to call the app name

从 laravel 5.3 版开始,有一个函数可以调用应用程序名称

config('app.name');

You can change the default name 'Laravel' inside this file

您可以更改此文件中的默认名称“Laravel”

config/app.php

'name' => 'Laravel',

And also inside .env file

也在 .env 文件中

APP_NAME=Laravel

APP_NAME=Laravel

回答by rony

I just recommend to:

我只是建议:

  1. go to .env file at APP-NAME =
  2. put your desired name in "" (double quotes)
  3. restart your server
  1. 转到 APP-NAME = 处的 .env 文件
  2. 把你想要的名字放在 "" (双引号)
  3. 重启你的服务器

And you're done.

你已经完成了。

回答by Ilshat

You can change your project name using the following command:

您可以使用以下命令更改项目名称:

php artisan app:name your_git_name\your_app_name