5

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

The folder structure and service providers are exactly same, but some how the Serviceprovider is not updating autoload_namespace.php.

I already added my service provider in app/config.php

'Walkswithme\Users\UsersServiceProvider',

In my root composer.json I have following code.

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

Under my packages folder files struture is as follows.

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

I can't use Laravel 5.1 it requires php 5.5.9 , Other wise I can user artisan packager command.

The error is getting is as follows.

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

Any help will be appreciated last 3hrs I'm digging on it.

Jobin
  • 8,238
  • 1
  • 33
  • 52
  • 1
    Did you run `composer dumpautoload`? – Wouter J Aug 08 '15 at 16:01
  • Yes, I solved it, `composer dumpautoload` doesn't help but `composer dumpautoload -o` works for me – Jobin Aug 09 '15 at 05:51
  • There is a good resource here, an answer made by Arlind, http://stackoverflow.com/questions/28541051/class-illuminate-html-htmlserviceprovider-not-found-laravel-5 – blakroku Aug 30 '15 at 09:01

2 Answers2

4

I solved it myself ,

I tried composer dumpautoload -o so it works for me.

Also some time needs composer clearcache too.

Hope it helps someone else..

Jobin
  • 8,238
  • 1
  • 33
  • 52
0

For me it was

Class 'Jubeki\LaravelCodeStyle\ServiceProvider' not found 

And I just run

composer require jubeki/laravel-code-style --dev

In another folder (not where my common composer.json is located)

Maybe it also can help someone :)

Just check the place of the new bundle installation folder.

mialdi98
  • 58
  • 7