archtechx / tenancy

Automatic multi-tenancy for Laravel. No code changes needed.
https://tenancyforlaravel.com
MIT License
3.56k stars 424 forks source link

v4 Roadmap #654

Open stancl opened 3 years ago

stancl commented 3 years ago

Update: Version 4 is now in early access, see the #announcements channel on our Discord

Hey everyone,

Soon (in a few weeks) I'll start working on the next major version of Tenancy for Laravel.

v3 has worked extremely well, with me writing most of the code in spring 2020 and very few changes being needed for a year. The core is really solid.

That said, there's always room for improvement, which is what version 4 be focused on.

Currently, I have these changes planned:

In short, the major version won't have too many changes, and most will be quality of life improvements.

But those are my plans. If you would like to see any new features or changes, please share them below. I'd love to hear any feature suggestions or other feedback, because I'll be working a lot on the package now, and I'll have a chance to work on features that would normally not be possible to add due to breaking changes.

Thank you!

CodeSkills commented 2 years ago

Is it really necessary to support L9 only in v4? I think that we are not the only one who would love to already upgrade to L9 even with v3 with L9 support, what are the concrete (potentially complex) changes that need to be done?

I think that if you would make a list of the tasks needed for L9 to be done, the community would help with PRs for them.

I don't want to sound pushy or anything, but v4 looks like it won't be any time soon, so it would be nice to consider the option above.

Even Laravel Nova just updated their v3 to support L9 even when there is a full workload on v4 which will come in later on.

eugenefvdm commented 2 years ago

In my opinion the topic of L9 support is mute. The reason is doing your own upgrade from 8 to 9 is really not such a big deal. It's a bit technical, but if you're lazy like me you just use Laravel Shift. I upgraded V3 of the boilerplate from L7 to L8 when that wasn't available yet, and it worked perfectly. I'm quite sure just sending it through Shift again will do the job. Then once the "official" upgrade happens it shouldn't be that hard to compare notes. Anyway, just me 2c.

stancl commented 2 years ago

what are the concrete (potentially complex) changes that need to be done?

The main thing is updating the filesystem bootstrapper to use the new flysystem. There are different versions in L8 and L9, with completely different syntax. So if v3 were to support it, it'd need to check the Laravel version and execute different code.

If you'd like to see L9 support in v3, you can contribute the bootstrapper and I'll see if there are any other large changes needed.

CodeSkills commented 2 years ago

After reviewing the Filesystem bootstrapper i don't think there is much to upgrade if at all. Will try to look into it more later :-)

stancl commented 2 years ago

Also see https://github.com/thephpleague/flysystem/issues/1389

scaabel commented 2 years ago

@CodeSkills how far along are you with the upgrades? If you need help feel free to hit me up.

michaelnabil230 commented 2 years ago

When is a version that supports Laravel 9 expected to be released? @stancl

stancl commented 2 years ago

If someone wants to PR the needed changes to make v3 work with L9 (w/ backwards compatibility), v3 can support L9 earlier.

Otherwise, it'll be either when I find some extra time (probably in the weeks after next week) to try adding this, or in v4.

Yunlong2cn commented 2 years ago
// Storage facade
Storage::forgetDisk($this->app['config']['tenancy.filesystem.disks']);
foreach ($this->app['config']['tenancy.filesystem.disks'] as $disk) {

    $root = $this->app['config']["filesystems.disks.{$disk}.root"];

    $this->originalPaths['disks'][$disk] = $root;

    if (!$root = str_replace(
        '%storage_path%',
        storage_path(),
        $this->app['config']["tenancy.filesystem.root_override.{$disk}"] ?? ''
    )) {
        $root .= '/' . $suffix;
    }

    $this->app['config']["filesystems.disks.{$disk}.root"] = $root;
}

Is it necessary to keep the adapter?

stancl commented 2 years ago

Yeah, it's because changing the config has no effect on already instantiated disks.

From the flysystem issue I linked, my impression is that in the latest version we'll have to use Reflection to change the prefix that way. Or, destruct the disk and let it be constructed again (as the flysystem maintainer suggested), but I don't know if that has any performance drawbacks.

CodeSkills commented 2 years ago

We are using this in our old app with another tenancy package for laravel as @Yunlong2cn mentioned, without any drawbacks.

By forgetting the drive it is destroyed, as since the config has changed, the next time it gets requested, new instance of that disk is made with an updated config. Would say the impact is none, to my knowledge.

stancl commented 2 years ago

You can try to send a PR

gisostallenberg commented 2 years ago

it'd need to check the Laravel version and execute different code

You could separate this in a package and make 2 versions with different framework requirements, just an idea...

I'd go for upgrading to v4 anyway. Thanks for your work on this!

Oxicode commented 2 years ago

Any news?

Eduardowm commented 2 years ago

News?

stancl commented 2 years ago

For L9 support, I'd like to merge https://github.com/archtechx/tenancy/pull/802 but there are some remaining changes to be made. If the author doesn't have time for that I'll look into it myself later this week

woganmay commented 2 years ago

If you need some help with this @stancl please shout - we're really keen to use Tenancy for a new L9 project this week, more than happy to help!

stancl commented 2 years ago

Looking at #802 I think I can get it ready tomorrow. That said, I'd love #793 to be finished because the builds are slightly broken according to some reports. Erik doesn't have time to finish it now, but if someone could fork his changes and submit a PR implementing what I mentioned in the comments, that'd make the #802 changes a lot more stable as well.

stancl commented 2 years ago

As I commented here https://github.com/archtechx/tenancy/pull/802#issuecomment-1061293582, I'd really appreciate if someone could test 3.x-dev with a real world S3 setup. I'll be tagging a release tomorrow morning, so this would help a lot. Thanks!

stancl commented 2 years ago

3.5.2 released with Laravel 9 support 🚀

eskiesirius commented 2 years ago

Any updates in v4? i would like to use this in my future projects.. thank you so much!

HelloAlexPan commented 2 years ago

Please prioritise faster test execution, ref #250

abishekrsrikaanth commented 2 years ago

Will v4 support Octane? And if so, will both Swoole and Roadrunner be supported?

We're building a new app using Octane at the moment and would love an easy way to add multi-tenancy.

@binaryfire Do you currently face any issues using Tenancy with Octane? I see you have requested support and wanted to understand if there is anything that is not presently working when using tenancy with Octane? I want to use it as well and would like to know how your experience has been?

binaryfire commented 2 years ago

@abishekrsrikaanth Hey there. Haven't started using the package yet so I can't say. We're waiting on v4 before we add multi tenancy to our app.

stancl commented 2 years ago

🚀 We're starting work on v4 now. If you'd be interested in beta/early access, please email me at samuel+v4@archte.ch

Right now I'm specifically looking for people who are:

Later on all sponsors will get early access to it, weeks before the main release ❤️

Thanks a lot!

stancl commented 2 years ago

Full announcement: https://archte.ch/blog/june-2022-update

anburocky3 commented 2 years ago

Full announcement: https://archte.ch/blog/june-2022-update

Any ETA?

bdsumon4u commented 2 years ago

Full announcement: https://archte.ch/blog/june-2022-update

We're very excited. Can you please tell us an estimated time of arrival?

Allgoodnamesargone commented 2 years ago

What's up with the Octane support? I have seen several benchmarks indicating it makes application at least 3x faster. But i prefer my largely used application be slower than buggy and messy.

And oh, THANKS for the package and the continuous support.

stancl commented 2 years ago

Octane support is something we want to look into but it probably won't be an official/guaranteed feature.

I don't think Octane has that much benefit in production apps.

it makes application at least 3x faster

It might speed up your application, but the main part that slows down production apps is the network, not the app. The app can take 30ms to compute a response but you'll be dealing with 100ms request latency.

J5Dev commented 2 years ago

While I may seem like I am asking for an ETA on V4 (an I maybe kind of am, lol), but we are wanting to start working on an iteration of our existing application which supports MT, and of course would love to be using this package as a number of our team have used it before, so have an aspect of trust with it's capabilities.

My issue is timelines and company expectancy. I would love to just hold fire and go at V4 from the off as it would of-course be cleaner, however I also don't want to have a team idling while we wait for the release... hence my following question.

Given the ETA could be some time (I'd rather it was and not have you guys overworked and rushing stuff out), then what is the current thought on what the upgrade path will look like from V3 -> V4? As in, would it be viable to start a new project now on V3, and just do the upgrade when V4 lands given it would be a minimal upgrade, or, would we potentially face a 'easier to redo it all' situation when V4 lands due to a more complex upgrade path.

Very keen to hear your thoughts on that side of things... or an ETA date of course 😜

Many Thanks

stancl commented 2 years ago

The upgrade path will definitely be very straightforward, especially with multi-db tenancy

J5Dev commented 2 years ago

The upgrade path will definitely be very straightforward, especially with multi-db tenancy

Thank you very much for clarifying, I will get started and look forward to getting stuck into the package :)

ollivr commented 2 years ago

Hello, I was an early sponsor and also the boilerplate . I'd love to take a look at the early access version if possible.

Thanks,

Erik

captchapays commented 1 year ago

Full announcement: https://archte.ch/blog/june-2022-update

Any estimated time of arrival, please please please?

stancl commented 1 year ago

Early access to v4 for sponsors likely within a few weeks

wskeee commented 1 year ago

Hey, it's great to use your code. One small suggestion I have for using this is that when you customize the tenant_id field, it can be placed in the configuration file so that you don't have to worry about it being replaced when the code is updated.


If you'd like to customize the column name to use e.g. team_id instead of tenant_id — if that makes more sense given your business terminology — you can do that by setting this static property in a service provider or some such class:

use Stancl\Tenancy\Database\Concerns\BelongsToTenant;

BelongsToTenant::$tenantIdColumn = 'team_id';

Note that this is universal to all your primary models, so if you use team_id somewhere, you use it everywhere — you can't use both team_id and tenant_id.```
stancl commented 1 year ago

Static properties used for configuration are of course equally backwards compatible as normal config keys, so there'd be no difference. But yes, in v4 we moved a bunch of them to the config file.

eskiesirius commented 1 year ago

Can't wait for the v4..

atapatel commented 1 year ago

Eagerly Waiting for V4

bdsumon4u commented 1 year ago

Waiting...

stancl commented 1 year ago

As mentioned on Discord, early access for sponsors will be opening before the end of this month.

sinamiandashti commented 1 year ago

is octane supported or not?

stancl commented 1 year ago

Locking this now since v4 early access is open to sponsors. New feature ideas can be submitted as issues or mentioned in #tenancy on Discord.

For details about the early access, see #announcements on our Discord: https://archte.ch/discord

stancl commented 6 months ago

v4 is now mostly finished, we're working on the final major feature now. After that it's just some refactoring, writing new documentation, and working on the new boilerplate.

stancl commented 1 month ago

Current status: https://flow.archte.ch/tenancy/tenancy-v4-saas-boilerplate-v2