Laravel-filemanager: 404 Not Found

Created on 1 Aug 2016  路  12Comments  路  Source: UniSharp/laravel-filemanager

Hi,

After following the instructions for installation, when I try to open localhost/laravel-filemanager in browser, I get three 404 errors:

file manager - mozilla firefox 2016-08-01 18 06 57

BUT, when I copy the entire contents of vendor/unisharp/laravel-filemanager/src/routes.php to my routes.php (located in app/Http/routes.php) - everything is working fine, there are no errors.

My question is - do we need to do this in order to make the _fliemanager_ working, or maybe I am missing something?

question

Most helpful comment

@FilipQL Try to put the Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class above the App\Providers\RouteServiceProvider::class :

        /*
         * Application Service Providers...
         */
        Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,

        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,
        Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
        Collective\Html\HtmlServiceProvider::class,

        Intervention\Image\ImageServiceProvider::class,
        Unisharp\Ckeditor\ServiceProvider::class,

This way, on a request, it will first check the routes from the filemanager and if there is no hit it will go to your routes.php. Now it will go through your routes.php and if it has a catchall route (to catch remaining request that do not have an absolute path or do not match any of your routes) it will end up in the cathcall route en won't be able to even reach the routes of the filemanager.

All 12 comments

LaravelFilemanagerServiceProvider.php will load the routes of this package.
Maybe this doc can help you?

have you put the Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class above the App\Providers\RouteServiceProvider::class in your providers?

@jayked No, these are my service providers:

        /*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,
        Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
        Collective\Html\HtmlServiceProvider::class,

        Intervention\Image\ImageServiceProvider::class,
        Unisharp\Ckeditor\ServiceProvider::class,
        Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,

Also, I followed your instructions:

  1. Installed unisharp/laravel-filemanager (v, 1.5.2)
  2. Added service providers (I've already had _Intervention Image_ installed)
  3. Published the package's config and assets:

php artisan vendor:publish --tag=lfm_config php artisan vendor:publish --tag=lfm_public

  1. Since I am using Laravel 5.2, I set: 'middlewares' => ['web', 'auth'],

But I also need to copy the entire contents of vendor/unisharp/laravel-filemanager/src/routes.php to my routes.php or I will get 404 errors (see my first comment here, above... ).

@FilipQL Try to put the Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class above the App\Providers\RouteServiceProvider::class :

        /*
         * Application Service Providers...
         */
        Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,

        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,
        Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
        Collective\Html\HtmlServiceProvider::class,

        Intervention\Image\ImageServiceProvider::class,
        Unisharp\Ckeditor\ServiceProvider::class,

This way, on a request, it will first check the routes from the filemanager and if there is no hit it will go to your routes.php. Now it will go through your routes.php and if it has a catchall route (to catch remaining request that do not have an absolute path or do not match any of your routes) it will end up in the cathcall route en won't be able to even reach the routes of the filemanager.

Yes, that was the problem. Now it works fine. Thank you.

Hi
I have put the Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class above the App\Providers\RouteServiceProvider::class : And I have copied the entire contents of vendor/unisharp/laravel-filemanager/src/routes.php to my routes.php

But nothing works: I get an error 404

regards

What worked for me for combination of Laravel 5.4 & FileManager 1.7 was to set 'auth' & 'web' middlewares in config/lfm.php. Without 'auth' FileManager is public, but without 'web' it yields 404 even with routes present in artisan route:list.

Hi,
I installed Laravel file manager with step by step.
When I was loading URL http://localhost/%7bfilemanager%7d/public/laravel-filemanager it works fine but when I put TinyMCE code in home.blade.php, I receive correct UI like

image

but when I'm trying to upload an image then I'm getting this error.
image.
Can someone please Help me How to solve this error ??

@vk001k You should check if the url of laravel-filemanager of your TinyMCE configuration matches http://localhost/%7bfilemanager%7d/public/laravel-filemanager (url you pasted).

the problem are de public, you public dont have de archiv , look in your public

yo tenia el mismo problema, es el public, yo lo cambie por otro nombre, y por lo tanto no estaba los archivos que necesita este complemento, busca en tu carpeta public/vendor/ y encontraras los archivos, yo ya lo repare asi. suerte

I Have Same problem while Uploading Image in file manager. It will return 404 Not found
image

my page url is this
http://localhost/laravel/blogbook/admin/post/create

many times i pasted this url in my TinyMCE configuration but i will everytime return same error.

Can someone help me to solve this error..?

I Have Same problem while Uploading Image in file manager. It will return 404 Not found
image

my page url is this
http://localhost/laravel/blogbook/admin/post/create

many times i pasted this url in my TinyMCE configuration but i will everytime return same error.

Can someone help me to solve this error..?

Please edit .env
APP_URL=http://localhost:8000 or your port

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fahadhowlader picture fahadhowlader  路  5Comments

farshidrezaei picture farshidrezaei  路  4Comments

asimshazad picture asimshazad  路  4Comments

lscavelli picture lscavelli  路  4Comments

sanvu88 picture sanvu88  路  3Comments