hipsterjazzbo / Landlord

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

Creating new Tenant scoped Models #91

Closed dneykov closed 6 years ago

dneykov commented 6 years ago

Hi,

creating scoped models is not working properly only saves the tenant_id but not other columns. Here is my example:

Language::create([
    'name'=>'bg',
    'locale'=>'bg'
]);

If I initialize the model first then is working:

$language = new Language();
$language->name = 'bg';
$language->locale = 'bg';
$language->save();
HelgeSverre commented 6 years ago

Is your fillables configured?

On Dec 30, 2017 17:48, "Daniel Neykov" notifications@github.com wrote:

Hi,

creating scoped models is not working properly only saves the tenant_id but not other columns. Here is my example:

Language::create([ 'name'=>'bg', 'locale'=>'bg' ]);

If I initialize the model first then is working:

$language = new Language(); $language->name = 'bg'; $language->locale = 'bg'; $language->save();

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/HipsterJazzbo/Landlord/issues/91, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCgdNmHm-T9aDTijQQkr6FHZ5klTjpjks5tFmlOgaJpZM4RPpAX .

dneykov commented 6 years ago

Yes they are but I had stupid typo...

Thanks.

HelgeSverre commented 6 years ago

You're welcome :)