New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Kernel.php file in module #674

Closed
kamov opened this Issue Dec 3, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@kamov

kamov commented Dec 3, 2018

Can I create a Kernel.php class in a module?

@nWidart

This comment has been minimized.

Owner

nWidart commented Dec 3, 2018

Yes, you can create any file / class inside your modules.

@kamov

This comment has been minimized.

kamov commented Dec 3, 2018

Thanks for quick reply.
As I understand I can add Kernel.php in my Modules/MODULE/Http/ folder and then change in bootstrap/app.php the loading of the Kernel.php ?

I am not sure if I can have multiple kernel class? But seem yes.

How the module know that exist a kernel file and then load it?

@nWidart

This comment has been minimized.

Owner

nWidart commented Dec 3, 2018

Autoloading is handled by composer.
In your main composer.json file you have an autoload section where you added something for this package. That's how it's autoloaded.

It will work because in the bootstrap/app.php file you call the kernel class using its fully qualified name, using the ::class syntax.

@kamov kamov closed this Dec 3, 2018

@kamov

This comment has been minimized.

kamov commented Dec 3, 2018

I will try thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment