Laravel 5.1 remove controller

Fusion picture Fusion · Jan 9, 2016 · Viewed 46.7k times · Source

I have simple question on Laravel 5.1. I have created a controller using php artisan command:

php artisan make:controller PageSettings

However it was mistake, because I really wanted to create this controller in Admin folder like this:

php artisan make:controller Admin/PageSettings

Now I want to get rid of my old PageSettings controller. Is it ok just to delete my old PageSettings.php manualy? Or there is something more what needs to be done?

Answer

Marcin Nabiałek picture Marcin Nabiałek · Jan 9, 2016

If you only created it and found that you did it wrong, you can manually remove the file and that's it. However when you already added routes to this controller in routes.php you should remove them from routes.php file or alter the file to reflect your new controller.