Hello,
I'll try to be as quick as possible.
I'm making a custom package, the file structure is as follows:
/packages/jtinkers/borgcms/src/composer.json
/packages/jtinkers/borgcms/src/BorgCMS/FluidSchema/FluidSchema.php
/packages/jtinkers/borgcms/src/BorgCMS/FluidSchema/FluidSchemaFacade.php
/packages/jtinkers/borgcms/src/BorgCMS/FluidSchema/FluidSchemaServiceProvider.php
Okay, now here's the important part of composer.json:
"autoload":
{
"psr-4":
{
"BorgCMS\": "src/BorgCMS/"
}
},
"extra":
{
"laravel":
{
"providers":
[
"BorgCMS\FluidSchema\FluidSchemaServiceProvider"
],
"aliases":
{
"FluidSchema": "BorgCMS\FluidSchema\FluidSchemaFacade"
}
}
}
FluidSchema.php
namespace BorgCMS\FluidSchema;
class FluidSchema
{
public function test()
{
echo 'test';
}
}
FluidSchemaFacade.php
namespace BorgCMS\FluidSchema;
class FluidSchemaFacade extends Facade
{
protected static function getFacadeAccessor()
{
return 'fluidschema';
}
}
FluidSchemaServiceProvider.php
namespace BorgCMS\FluidSchema;
class FluidSchemaServiceProvider extends ServiceProvider
{
public function register()
{
$this->app->bind('fluidschema', function()
{
return new FluidSchema();
});
}
}
The unimportant bits like comments or boot() method were omitted deliberately, but they are in my project - just empty.
As you can see, it's a standard setup of some class, a facade and a service binding it - but neither fluidschema()->test() nor FluidSchema::test() work and both pop either error about fluidschema being an unknown function or Undefined constant 'BorgCMS\FluidSchema\FluidSchema'
Is there a way to show registered service providers, aliases and facades? Other files like app/config.php remain untouched.