laravel-debugbar: assets.css and assets.js not found

Hi, I just updated to the latest laravel-debugbar and now I’m getting 404 Not Found errors when loading

/_debugbar/assets.css?xxxxx /_debugbar/assets.js?xxxxx

I can see that the routes are properly registered, but for some reason Nginx is not routing it correct. Could it be my Nginx config? Here is my config taken from the Server section below:

    location / {

        # URLs to attempt, including pretty ones.
        try_files   $uri $uri/ /index.php?$query_string;

    }

    # Remove trailing slash to please routing system.
    if (!-d $request_filename) {
        rewrite     ^/(.+)/$ /$1 permanent;
    }

    # PHP FPM configuration.
    location ~ \.php$ {
            fastcgi_pass                    unix:/var/run/php-fcgi.sock;
            fastcgi_index                   index.php;
            fastcgi_split_path_info         ^(.+\.php)(/.+)$;
            include                         /etc/nginx/fcgi.conf;
            fastcgi_param                   SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    # We don't need .ht files with nginx.
    location ~ /\.ht {
            deny all;
    }

    # Set header expirations on per-project basis
    location ~* \.(?:ico|css|js|jpe?g|JPG|png|svg|woff)$ {
            expires 365d;

    }

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 36 (17 by maintainers)

Commits related to this issue

Most upvoted comments

After updating composer, add the ServiceProvider to the providers array in config/app.php

If you use a catch-all/fallback route, make sure you load the Debugbar ServiceProvider before your own App ServiceProviders.

And what kind of error do you get on the assets.css file?

Can you try renaming to to something without extension here: https://github.com/barryvdh/laravel-debugbar/blob/master/src/ServiceProvider.php#L46

So something like this:

   $this->app['router']->get('_debugbar/stylesheets', array(
            'uses' => 'Barryvdh\Debugbar\Controllers\AssetController@css',
            'as' => 'debugbar.assets.css',
        ));

    $this->app['router']->get('_debugbar/scripts', array(
            'uses' => 'Barryvdh\Debugbar\Controllers\AssetController@js',
            'as' => 'debugbar.assets.js',
        ));