Skip to content
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

Scope is not applied when model is instantiated via dependency injection within controller #106

Open
booni3 opened this issue Jan 8, 2019 · 1 comment

Comments

@booni3
Copy link

booni3 commented Jan 8, 2019

The tenant scope is not applied when instantiating the model as follows:

class OrderController extends Controller
{
    protected $order;
    
    public function __construct(Order $order)
    {
        $this->order = $order;
    }

...

but...

Order::all() // works fine

This is not a huge issue, when you know this is the case, but does anyone know why or of any work arounds to it?

@jiriko
Copy link

jiriko commented Jul 23, 2019

Maybe you can move the \Illuminate\Routing\Middleware\SubstituteBindings::class away from the global middleware and set it after your Landlord middleware.

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

No branches or pull requests

2 participants