Have you defined psr-4/psr-0 in package composer json file for Myriad\Squire?
I think you need double backslash in psr4.
Myriad\\Squire\\
makzumi said:
I think you need double backslash in psr4.
Myriad\\Squire\\
Thanks, that's what I have. It works after the initial pull, so I don't think it's a composer issue. I also checked the generated psr4 autoload file and the namespace and path are correct. I'm starting to wonder if this is a Laravel issue.
Additionally, if I comment out the service provider, I can still do this:
$provider = new \Myriad\Squire\SquireServiceProvider(app());
dd($provider);
SquireServiceProvider {#137 ▼
#defer: true
#app: Application {#2 ▼
#basePath: "/Users/croemmich/Development/myriad/laravel5-starter"
#hasBeenBootstrapped: true
#booted: true
#bootingCallbacks: []
#bootedCallbacks: []
#terminatingCallbacks: []
#serviceProviders: array:19 [▶]
#loadedProviders: array:19 [▶]
#deferredServices: array:85 [▶]
#monologConfigurator: null
#databasePath: null
#storagePath: null
#environmentPath: null
#environmentFile: ".env"
#namespace: null
#resolved: array:32 [▶]
#bindings: array:41 [▶]
#instances: array:27 [▶]
#aliases: array:56 [▶]
#extenders: []
#tags: []
#buildStack: []
+contextual: []
#reboundCallbacks: array:2 [▶]
#globalResolvingCallbacks: []
#globalAfterResolvingCallbacks: []
#resolvingCallbacks: array:1 [▶]
#afterResolvingCallbacks: array:1 [▶]
}
}
Ok.. I'm dumb.. and something is magic.
I had "Myriad\\Squire\\": "src/"
which was wrong as my package files were in a subdirectory of source. I moved them where they should have been which fixed my issue. However, I'm still dumbfounded as to how php found them later in the runtime.
Thanks!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community