Laravel | ReflectionException - Class does not exist

I created a package in the Laravel 4 workbench and it worked like a charm on my machine. Everything loaded as expected but now on another machine I'm getting the Class not found exception.

What I have:

composer.json (root)

"autoload": {
    "classmap": [
    "files": [

Please note that the workbench directory is listed.

Inside the workbench directory I have the vendor and package folders: workbench/krynble/contenter

Inside is the regular package structure but the most important is that there is another composer.json file (created when the package was generated):

"autoload": {
    "classmap": [
    "psr-0": {
        "Krynble\\Contenter\\": "src/"

So inside of it I followed the steps to create the Service Provider cited in the documentation

workbench/krynble/contenter/src/Krynble/Contenter/ContenterSerivceProvider.php (also generated automaticaly) and left it as created, with only the boot method as follows:

public function boot()


public function register()


public function provides()
    return array();

Added this service provider to my app.php in the providers list and invoking a die() in the boot function shows it's being called.

Last, I created my utility class:



namespace Krynble\Contenter\Services\Mappers;
class MediaMapperService {

Finally, in my controller:


use Krynble\Contenter\Services\Mappers\MediaMapperService;

class MediaController extends BaseController {

    private $mediaMapperService;

    public function __construct(MediaMapperService $mediaMapperService)
        $this->mediaMapperService = $mediaMapperService;

Nice! It worked on my machine (vagrant box with ubuntu)! But on the mac notebook it's not working (so I discarded the case-sensitive thing).

Any clues? Any way to debug? I'm going nuts, thrown die() in every point and can't seem to find the source.

Am I supposed to add something in the provides method in my service provider? If so, why did it work on my machine without adding this?


After a log of digging, I found out the problem was the weirdest of all: the short_open_tag setting in local computer was set to 1 and was set to 0 in my QA environment.

The file wasn't being parsed (but no error raised) and I was getting the class does not exist message.


 ? How to load my own code into Laravel? Differences between those ways?
 ? Class 'Role' not found
 ? Laravel 4 custom package not appearing in autoload_namespace.php
 ? Laravel 5 - Creating Artisan Command for Packages
 ? Laravel 5 - Creating Artisan Command for Packages
 ? Laravel 5 - Creating Artisan Command for Packages
 ? Create artisan commands for package Laravel 5
 ? How to call Model via artisan command in Laravel 5?
 ? Laravel 5 php artisan not running in Vagrant, missing vendor/services.json?
 ? Laravel 5 php artisan not running in Vagrant, missing vendor/services.json?