hipsterjazzbo / Landlord

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

Add disabledFor to disable for duration of callable #90

Open jbrooksuk opened 6 years ago

jbrooksuk commented 6 years ago

This PR adds a new disabledFor method which disables the Landlord scope for the duration of a callable...

Landlord::disabledFor(function () {
    // The scope is now disabled.
});

// At this point, the Landlord scope is now re-enabled.