Remove laravel/ui and php artisan ui vue --auth in Laravel 7

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company
# Deconstructing and Removing Laravel UI Scaffolding in Laravel 7 When you rapidly prototype or bootstrap a new Laravel application, tools like `laravel/ui` and Artisan commands such as `php artisan ui vue --auth` are incredibly useful for setting up boilerplate views and authentication scaffolding quickly. However, sometimes, after development is complete, these generated files can clutter your project structure. If you find that running standard Composer commands like `composer update vendor/package-name` doesn't remove the leftover directories or files—especially in older setups like Laravel 7—it means the issue isn't with the package dependency itself, but with physical files and autoloading configurations that need manual addressing. This post will walk you through the definitive steps to completely remove the remnants of `laravel/ui` and the Vue authentication setup from your Laravel project, ensuring a clean slate for future development. ## Why Standard Composer Updates Fail The reason commands like `composer update` often fail to remove these artifacts is crucial to understand. Composer manages the *dependencies* (the classes and libraries) required by your project, but it does not inherently know about every file or directory created by scaffolding tools that live outside of the standard PSR-4 namespace structure. The UI package installs files directly into your `resources` or view directories, which Composer ignores during updates. To truly clean up these artifacts, we need a multi-pronged approach: deleting the physical files and then ensuring the autoloader is aware of the changes. ## Step-by-Step Removal Guide Follow these steps to completely purge the scaffolding left behind by `laravel/ui` and the Vue setup. ### 1. Manual Deletion of Scaffolding Files The most immediate step is to manually locate and delete the directories created by the scaffolding process. Based on your command, you should look for folders related to the UI assets and authentication structure. Navigate to your project root and manually remove these common locations: ```bash # Remove the package directory if it exists (usually not necessary if installed via composer, but good practice) rm -rf vendor/laravel/ui # Remove generated view and asset directories rm -rf resources/views/vendor/laravel-ui rm -rf public/vendor/laravel-ui ``` Furthermore, check your `app` directory for any controllers or routes that were automatically generated by the package. Delete any files related to the Vue auth setup you no longer need, such as scaffolding files within `app/Http/Controllers`. ### 2. Cleaning Up Composer Autoloading Even after deleting files, if Composer's autoloader still references old paths, you might encounter errors. While removing the physical files is often sufficient for UI setups, it is good practice to run a full dump of the autoload files to ensure everything is re-indexed correctly. This aligns with maintaining clean dependency management, a core principle in modern Laravel development, as championed by teams focusing on robust architecture like those found at [laravelcompany.com](https://laravelcompany.com). Run the following command to refresh Composer's understanding of your project structure: ```bash composer dump-autoload ``` This command forces Composer to regenerate the autoloader files based on the current state of your `composer.json` and file system, effectively removing any stale references to the deleted UI assets. ## Conclusion: Maintaining a Clean Development Environment Removing scaffolding artifacts requires moving beyond simple dependency updates; it demands a surgical approach involving both file system cleanup and Composer configuration management. By manually deleting the generated directories and then running `composer dump-autoload`, you ensure that your Laravel 7 project is free of extraneous code while maintaining a healthy, predictable environment. This practice is vital for long-term maintainability, regardless of whether you are working with older frameworks or modern versions; always prioritize a clean structure when starting a new feature.