zacksmash / fortify-ui

Laravel Fortify driven replacement to the Laravel UI package
https://github.com/zacksmash/fortify-ui
MIT License
240 stars 20 forks source link

File does not exist at path /***/app/providers/RouteServiceProvider.php. #19

Closed roelreijneveld closed 3 years ago

roelreijneveld commented 3 years ago

Hi there, First of all massive thanks for the module. It has helped me a lot. But after I tried to install it again in a (fresh) Laravel installation I got the following error message in my console:

 File does not exist at path /***/app/providers/RouteServiceProvider.php.

I installed a fresh Laravel application by running composer create-project laravel/laravel example-app, then running composer require zacksmash/fortify-ui and php artisan fortify-ui:install.

This is the complete error:

***@***:~/***$ php artisan fortify-ui:install --verbose

   Illuminate\Contracts\Filesystem\FileNotFoundException

  File does not exist at path /***/app/providers/RouteServiceProvider.php.

  at vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:57
     53▕         if ($this->isFile($path)) {
     54▕             return $lock ? $this->sharedGet($path) : file_get_contents($path);
     55▕         }
     56▕
  ➜  57▕         throw new FileNotFoundException("File does not exist at path {$path}.");
     58▕     }
     59▕
     60▕     /**
     61▕      * Get contents of a file with shared access.

  1   vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261
      Illuminate\Filesystem\Filesystem::get()

  2   vendor/zacksmash/fortify-ui/src/Commands/FortifyUICommand.php:92
      Illuminate\Support\Facades\Facade::__callStatic()

  3   vendor/zacksmash/fortify-ui/src/Commands/FortifyUICommand.php:19
      Zacksmash\FortifyUI\Commands\FortifyUICommand::updateRoutes()

  4   vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
      Zacksmash\FortifyUI\Commands\FortifyUICommand::handle()

  5   vendor/laravel/framework/src/Illuminate/Container/Util.php:40
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

  6   vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
      Illuminate\Container\Util::unwrapIfClosure()

  7   vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
      Illuminate\Container\BoundMethod::callBoundMethod()

  8   vendor/laravel/framework/src/Illuminate/Container/Container.php:610
      Illuminate\Container\BoundMethod::call()

  9   vendor/laravel/framework/src/Illuminate/Console/Command.php:136
      Illuminate\Container\Container::call()

  10  vendor/symfony/console/Command/Command.php:255
      Illuminate\Console\Command::execute()

  11  vendor/laravel/framework/src/Illuminate/Console/Command.php:121
      Symfony\Component\Console\Command\Command::run()

  12  vendor/symfony/console/Application.php:971
      Illuminate\Console\Command::run()

  13  vendor/symfony/console/Application.php:290
      Symfony\Component\Console\Application::doRunCommand()

  14  vendor/symfony/console/Application.php:166
      Symfony\Component\Console\Application::doRun()

  15  vendor/laravel/framework/src/Illuminate/Console/Application.php:93
      Symfony\Component\Console\Application::run()

  16  vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129
      Illuminate\Console\Application::run()

  17  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

Do you have any idea of what I might be doing wrong? Would love to hear from you!

zacksmash commented 3 years ago

Hey, there! Thanks for submitting this. I've followed your steps, but I'm unable to get it to respond the way you've outlined here. But it looks like you're missing the RouteServiceProvider.php file at app/providers. Can you confirm that file exists?

roelreijneveld commented 3 years ago

Yes, the RouteServiceProvider.php file does exist. That's the weird thing. I did notice though that the directory starts with a capital letter instead of the lowercase in the error (App/Providers instead of app/providers). However, it seems to me that it shouldn't have any impact.

zacksmash commented 3 years ago

I think app is fine, but Providers may need to be capitalized. Can you confirm that it is?

roelreijneveld commented 3 years ago

Yes, Providers is capitalized.

zacksmash commented 3 years ago

Very strange, my friend. Unfortunately, I'm still unable to reproduce this. Closing, but feel free to re-open with more details, if necessary.

fcolecumberri commented 3 years ago

same here

File does not exist at path /***/laravel/app/providers/RouteServiceProvider.php.
zacksmash commented 3 years ago

What OS?

fcolecumberri commented 3 years ago

I think the problem is https://github.com/zacksmash/fortify-ui/blob/cfaa1dfb403b6eaa263d4cdfed1f219f041fcc43/src/Commands/FortifyUICommand.php#L88

        File::put(
            app_path('providers/RouteServiceProvider.php'),
            str_replace(
                "public const HOME = '/home';",
                "public const HOME = '/dashboard';",
                File::get(app_path('providers/RouteServiceProvider.php'))
            )
        );

maybe that should be Providers with capital P

zacksmash commented 3 years ago

@fcolecumberri I think you're right! I just tagged a new release v1.3.10. Try that and see if it fixes the issue.

roelreijneveld commented 3 years ago

It does fix this issue File does not exist at path /***/app/providers/RouteServiceProvider.php. but now I got this error message: file_put_contents(/xxx/test-application/app/providers/RouteServiceProvider.php): failed to open stream: No such file or directory

I think the problem is at, not sure though https://github.com/zacksmash/fortify-ui/blob/e7ded6c15ef3bfd10edaa0f6da6f7dd27db24959/src/Commands/FortifyUICommand.php#L88

You've updated (which fixes the error) https://github.com/zacksmash/fortify-ui/blob/e7ded6c15ef3bfd10edaa0f6da6f7dd27db24959/src/Commands/FortifyUICommand.php#L92

zacksmash commented 3 years ago

This should be fixed, thanks to @RoelReijn