public function canAccessPanel(Panel $panel): bool { $userRole = $this->roles()->first()->name; $currentPanel = filament()->getCurrentPanel()->getId(); if ($currentPanel === $userRole)) { return true; } return false; }
->multiple()
$table->id(); $table->foreignId('user_id')->constrained()->onDelete('cascade'); $table->json('attachments')->nullable(); // for FileUpload multiable // Other Columns $table->timestamps();
protected $casts = [ 'attachments' => 'array' ]; public function user(): BelongsTo { return $this->belongsTo(User::class); }
public function profile(): HasOne { return $this->HasOne(Profile::class); }
->schema([ FileUpload::make('attachments')) ->multiple(), ]),