Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenkeith authored Jun 11, 2019
1 parent c7f7fc8 commit 3f119ec
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,17 @@ In order to display all related data to the `Tenant` model, you need to first im
```php
// in app/Tenant.php

namespace App\Nova;
namespace App;

use RomegaDigital\Multitenancy\Models\Tenant as TenantModel;
use RomegaDigital\Multitenancy\Traits\BelongsToTenant;

class Tenant extends TenantModel
{
// ... define relationships
public function products()
{
return $this->hasMany(\App\Product::class);
}
public function products()
{
return $this->hasMany(\App\Product::class);
}
}
```

Expand All @@ -128,22 +127,22 @@ use RomegaDigital\MultitenancyNovaTool\Tenant as TenantResource;

class Tenant extends TenantResource
{
public static $model = \App\Tenant::class;

/**
* Get the fields displayed by the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function fields(Request $request)
{
return array_merge(parent::fields($request),
[
// ... define relationships
HasMany::make('Products'),
]);
}
public static $model = \App\Tenant::class;

/**
* Get the fields displayed by the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function fields(Request $request)
{
return array_merge(parent::fields($request),
[
// ... define relationships
HasMany::make('Products'),
]);
}

}
```
Expand Down Expand Up @@ -175,7 +174,7 @@ By default, the Multitenancy resource will only be visible on the `admin` subdom
// ...
protected $policies = [
// ...
\RomegaDigital\Multitenancy\Models\Tenant::class => \App\Policies\TenantPolicy::class,
\RomegaDigital\Multitenancy\Models\Tenant::class => \App\Policies\TenantPolicy::class,
];
```

Expand Down

0 comments on commit 3f119ec

Please sign in to comment.