spatie / laravel-multitenancy

Make your Laravel app usable by multiple tenants
https://spatie.be/docs/laravel-multitenancy
MIT License
1.11k stars 153 forks source link

Add method`use()` as an alias for `makeCurrent()` #493

Closed newtonjob closed 1 year ago

newtonjob commented 1 year ago

This PR just adds an alias for the makeCurrent() method, as some syntactic sugar.

// To make a tenant the current one, we can currently do this;
$tenant->makeCurrent();

// This PR also let's us do this;
$tenant->use();

The philosophy is inline with the current simple, terse, one word forget() method.

$tenant->forget();

Inspiration: https://youtu.be/592EgykFOz4?t=543 @themsaid

masterix21 commented 1 year ago

Thanks for your time on it, but It’s better to keep the code as clean as possible.