Version 1.0.0
This commit is contained in:
18
app/Filament/Resources/DietResource/Pages/CreateDiet.php
Normal file
18
app/Filament/Resources/DietResource/Pages/CreateDiet.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\DietResource\Pages;
|
||||
|
||||
use App\Filament\Resources\DietResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateDiet extends CreateRecord
|
||||
{
|
||||
protected static string $resource = DietResource::class;
|
||||
|
||||
protected function mutateFormDataBeforeCreate(array $data): array
|
||||
{
|
||||
$data['user_id'] = auth()->id();
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user