hipsterjazzbo / Landlord

A simple, single database multi-tenancy solution for Laravel 5.2+
MIT License
614 stars 138 forks source link

Fix compatibility with parent class #41

Closed jscrobinson closed 7 years ago

jscrobinson commented 7 years ago

Fix for https://github.com/HipsterJazzbo/Landlord/issues/39

torkiljohnsen commented 7 years ago

Your code is only compatible with >= 5.3.19.

Check out #42, where I fixed the same issue, but in a way that is compatible with all of 5.3.*.

jimrobinson-croud commented 7 years ago

Thanks @torkiljohnsen, I'd forgotten to pass the $ids parameter to the parent method.

torkiljohnsen commented 7 years ago

@jimrobinson-croud Actually, no: By passing the $ids parameter to the parent method, your code will only work with Laravel >= 5.3.19, since it's only in 5.3.19 and above that the parent method will accept the second parameter.

By not passing the $ids parameter, the code will work with all Laravel 5.3 versions. The parent method will just assume an empty array.

torkiljohnsen commented 7 years ago

Actually, parent::setModel($model); could just be replaced with $this->model = $model;. Less overhead.

jscrobinson commented 7 years ago

Good point. Thanks again @torkiljohnsen