F
Filament13mo ago
Thijmen

HTTP/HTTPS issues with table.js

Quick setup for our server setup: We run the following on our VPS: - php 8.2 - nginx - mariaDB - Laravel 10.32.1 - filament/filament 3.0-stable We use cloudflare for our DNS which handles our SSL certificate This is all working perfectly and everything works except our mail button, we've created a custom button for this:
Tables\Actions\Action::make('send-confirmation-email')
->label('Send confirmation email')
->icon('heroicon-o-inbox-arrow-down')
->action(function(Booking $booking) {
\Log::info("Sending confirmation email to {$booking->email}");
\Mail::to($booking->email)->send(new TicketBooked($booking->toArray(), $booking->timeslot));
// Notify of success
Notification::make('email-sent')
->title("Email sent to {$booking->email}")
->success()
->send();
}),
Tables\Actions\Action::make('send-confirmation-email')
->label('Send confirmation email')
->icon('heroicon-o-inbox-arrow-down')
->action(function(Booking $booking) {
\Log::info("Sending confirmation email to {$booking->email}");
\Mail::to($booking->email)->send(new TicketBooked($booking->toArray(), $booking->timeslot));
// Notify of success
Notification::make('email-sent')
->title("Email sent to {$booking->email}")
->success()
->send();
}),
It works flawlessly on localhost (using herd) but it appears it does not want to work on our prod server, where we get this error:
async-alpine.js?v=3.0.97.0:1 Mixed Content: The page at 'https://{{URL}}/speelgoedwerkplaats/bookings' was loaded over HTTPS, but requested an insecure script 'http://{{URL}}/js/filament/tables/components/table.js?v=3.0.97.0'. This request has been blocked; the content must be served over HTTPS.
async-alpine.js?v=3.0.97.0:1 Mixed Content: The page at 'https://{{URL}}/speelgoedwerkplaats/bookings' was loaded over HTTPS, but requested an insecure script 'http://{{URL}}/js/filament/tables/components/table.js?v=3.0.97.0'. This request has been blocked; the content must be served over HTTPS.
Our .env has the right url: https://www.{{URL}}/ Does anyone know how to fix this, since our actions died on us like delete+mail
2 Replies
Dennis Koch
Dennis Koch13mo ago
Try setting the ASSSET_URL
Thijmen
ThijmenOP13mo ago
apearantly the other dev managed to fix this by forcing https using Illuminate:
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
+use Illuminate\Support\Facades\URL;

class AppServiceProvider extends ServiceProvider
{
@@ -19,6 +20,6 @@ public function register(): void
*/
public function boot(): void
{
- //
+ URL::forceScheme('https');
}
}
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
+use Illuminate\Support\Facades\URL;

class AppServiceProvider extends ServiceProvider
{
@@ -19,6 +20,6 @@ public function register(): void
*/
public function boot(): void
{
- //
+ URL::forceScheme('https');
}
}
Hope this helps.
Want results from more Discord servers?
Add your server