ServiceProvider not found Laravel 5.0

I am trying to create a custom package for Laravel 5.0 based on this tutorials

The folder structure and service providers are exactly the same, but some like Serviceprovider do not update autoload_namespace.php.

I have already added my service provider to app / config.php

'Walkswithme\Users\UsersServiceProvider',

      

In my root composer.json, I have the following code.

"psr-4": {
        "App\\": "app/",
        "Walkswithme\\Users\\": "packages/walkswithme/users/src"
    }

      

Under the file folder struture files looks like this.

 walkswithme
    users
      src
         models
         controllers
         views
         UsersServiceProvider.php
         routes.php 
      composer.json

      

I cannot use Laravel 5.1, it requires php 5.5.9. Another way I can use the user artisan packager command.

The error occurs as follows.

 [Symfony\Component\Debug\Exception\FatalErrorException]   
  Class 'Walkswithme\Users\UsersServiceProvider' not found  

      

Any help would be appreciated in the last 3 hours. I dig on it.

+3


source to share


1 answer


I solved it myself,

I tried composer dumpautoload -o

, so it works for me.



It also takes some time composer clearcache

.

Hope this helps someone else.

+1


source







All Articles