mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-28 10:24:45 +02:00
Fix mounts
This commit is contained in:
parent
2c98693bd2
commit
30452890f5
@ -3,18 +3,22 @@
|
||||
namespace App\Filament\Resources\MountResource\Pages;
|
||||
|
||||
use App\Filament\Resources\MountResource;
|
||||
use App\Services\Servers\ServerCreationService;
|
||||
use Filament\Forms\Components\Group;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
use Filament\Forms;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class CreateMount extends CreateRecord
|
||||
{
|
||||
protected static string $resource = MountResource::class;
|
||||
|
||||
protected static bool $canCreateAnother = false;
|
||||
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
@ -71,6 +75,7 @@ class CreateMount extends CreateRecord
|
||||
Forms\Components\Textarea::make('description')
|
||||
->helperText('A longer description for this mount.')
|
||||
->columnSpanFull(),
|
||||
Forms\Components\Hidden::make('user_mountable')->default(1),
|
||||
])->columnSpan(1)->columns([
|
||||
'default' => 1,
|
||||
'lg' => 2,
|
||||
@ -94,4 +99,11 @@ class CreateMount extends CreateRecord
|
||||
'lg' => 2,
|
||||
]);
|
||||
}
|
||||
|
||||
protected function handleRecordCreation(array $data): Model
|
||||
{
|
||||
$data['uuid'] ??= Str::uuid()->toString();
|
||||
|
||||
return parent::handleRecordCreation($data);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class Mount extends Model
|
||||
/**
|
||||
* Fields that are not mass assignable.
|
||||
*/
|
||||
protected $guarded = ['id', 'uuid'];
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* Rules verifying that the data being stored matches the expectations of the database.
|
||||
|
Loading…
x
Reference in New Issue
Block a user