Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php artisan make:auth command overrides the existing views by default #18309

Closed
MikeAlhayek opened this issue Mar 12, 2017 · 8 comments
Closed

Comments

@MikeAlhayek
Copy link
Contributor

  • Laravel Version: v5.4.15
  • PHP Version: 5.6.24
  • Database Driver & Version: MySQL 5.7.17

Description:

Where I issue php artisan make:auth command to use the authorization setup. The command overrode my layout/app.blade.php file. This caused me to lose my work!

The command should check if the files already exists before overriding the file. Instead of overriding, it should throw a warning and if the use wishes to override the files he/she can run the command with the --force option.

Steps To Reproduce:

create a file called app.blade.php in the views/layouts folder and write some code

Then execute php artisan make:auth command

@ghost
Copy link

ghost commented Mar 12, 2017

layout/app.blade.php is generated for authorization system only

@MikeAlhayek
Copy link
Contributor Author

@mg-freelancer well I happened to be using a layout with the same name. Since the file existing at the time the command was executed, the command should not assume that it can just override all my work just because there is a naming conflict. It is best to let the use make that decision.

@marconi1992
Copy link
Contributor

marconi1992 commented Mar 13, 2017

@CrestApps I also think that is important check if already exist the views because in this case the name of the layout is very common in applications. This could be useful when the developer makes a custom scaffold command and he wants prevent that default commands and thirds commands overwrite the views, in case of controllers, configs, services, etc not is useful.

marconi1992 added a commit to marconi1992/framework that referenced this issue Mar 13, 2017
@srmklive
Copy link
Contributor

php artisan make:auth is to be used only when you create a new laravel application. I would not recommend that you run this command on an already created application.

@ntzm
Copy link
Contributor

ntzm commented Mar 13, 2017

That's true @srmklive, but it should definitely show an error if those files already exist and not overwrite them.

@GrahamCampbell
Copy link
Member

Feel free to send a PR.

@ollyimanishimwe
Copy link

I've already created the app file in layouts,
but still after running the "php artisan make:auth" command it shows me the following message
The [auth/register.blade.php] view already exists. Do you want to replace it? (yes/no) [no]: >

help plz

@samimetoui
Copy link

samimetoui commented Sep 20, 2019

artisan make:auth has completely overwritten my HomeController with empty controller content

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants