I do a bunch of stuff with PHP & Laravel, which I will endevaour to update this readme with when I can, but right now I'm working on a course for Multitenancy with Laravel.
A laravel package to provide multi-tenancy support
I do a bunch of stuff with PHP & Laravel, which I will endevaour to update this readme with when I can, but right now I'm working on a course for Multitenancy with Laravel.
When calling Multitenancy::url()
the tenant identifier being appended to the end of URL.
Multitenancy::url();
// http://foo.domain.com/foo.domain.com`
Multitenancy::url('/path');
// http://foo.domain.com/path/foo.domain.com`
Hi,
First of all thanks for this awesome package! Love it, probably the best and easiest multitenant package so far.
Everything works perfectly except when using session.multi
driver, after logged in I got following error.
FatalThrowableError in SessionGuard.php line 23:
Call to a member function getPrimaryIdentifier() on null
Hi,
Is it possible that you create a little Demo app for better understanding?
Hello @ollieread thanks for this package. I think it's actually the best Laravel multitenancy package.
Inside your Eloquent global scope TenantOwnedScope
there is a call to an unimplemented method getTenantKey()
to retrieve the FK to the tenant table in the current eloquent model.
public function apply(Builder $builder, Model $model)
{
$builder->where( $model->getTenantKey() , '=', Multitenancy::tenant()->id);
}
It's not implemented and you do not talk about it in documentation. For now I resolved implementing another trait called BelongsToTenant
that use your original eloquent trait and implement getTenantKey()
method.
trait BelongsToTenant
{
use TenantOwned;
public function getTenantKey()
{
return 'company_id';
}
}
I think that tenant FK should be the same in any table and could be a good idea to implement this method yourself in TenantOwned
trait to return a fixed value from config file for example.
if i understand something wrong i thank you if you want to help me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.