Note that there are some explanatory texts on larger screens.

plurals
  1. POLaravel 4 package from private repository: ServiceProvider not found
    text
    copied!<p>I created a package for Laravel 4 that worked properly when used in development in <em>workbench</em> but when I install it with Composer it keeps returning me the error <code>Class 'Myvendor\Mypackage\MypackageServiceProvider' not found</code>.</p> <p>There is a particularity with my package which is that the name of my classes sources are different from the name of my package. Usually they are the same.</p> <pre><code>vendor/ Houle/ laravel-dynamite/ src/ Fhoule/ Dynamite/ DynamiteServiceProvider.php </code></pre> <p>I know that it can work because Laravel work's this way too.</p> <pre><code>vendor/ laravel/ framework/ src/ Illuminate/ </code></pre> <p>And the property <em>PSR-0</em> of my package <em>composer.json</em> seems to be properly configured:</p> <pre><code>"name": "Houle/laravel-dynamite", ... "require": { "php": "&gt;=5.3.0", "illuminate/support": "4.0.x" }, "autoload": { "classmap": [ "src/migrations", "src/controllers", "src/models" ], "psr-0": { "Fhoule\\Dynamite": "src/" } }, ... </code></pre> <p>How I created my package:</p> <ul> <li>Created the package with Artisan.</li> <li>Maked it work properly in workbench directory</li> <li>Pushed to private Bitbucket repo</li> <li>Installed new instance of Laravel</li> <li><p>Changed <em>composer.json</em> configuration to install my package (from private repository)</p> <pre><code>"name": "laravel/laravel", ... "require": { "laravel/framework": "4.0.*", "Houle/laravel-dynamite": "2.0.1" }, "repositories": [{ "type": "package", "package": { "name": "Houle/laravel-dynamite", "version": "2.0.1", "source": { "url": "git@bitbucket.org:Houle/laravel-dynamite.git", "type": "git", "reference": "v2.0.1" } } }], ... </code></pre></li> <li><p>Added my package Service Provider to app/config/app.php:</p> <pre><code>'providers' =&gt; array( 'Fhoule\Dynamite\DynamiteServiceProvider', ) </code></pre></li> </ul> <p>That's where my application return the error <code>Class 'Fhoule\Dynamite\DynamiteServiceProvider' not found</code>.</p> <p>What could be my issue?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload