oneduo / nova-file-manager

The most advanced File Manager for Laravel Nova, feature rich and robust build.
https://oneduo.github.io/nova-file-manager/
MIT License
142 stars 39 forks source link

404 error on File Manager tool #112

Closed piotrh052b closed 1 year ago

piotrh052b commented 1 year ago

Describe the bug The tool window does not appear due to error 404

To Reproduce Steps to reproduce the behavior:

  1. Inastall package
  2. Register the tool in your NovaServiceProvider.php file
  3. Click entry File Manager in navigation

Expected behavior Tool window should appear

Screenshots

image

PHP v8.0.8 Laravel Nova v 4.19.5

Rezrazi commented 1 year ago

I'm unable to reproduce, please check your app configuration and that you are running the latest version of the package. Otherwise, can you please create a reproduction repo ?

piotrh052b commented 1 year ago

The error seems to only occur on Windows machines. I installed this package on production server with linux and there everything works as expected. Are you able to check this error on Windows ? I'm using Laragon for development purposes.

Rezrazi commented 1 year ago

Using the package should not be dependent on which platform you're on. Sadly I'm unable to test on a Windows machine. I would strongly recommend you double check your environment setup and your hosts with Laragon.

piotrh052b commented 1 year ago

I think I found the source of the problem.

In web.php i have route: Route::get('/{slug?}', [PageController::class, 'show']) ->where('slug', '.+') ->name('page__show');

If I remove this code then the tool works as it should.

Greetings and thanks for your support.

Rezrazi commented 1 year ago

Glad you were able to resolve it. Cheers

InfoSimoneGiusti commented 10 months ago

Hello guys, i had the same problem and i has found the solution.

In ToolServiceProvider.php of this plugins, you should move:

$this->routes(); call from boot() method to register() method.

If during next days i have some free times, i will send a PR with fix.

hayatbiralem commented 3 months ago

Hello guys, i had the same problem and i has found the solution.

In ToolServiceProvider.php of this plugins, you should move:

$this->routes(); call from boot() method to register() method.

If during next days i have some free times, i will send a PR with fix.

Thank you, this worked. Can we have a workaround in app for this until PR came out? Because production deploys will remove manual updates.

hayatbiralem commented 3 months ago

I've extended the package's ToolServiceProvider.php in my app and add call routes in register method as follows:

<?php

// app/Providers/CustomFileManagerServiceProvider.php

namespace App\Providers;

use Oneduo\NovaFileManager\ToolServiceProvider as NovaFileManagerServiceProvider;

class CustomFileManagerServiceProvider extends NovaFileManagerServiceProvider
{
    public function register(): void
    {
        parent::register();

        $this->routes();
    }
}

... and registered it in app config as follows:

<?php

// config/app.php

// ...

return [

    'providers' => [

       // ...

        /*
         * Package Service Providers...
         */
        App\Providers\CustomFileManagerServiceProvider::class,

       // ...

    ],

    // ...
];

It appears to be working. This solution will suffice until a proper fix is implemented, in my opinion.