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

Landlord does not work in Laravel 5.6 #98

Open
jackrsantana opened this issue Mar 29, 2018 · 1 comment
Open

Landlord does not work in Laravel 5.6 #98

jackrsantana opened this issue Mar 29, 2018 · 1 comment

Comments

@jackrsantana
Copy link

Hello

I'm trying to use LandLord in a Laravel 5.6 project but it refuses to work.

Follow the steps I've taken.

1-I changed the composer.json file as indicated in issue #93:
https://i.imgur.com/UXgnqdG.png

2-I added the entries in the file config / app.php
https://i.imgur.com/TN3ZbL1.png
https://i.imgur.com/IEADLG5.png

3-I ran the composer update command followed by the php artisan vendor command: publish --provider = "HipsterJazzbo\Landlord\LandlordServiceProvider"

4-I created a Middleware to add the necessary tenants:
https://i.imgur.com/9NiwEJC.png

5-Add it to Kernel.php:
https://i.imgur.com/4Hotu9W.png

6-I added the middleware of the routes:
https://i.imgur.com/O3n6R2P.png

7-I added in the uses of the model the dependence of Landlord:
https://i.imgur.com/J9zRt6g.png

However, it does not filter the records according to the company:
https://i.imgur.com/iSr8eKt.png

If I think to print the current tenant, you will see that the value of it is different from the value of the service that is returned:
https://i.imgur.com/ve5mtee.png

The strange thing is that I configured the landlord last week in another project and if I'm not mistaken, I performed exactly the same steps, however, the project was Laravel 5.4

If anyone has any suggestions, please tell me.

@gustavonecore
Copy link

@jackrsantana I had the same issue, and the problem is that you are using the key company_id in your middleware as tenant_id name, but the default app/config/landlord.php file uses tenant_id as key.
Make the change to match both setups and should work ok.

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