File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace App \Models ;
4+
5+ use App \Traits \BelongsToTenant ;
6+ use Illuminate \Database \Eloquent \Factories \HasFactory ;
7+ use Illuminate \Database \Eloquent \Model ;
8+ use Illuminate \Database \Eloquent \SoftDeletes ;
9+ use Illuminate \Database \Eloquent \Relations \HasMany ;
10+ use Illuminate \Database \Eloquent \Relations \BelongsTo ;
11+
12+ class ResearchSpace extends Model
13+ {
14+ use HasFactory, SoftDeletes, BelongsToTenant;
15+
16+ protected $ fillable = [
17+ 'name ' ,
18+ 'slug ' ,
19+ 'description ' ,
20+ 'owner_id ' ,
21+ 'is_private ' ,
22+ 'settings ' ,
23+ 'created_by ' ,
24+ 'team_id ' ,
25+ ];
26+
27+ protected $ casts = [
28+ 'is_private ' => 'boolean ' ,
29+ 'settings ' => 'array ' ,
30+ ];
31+
32+ public function owner (): BelongsTo
33+ {
34+ return $ this ->belongsTo (User::class, 'owner_id ' );
35+ }
36+
37+ public function collaborators (): HasMany
38+ {
39+ return $ this ->hasMany (ResearchSpaceCollaborator::class);
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments