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.5] Add make command for custom exceptions #21483

Merged
merged 2 commits into from Oct 3, 2017
Merged

[5.5] Add make command for custom exceptions #21483

merged 2 commits into from Oct 3, 2017

Conversation

Lloople
Copy link
Contributor

@Lloople Lloople commented Oct 1, 2017

Added the ability to create custom exceptions with php artisan make:exception. This command will create the Exception inside the Exceptions namespace of the app.

You can also use the flags --render and --report to generate the methods.

@GrahamCampbell GrahamCampbell changed the title Add make command for custom exceptions [5.5] Add make command for custom exceptions Oct 1, 2017
@GrahamCampbell
Copy link
Member

I think this is maybe overkill?

@Lloople
Copy link
Contributor Author

Lloople commented Oct 1, 2017

Why is that? I use custom exception a lot since the framework allows us to have the render method. I ended up duplicating an existing one or creating it manually, which I could do also with Controllers but we have a command for that.

Sorry for bad english

return $this->option('report')
? __DIR__.'/stubs/exception-render-report.stub'
: __DIR__.'/stubs/exception-render.stub';
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get rid of this else, because it'll return early here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right, I was following the code in other MakeCommands. I'll fix it as soon as possible.

Thank you.

@taylorotwell taylorotwell merged commit 46529ae into laravel:5.5 Oct 3, 2017
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

4 participants