ashokgelal / townhouse

A multi-tenant Laravel app for listing property rentals
https://medium.com/@ashokgelal/writing-a-full-featured-multi-tenant-laravel-app-from-scratch-a0e1a7350d9d
253 stars 86 forks source link

create tenant error #19

Open rashmika018 opened 5 years ago

rashmika018 commented 5 years ago

When i try to create tenant getting error

tenancy>php artisan tenant:create boise boise@example.com

Symfony\Component\Debug\Exception\FatalThrowableError : Class 'Hyn\Tenancy\Models\Customer' not found

at tenancy\app\Console\Commands\CreateTenant.php:46 42| } 43| 44| private function tenantExists($name, $email) 45| {

46| return Customer::where('name', $name)->orWhere('email', $email)->exists(); 47| } 48| 49| private function registerTenant($name, $email) 50| {

Exception trace:

1 App\Console\Commands\CreateTenant::tenantExists("boise", "boise@example.com") tenancy\app\Console\Commands\CreateTenant.php:27

2 App\Console\Commands\CreateTenant::handle() tenancy\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:29

Please use the argument -v to see more details.

sevillaarvin commented 5 years ago

Have you installed the multi-tenant package? composer require hyn/multi-tenant

rashmika018 commented 5 years ago

i follow all steps you are mention on your blog (https://medium.com/@ashokgelal/a-full-featured-multi-tenant-app-with-laravel-part-1-4049a3cc229) whenever i try to run "php artisan tenant:create boise boise@example.com" this command on my cmd getting above error

rashmika018 commented 5 years ago

Have you installed the multi-tenant package? composer require hyn/multi-tenant

i have already instilled it. but still getting error

sevillaarvin commented 5 years ago

Maybe the version you've installed is > 5.1? As mentioned in the 5.2 docs, the Customer model has been dropped. If you still want to follow the instructions in the blog make sure you have version 5.1. Otherwise, find another tutorial with a more recent version.

P.S. As of today, I can't access the linked medium blog.