Should I copy controller, or use artisan:make controller?

Viewed 373

I have this great doubt, if I copy and modify an existing controller in my laravel project vs create a controller with php artisan make:controller MyController, Is there any affected configuration files? or is it normal to copy and edit my other controllers?

2 Answers

It's just a lot easier to do the official command

php artisan make:controller myController

I mean, it's what they are there for. I don't believe that hand-making a controller will have a negative effect but it's so much easier and safe to use the function that's already defined.

many times in a controller you have a lot of logic that you want to reuse, IMHO sometimes it's worth manually copying the controller.

Related