Skip to content

Commit 34e34a7

Browse files
Merge pull request #1404 from delicatacurtis/patch-26
Create ResearchSpace.php
2 parents 45d8839 + 65e81ec commit 34e34a7

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

app/Models/ResearchSpace.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
}

0 commit comments

Comments
 (0)