Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

joshuahornby's avatar

'Illuminate\Foundation\Support\Providers\FilterServiceProvider' not found

I have seen this thread here https://laracasts.com/discuss/channels/general-discussion/l5-composer-update-ends-with-an-error-suddenly but I did a fresh install of Laravel 5 so already have these changes.

I am getting the following error after running a composer update

Class 'Illuminate\Foundation\Support\Providers\FilterServiceProvider' not found

Seems odd as I can clearly find the file in my IDE and nothing on the github commits shows anything should of changed.

0 likes
28 replies
SetKyarWaLar's avatar

When I try composer update I also got same error like the following

PHP Fatal error: Class 'Illuminate\Foundation\Support\Providers\FilterServiceProvider' not found in laravel5/app/Providers/FilterServiceProvider.php on line 5
xingfucoder's avatar

With those changes, I always recommend to make a backup of your project folder before run composer update, because some changes crashes your application.

2 likes
joshuahornby's avatar

Seems I am bouncing from error to error:

"message":"Class 'App\\Providers\\FilterServiceProvider' not found","file":"/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php","line":157}}

This will teach me for using beta software!!

chris15001900's avatar

Yeah this problem stopped my pending projects and now I regret using non-stable version. However L5 is so much better compared to 4...

4 likes
SetKyarWaLar's avatar

According to this I removed FilterServiceProvider from config/app.php and I got an new error on

/­vendor/­laravel/­framework/­src/­Illuminate/­Container/­Container.php56

Function () does not exist It's still same errors with me?

1 like
dberry's avatar

did you run a git update on the Laravel app itself and not just a composer update?

jcorry's avatar

No, I ran composer update...when I cd to src/vendor/laravel/framework and git pull I get a message that says: Already up-to-date.

I thought composer update DOES a git pull?

dberry's avatar

no, not git pull on illuminate.... There are two parts to laravel... laravel/laravel, this is your app folder structure (app, bootstrap, config, etc...) and then illuminate framework... You need to keep the laravel/laravel updated as well. This is a git update, not a composer update.

mstarkey's avatar

There seems to be a few updates that will break the latest update,you need to do the following to get rid of some of the errors;

remove 'App\Providers\FilterServiceProvider' from the app.php file remove 'use Illuminate\Routing\Controller;' from your controllers remove 'extends Controller' from your controllers

I know its a bit mad crazy but Taylor seems to had mad the 'controller class' autoload

I am loving this bleeding edge stuff, it's why I became a developer, and Laravel is getting better every day not just every release.

jcorry's avatar

Yah I have taken both of those steps and still have this exception when I try to load the page:

ReflectionException Function () does not exist Open: /src/vendor/laravel/framework/src/Illuminate/Container/Container.php { if (is_array($callback)) { return new ReflectionMethod($callback[0], $callback[1]); } else { return new ReflectionFunction($callback); } }

  1. ReflectionException …/­vendor/­laravel/­framework/­src/­Illuminate/­Container/­Container.php564
  2. ReflectionFunction __construct …/­vendor/­laravel/­framework/­src/­Illuminate/­Container/­Container.php564
  3. Illuminate\Container\Container getCallReflector …/­vendor/­laravel/­framework/­src/­Illuminate/­Container/­Container.php542
  4. Illuminate\Container\Container getMethodDependencies …/­vendor/­laravel/­framework/­src/­Illuminate/­Container/­Container.php526
  5. Illuminate\Container\Container call …/­vendor/­laravel/­framework/­src/­Illuminate/­Foundation/­Application.php714
  6. Illuminate\Foundation\Application run …/­public/­index.php49
1 like
mstarkey's avatar

Yeah, but isn't it exciting to see this stuff unfold and it really does make you read the doc more closely, well at least it does for me anyway :)

2 likes
thepsion5's avatar

Oh absolutely, there've been about a dozen times where I see something he's done and gone "awww man, why didn't I think of that?"

2 likes
crash13override's avatar

I had the "ReflectionException Function () does not exist" error as well, and after a lot of struggling I managed to sort it. In my case the problem was the config/local/app.php file.

In there I had also a couple ServiceProviders that I don't need on the live server (like the way/generators and the laravel-ide-helper) and everything was working fine. After doing the composer update I just couldn't get around this problem, until I finally emptied the config/local/app.php file and left just the debug=>true For some reason the last commit of laravel is not merging the 'providers' array anymore, and it looks like is replacing it instead. let me know if it helped solving your problem as well!

bashy's avatar

Currently all is fixed as of now.

sitesense's avatar

The problem was that "laravel/laravel" is not a dependency so composer update doesn't pull down the changes that were made to the app folder for example. e.g. the "Middleware" folder was missing entirely from the Http folder. You need to do apply these changes manually on an existing app.

jcorry's avatar

I added the middleware folder to HTTP from laravel/laravel...still doesn't work. I must be missing something obvious, but am missing it nonetheless. I looked at config/app.php and don't see any service providers being requested that aren't there.

crash13override's avatar

Did you check you LOCAL config? What's the content of the config/local/app.php (or the one being used by your environment)? In my case I had to remove the providers array in that file to make it work again.

sitesense's avatar

OK, in config/app.php remove 'App\Providers\FilterServiceProvider'.

Delete app/Filters folder.

Add the new app/Middleware folder and files.

Replace all files in app/Providers with latest ones and delete FilterServiceProvider.php.

Finally your controllers no longer extend Controller so remove "use Illuminate\Routing\Controller;" and "extends Controller" from your controllers.

<?php namespace App\Http\Controllers;

class HomeController { 

     /*
     |--------------------------------------------------------------------------
     | Default Home Controller
     |--------------------------------------------------------------------------
     |
     | You may wish to use controllers instead of, or in addition to, Closure
     | based routes. That's great! Here is an example controller method to
     | get you started. To route to this controller, just add the route:
     |
     |  $router->get('/', 'HomeController@index');
     |
     */

     /**
      * @Get("/", as="home")
      */
     public function index()
     {
          return view('hello');
     }

}

I think that should do it.

3 likes
deebarizo's avatar

sitesense, thanks a million. It looks like it's working.

alexleonard's avatar

Looks like

use Illuminate\Routing\Controller;

and

extends Controller {

is back in the latest version.

Although after stepping through all the changes at laravel/laravel my app is still broken.. time to go a-hunting!

alexleonard's avatar

Interestingly I needed to prefix the full controller namespace in my routes.php groups and that seemed to fix it. I know it's all about annotations now, but I haven't quite caught up that far as of yet.

Strangely with the latest update (CSRF in Middleware) Codeception POST/PUT functional tests all fail with CSRF mismatch exceptions

Please or to participate in this conversation.