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

[5.2] Use the proper application namespace in HomeController when "make:auth" #12307

Merged
merged 1 commit into from
Mar 4, 2016
Merged

Conversation

rbadillap
Copy link
Contributor

Hi all,

Something that I noticed when we generate an authentication scaffolding (a.k.a php artisan make:auth) is the fact to create the HomeController.php file based on the stub located in src/Illuminate/Auth/Console/stubs/make/controllers/HomeController.stub .

This stub uses the App application name which is the default one:

namespace App\Http\Controllers;

use App\Http\Requests;
use Illuminate\Http\Request;

But in some cases people could have changed that app name before this step. (a.k.a php artisan app:name Whatever)

This PR purposes to change the App by the proper application name right after the stub are copied as HomeController.php, so we can rename that namespace automatically, without affect the stub which content are correct.

Verified

This commit was signed with the committer’s verified signature.
Eomm Manuel Spigolon
…caffold are generated
@GrahamCampbell GrahamCampbell changed the title Use the proper application namespace in HomeController when "make:auth" [5.2] Use the proper application namespace in HomeController when "make:auth" Feb 15, 2016
taylorotwell added a commit that referenced this pull request Mar 4, 2016

Verified

This commit was signed with the committer’s verified signature.
Eomm Manuel Spigolon
[5.2] Use the proper application namespace in HomeController when "make:auth"
@taylorotwell taylorotwell merged commit f363857 into laravel:5.2 Mar 4, 2016
@themast
Copy link

themast commented Mar 4, 2016

@taylorotwell CMIIW, this seems duplicate from #12245 & unnecessary?

file_put_contents(
app_path('Http/Controllers/HomeController.php'),
$this->compileControllerStub()
);
file_put_contents(
app_path('Http/Controllers/HomeController.php'),
str_replace(
'App\\',
$this->laravel->getNamespace(),
file_get_contents(app_path('Http/Controllers/HomeController.php'))
)
);

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

Successfully merging this pull request may close these issues.

None yet

3 participants