Skip to content

Commit b3c56ff

Browse files
committed
Updates
1 parent c598597 commit b3c56ff

File tree

2 files changed

+65
-23
lines changed

2 files changed

+65
-23
lines changed

README.md

Lines changed: 64 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,43 +31,86 @@ This is the contents of the published config file:
3131

3232
```php
3333
return [
34+
3435
/*
36+
|--------------------------------------------------------------------------
3537
| Help Article Model
38+
|--------------------------------------------------------------------------
39+
|
40+
| If you extend the HelpArticle model in your application to add custom
41+
| relationships (e.g., tenant relationships), specify your extended model here.
42+
| This ensures Filament resources use your extended model instead of the base model.
43+
|
44+
| Example: \App\Models\HelpArticle::class
45+
|
46+
*/
47+
48+
'model' => \Tapp\FilamentHelp\Models\HelpArticle::class,
49+
50+
/*
51+
|--------------------------------------------------------------------------
52+
| Tenancy Configuration
53+
|--------------------------------------------------------------------------
54+
|
55+
| Configure multi-tenancy settings for help articles.
3656
|
37-
| If you extend the HelpArticle model, specify your extended model here.
38-
| This ensures Filament resources use your extended model.
3957
*/
40-
'model' => env('FILAMENT_HELP_MODEL', \Tapp\FilamentHelp\Models\HelpArticle::class),
4158

4259
'tenancy' => [
43-
// Enable or disable tenancy features globally
60+
/*
61+
* Enable or disable tenancy features globally.
62+
* When enabled, a team_id column will be added to the help_articles table
63+
* and articles will be scoped to the current tenant.
64+
*/
4465
'enabled' => env('FILAMENT_HELP_TENANCY_ENABLED', false),
45-
46-
// The column name for the tenant relationship
47-
'column' => env('FILAMENT_HELP_TENANCY_COLUMN', 'team_id'),
48-
49-
// The tenant model class
66+
67+
/*
68+
* The column name for the tenant relationship.
69+
* This column will be added to the help_articles table if tenancy is enabled.
70+
* E.g. 'team_id'
71+
*/
72+
'column' => env('FILAMENT_HELP_TENANCY_COLUMN', null),
73+
74+
/*
75+
* The tenant model class.
76+
* This should be the same model you use for Filament's tenant feature.
77+
* E.g. \App\Models\Team::class
78+
*/
5079
'model' => null,
51-
52-
// The relationship name on the HelpArticle model
53-
'relationship' => env('FILAMENT_HELP_TENANCY_RELATIONSHIP', 'team'),
54-
55-
// Foreign key constraints
80+
81+
/*
82+
* The relationship name on the HelpArticle model.
83+
* This is used for Filament's tenant ownership relationship.
84+
* E.g. 'team'
85+
*
86+
*/
87+
'relationship' => env('FILAMENT_HELP_TENANCY_RELATIONSHIP', null),
88+
89+
/*
90+
* The foreign key constraint configuration.
91+
*/
5692
'foreign_key' => [
57-
'on_delete' => env('FILAMENT_HELP_TENANCY_ON_DELETE', 'cascade'),
58-
'on_update' => env('FILAMENT_HELP_TENANCY_ON_UPDATE', 'cascade'),
93+
'on_delete' => env('FILAMENT_HELP_TENANCY_ON_DELETE', 'cascade'), // cascade, set null, restrict
94+
'on_update' => env('FILAMENT_HELP_TENANCY_ON_UPDATE', 'cascade'), // cascade, set null, restrict
5995
],
60-
61-
// Enable tenancy scoping per panel type
96+
97+
/*
98+
* Enable tenancy scoping per panel type.
99+
* When false, articles will not be scoped by tenant even if global tenancy is enabled.
100+
*/
62101
'scoping' => [
63102
'admin' => env('FILAMENT_HELP_TENANCY_SCOPE_ADMIN', true),
64103
'frontend' => env('FILAMENT_HELP_TENANCY_SCOPE_FRONTEND', true),
65-
'guest' => env('FILAMENT_HELP_TENANCY_SCOPE_GUEST', false),
104+
'guest' => env('FILAMENT_HELP_TENANCY_SCOPE_GUEST', true),
66105
],
67-
68-
// Automatically assign tenant on creation
106+
107+
/*
108+
* Automatically assign tenant on creation.
109+
* When enabled, new articles will automatically get the current tenant ID assigned.
110+
*/
69111
'auto_assign' => env('FILAMENT_HELP_TENANCY_AUTO_ASSIGN', true),
70112
],
113+
71114
];
72115
```
73116

@@ -233,7 +276,6 @@ Or use environment variables in your `.env` file:
233276

234277
```env
235278
FILAMENT_HELP_TENANCY_ENABLED=true
236-
FILAMENT_HELP_TENANCY_MODEL=App\Models\Team
237279
FILAMENT_HELP_TENANCY_COLUMN=team_id
238280
FILAMENT_HELP_TENANCY_RELATIONSHIP=team
239281
FILAMENT_HELP_TENANCY_SCOPE_ADMIN=true

config/filament-help.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
'scoping' => [
7272
'admin' => env('FILAMENT_HELP_TENANCY_SCOPE_ADMIN', true),
7373
'frontend' => env('FILAMENT_HELP_TENANCY_SCOPE_FRONTEND', true),
74-
'guest' => env('FILAMENT_HELP_TENANCY_SCOPE_GUEST', false),
74+
'guest' => env('FILAMENT_HELP_TENANCY_SCOPE_GUEST', true),
7575
],
7676

7777
/*

0 commit comments

Comments
 (0)