We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 188b5fa commit c24f7a0Copy full SHA for c24f7a0
app/Filament/Resources/ResearchSpaceResource/Pages/CreateResearchSpace.php
@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace App\Filament\Resources\ResearchSpaceResource\Pages;
4
5
+use Filament\Resources\Pages\CreateRecord;
6
+use App\Filament\Resources\ResearchSpaceResource;
7
8
+class CreateResearchSpace extends CreateRecord
9
+{
10
+ protected static string $resource = ResearchSpaceResource::class;
11
12
+ protected function beforeCreate(): void
13
+ {
14
+ // Automatically set owner/created_by to currently authenticated user
15
+ $user = auth()->user();
16
+ $this->data['owner_id'] = $user->id;
17
+ $this->data['created_by'] = $user->id;
18
+ }
19
+}
0 commit comments