diff --git a/app-modules/basic-needs/src/Filament/Actions/SendEmailAction.php b/app-modules/basic-needs/src/Filament/Actions/SendEmailAction.php index 0cb26137cf..be642d74f0 100644 --- a/app-modules/basic-needs/src/Filament/Actions/SendEmailAction.php +++ b/app-modules/basic-needs/src/Filament/Actions/SendEmailAction.php @@ -60,6 +60,7 @@ use Illuminate\Database\Query\Expression; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Auth; +use Livewire\Component; use Livewire\Features\SupportFileUploads\TemporaryUploadedFile; class SendEmailAction @@ -124,7 +125,9 @@ protected static function getContactInformationStep(string $view): Step ->options(fn (Get $get) => self::getRecipientOptions($get)) ->getSearchResultsUsing(fn (string $search, Get $get) => self::getRecipientSearchResults($search, $get)) ->getOptionLabelUsing(fn (string $value, Get $get) => self::getRecipientOptionLabel($value, $get)) - ->afterStateUpdated(function (Get $get, Set $set, mixed $record) use ($view) { + ->afterStateUpdated(function (Get $get, Set $set, Component $livewire) use ($view) { + $record = method_exists($livewire, 'getRecord') ? $livewire->getRecord() : null; + self::updateBodyAndRouteId($get, $set, $record, $view); }) ->live() @@ -157,7 +160,9 @@ protected static function getContentStep(string $view): Step ->disk('s3-public') ->label('Body') ->profile('email') - ->default(function (mixed $record) use ($educatable, $view) { + ->default(function (Component $livewire) use ($educatable, $view) { + $record = method_exists($livewire, 'getRecord') ? $livewire->getRecord() : null; + return view($view, [ 'recipient' => $educatable, 'record' => $record, diff --git a/app-modules/meeting-center/src/Http/Controllers/PersonalBookingPageWidgetController.php b/app-modules/meeting-center/src/Http/Controllers/PersonalBookingPageWidgetController.php index a24442d1c4..b7c6dc2fbe 100644 --- a/app-modules/meeting-center/src/Http/Controllers/PersonalBookingPageWidgetController.php +++ b/app-modules/meeting-center/src/Http/Controllers/PersonalBookingPageWidgetController.php @@ -113,7 +113,7 @@ public function view(Request $request, string $slug): JsonResponse $brandingSettings = app(CollegeBrandingSettings::class); - $colorName = $brandingSettings->color ?? 'blue'; + $colorName = $brandingSettings->color->value ?? 'blue'; $primaryColor = collect(Color::all()[$colorName]) ->map(Color::convertToRgb(...)) ->map(fn (string $value): string => (string) str($value)->after('rgb(')->before(')'))