Skip to content

Conversation

@arrilot
Copy link
Contributor

@arrilot arrilot commented Mar 22, 2015

Follows #8084

Okay, so I've spent some time trying to investigate how to determine application namespace outside laravel core (in a package in my case)
I found it pretty confusing because:

  1. It's not documented
  2. You have to use internal trait
  3. The trait is situated in the Console component (Illuminate\Console\AppNamespaceDetectorTrait)

What about straightforward app()->getNamespace()?

@arrilot arrilot changed the title [5.1] App namespace [5.1] Easy application namespace determination Mar 22, 2015
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like seeing helper functions for ioc stuff in the core. Feels really hacky.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe.
Let's see what Taylor thinks about that and the PR as a whole.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use $this->laravel to get to the application from a Console command.

@arrilot arrilot force-pushed the application_namespace branch from dabb057 to 0c0a6b8 Compare March 23, 2015 16:27
@arrilot
Copy link
Contributor Author

arrilot commented Mar 23, 2015

Cleaned up and squashed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be protected.

@arrilot arrilot force-pushed the application_namespace branch from 0c0a6b8 to 671f671 Compare March 23, 2015 18:14
taylorotwell added a commit that referenced this pull request Mar 24, 2015
[5.1] Easy application namespace determination
@taylorotwell taylorotwell merged commit 570078c into laravel:master Mar 24, 2015
@taylorotwell
Copy link
Member

❤️

@arrilot arrilot deleted the application_namespace branch March 24, 2015 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants