johny7
johny7
FFilament
Created by johny7 on 1/9/2025 in #❓┊help
Filament exports under fly.io
Hello everyone. Many thanks, @nanopanda , for the hint. With FILAMENT_FILESYSTEM_DISK the obligatory ->disk() is omitted. In addition, the CORS configuration was still missing from my Tigris bucket. I have now added this. The upload and deletion now work, but not the display of the preview in edit mode. I solved the display via a controller due to authorization issues. But in edit mode I get a CORS error for the retrieved image. My browser sends the following request:
GET /proben/01JJ2W97NFGPK757N74YHPQFJX.jpg HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,ru;q=0.6
Connection: keep-alive
Host: vivo-app.fly.storage.tigris.dev
Origin: http://127.0.0.1:9000
Referer: http://127.0.0.1:9000/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
sec-ch-ua: "Not A(Brand";v="8", "Chromium";v="132", "Google Chrome";v="132"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
GET /proben/01JJ2W97NFGPK757N74YHPQFJX.jpg HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,ru;q=0.6
Connection: keep-alive
Host: vivo-app.fly.storage.tigris.dev
Origin: http://127.0.0.1:9000
Referer: http://127.0.0.1:9000/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
sec-ch-ua: "Not A(Brand";v="8", "Chromium";v="132", "Google Chrome";v="132"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
The answer is:
HTTP/1.1 403 Forbidden
Content-Length: 294
Content-Type: application/xml
Server: Tigris OS
Server-Timing: total;dur=0
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Amz-Request-Id: 1737412527718410340
Date: Mon, 20 Jan 2025 22:35:27 GMT
HTTP/1.1 403 Forbidden
Content-Length: 294
Content-Type: application/xml
Server: Tigris OS
Server-Timing: total;dur=0
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Amz-Request-Id: 1737412527718410340
Date: Mon, 20 Jan 2025 22:35:27 GMT
I have already configured my bucket for test purposes so that * is set for all origins, methods and headers, and the max age is set to 86400. Anyone have any idea what I'm doing wrong? Do I need to configure anything else in my app? Thanks in advance!
12 replies
FFilament
Created by johny7 on 1/9/2025 in #❓┊help
Filament exports under fly.io
@toeknee: I use the filament form in a resource. I had previously set FILESYSTEM_DISK in both the .env and fly.toml. But even locally in my dev environment the error occurs when I configure my form component as follows:
Forms\Components\FileUpload::make('probenplan')
->moveFiles()
->directory('proben')
->image()
Forms\Components\FileUpload::make('probenplan')
->moveFiles()
->directory('proben')
->image()
I always have to set the following for it to work:
Forms\Components\FileUpload::make('probenplan')
->disk('local')
->moveFiles()
->directory('proben')
->image()
Forms\Components\FileUpload::make('probenplan')
->disk('local')
->moveFiles()
->directory('proben')
->image()
And then it only works as long as FILESYSTEM_DISK=local is set. As soon as I set this to s3, it doesnt matter what I write in ->disk(). But I havent actually worked with FILAMENT_FILESYSTEM_DISK yet, I`ll test it out.
12 replies
FFilament
Created by johny7 on 1/9/2025 in #❓┊help
Filament exports under fly.io
Now I'm still having difficulties: If I simply create a file via Storage::put(), everything works perfectly. But with FilamentForm and FileUpload it won't work, the upload gets stuck. I have now started to test different scenarios with FILESYSTEM_DISK=local and =s3. Even with local it does not work, I always have to pass ->disk() to the FormComponent. If I try this for s3, it hangs completely, even when uploading the file, even before submitting the form. No entries are generated in the log. I already thought there were difficulties in writing the upload stream directly to tigris. So I set ->disk('local'), but if FILESYSTEM_DISK=s3 is set, Filament does not even try to upload locally (storage/app/livewire-tmp remains empty). What am I doing wrong? Does anyone have an idea? @toeknee, would you be so kind? Thanks in advance! JN
12 replies
FFilament
Created by johny7 on 1/9/2025 in #❓┊help
Filament exports under fly.io
Thank you very much, that was a crucial hint! I have now read up on it and experimented with it a little. That's exactly what I need! I now have a clean way of accessing persistent data from different machines. I still don't want to run a separate job for mini-exports, but via “sync”. Can anyone tell me why I get this error message when I run it on fly.io? Do I have to configure something in relation to CORS, and if so, where? Many thanks and best regards Johannes Nazarov
12 replies
FFilament
Created by johny7 on 10/14/2024 in #❓┊help
Auto-Closing extraModalFooterAction is buggy
No one who can help me here? Or is this a bug?
3 replies
FFilament
Created by johny7 on 9/27/2024 in #❓┊help
Filament favicon is not embedded via https
Thank you, after I set ASSET_URL, the favicon is accessible. Also Facades\URL::forceScheme('https') had no effect before.
8 replies
FFilament
Created by johny7 on 9/27/2024 in #❓┊help
Filament favicon is not embedded via https
I actually didn't realize that I was overwriting any paths. Where and how could that be?
8 replies
FFilament
Created by johny7 on 9/27/2024 in #❓┊help
Filament favicon is not embedded via https
No one there who can help me? If I have found out correctly, the layout for this is under vendor\filament\filament\resources\views\components\layout\base.blade.php. The first lines (up to the integration of the favicon) look like this:
@props([
'livewire' => null,
])

<!DOCTYPE html>
<html
lang="{{ str_replace(‘_’, ‘-’, app()->getLocale()) }}”
dir="{{ __(‘filament-panels::layout.direction’) ?? 'ltr' }}”
@class([
'fi min-h-screen',
'dark' => filament()->hasDarkModeForced(),
])
>
<head>
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::HEAD_START, scopes: $livewire->getRenderHookScopes()) }}

<meta charset=“utf-8” />
<meta name=“csrf-token” content=“{{ csrf_token() }}” />
<meta name=“viewport” content=“width=device-width, initial-scale=1” />

@if ($favicon = filament()->getFavicon())
<link rel=“icon” href=“{{ $favicon }}” />
@endif
@props([
'livewire' => null,
])

<!DOCTYPE html>
<html
lang="{{ str_replace(‘_’, ‘-’, app()->getLocale()) }}”
dir="{{ __(‘filament-panels::layout.direction’) ?? 'ltr' }}”
@class([
'fi min-h-screen',
'dark' => filament()->hasDarkModeForced(),
])
>
<head>
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::HEAD_START, scopes: $livewire->getRenderHookScopes()) }}

<meta charset=“utf-8” />
<meta name=“csrf-token” content=“{{ csrf_token() }}” />
<meta name=“viewport” content=“width=device-width, initial-scale=1” />

@if ($favicon = filament()->getFavicon())
<link rel=“icon” href=“{{ $favicon }}” />
@endif
Does anyone know how I can find out which controller is used to call up this layout?
8 replies
FFilament
Created by johny7 on 10/19/2023 in #❓┊help
GMail Mailer for laravel/filament
Found it now by myself via https://medium.com/@laraveltuts/how-to-send-mail-using-gmail-in-laravel-9-76d110779a4a You have to create an App Password via https://myaccount.google.com/apppasswords and can use it in .envlike:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_PASSWORD="the created app password"
MAIL_ENCRYPTION=ssl
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_PASSWORD="the created app password"
MAIL_ENCRYPTION=ssl
4 replies
FFilament
Created by _jimmy on 10/24/2023 in #❓┊help
Controlling modals in an action
Have you tried to use validation instead?
6 replies
FFilament
Created by Xiquita on 10/24/2023 in #❓┊help
Select Disable when published
Your condition says, the Select brand_id should be disabled, when it's own value is brand_id. I think, when you select an option from the relationship brands, you will get an integer ID of the brand, but never the value brand_id. So your condition will never match. Maybe
->disableOptionWhen(fn (string $value):bool => $value!==null),
->disableOptionWhen(fn (string $value):bool => $value!==null),
is, what you are seeking for, because the value will be null, when brand_id is not set.
25 replies
FFilament
Created by johny7 on 10/10/2023 in #❓┊help
How to call the second action after submitting the first action-form?
Of course, here you are:
<?php

namespace App\Filament\Resources\ProbeResource\Pages;

use App\Filament\Resources\ProbeResource;
use Filament\Resources\Pages\EditRecord;
use Filament\Actions;

class EditProbe extends EditRecord
{
protected static string $resource = ProbeResource::class;

protected function getHeaderActions(): array
{
return [
Actions\Action::make("awl")
->form([
# Form Data here
])
->extraModalFooterActions(function (Actions\Action $action) {
return [
$action->make('save')
->action(function () {
$data = $this->mountedActionsData[0]['anwesenheiten']; // Get Form Data
Anwesenheit::upsert($data, ['id']); // Save Form Data
})
->close(true),
Actions\Action::make('saveNjump')
->action(function () {
$data = $this->mountedActionsData[0]['anwesenheiten']; // Get Form Data
Anwesenheit::upsert($data, ['id']); // Save Form Data
$this->replaceMountedAction("targetaction", []); // jump to next Action
})
];
}),
// Other Header Actions
];
}
}
<?php

namespace App\Filament\Resources\ProbeResource\Pages;

use App\Filament\Resources\ProbeResource;
use Filament\Resources\Pages\EditRecord;
use Filament\Actions;

class EditProbe extends EditRecord
{
protected static string $resource = ProbeResource::class;

protected function getHeaderActions(): array
{
return [
Actions\Action::make("awl")
->form([
# Form Data here
])
->extraModalFooterActions(function (Actions\Action $action) {
return [
$action->make('save')
->action(function () {
$data = $this->mountedActionsData[0]['anwesenheiten']; // Get Form Data
Anwesenheit::upsert($data, ['id']); // Save Form Data
})
->close(true),
Actions\Action::make('saveNjump')
->action(function () {
$data = $this->mountedActionsData[0]['anwesenheiten']; // Get Form Data
Anwesenheit::upsert($data, ['id']); // Save Form Data
$this->replaceMountedAction("targetaction", []); // jump to next Action
})
];
}),
// Other Header Actions
];
}
}
8 replies
FFilament
Created by johny7 on 10/10/2023 in #❓┊help
How to call the second action after submitting the first action-form?
This works very fine! Just had to use Action::make() instead of $action->makeModalSubmitAction()
8 replies
FFilament
Created by johny7 on 10/10/2023 in #❓┊help
How to call the second action after submitting the first action-form?
Thank you very much, I'll try this.
8 replies
FFilament
Created by MRBUG on 10/10/2023 in #❓┊help
clickable widget with filter
Add to your Stat::-Methods the following:
->extraAttributes([
'wire:click' => 'goToProject()'
])
->extraAttributes([
'wire:click' => 'goToProject()'
])
And in your WidgetClass define a new function:
function goToProject()
{
redirect(ProjectResource::getUrl());
}
function goToProject()
{
redirect(ProjectResource::getUrl());
}
4 replies
FFilament
Created by AngryTestie on 10/10/2023 in #❓┊help
How to set the Dashboard columns to 3 using custom widgets
In my case
class Dashboard extends BasePage
{
public function getColumns(): int | string | array
{
return 1;
}

}
class Dashboard extends BasePage
{
public function getColumns(): int | string | array
{
return 1;
}

}
works properly.
14 replies
FFilament
Created by johny7 on 9/29/2023 in #❓┊help
Use filament custom theme without npm/node
I found the error: file public\hot coontains http://[::1]:5173/, after deleting it, the right references appears.
14 replies
FFilament
Created by johny7 on 9/29/2023 in #❓┊help
Use filament custom theme without npm/node
Hm. When I run npm run buildI became a broken template. Running npm run devthe vite server is runs and I get a working template. Shuting down the vite server, the template brokes. Using ->viteTheme('resources/css/filament/app/theme.css')in the PanelServiceProvider my template references assets at the vite server:
<script type="module" src="http://[::1]:5173/@vite/client"></script>
<link rel="stylesheet" href="http://[::1]:5173/resources/css/filament/app/theme.css" />
<script type="module" src="http://[::1]:5173/@vite/client"></script>
<link rel="stylesheet" href="http://[::1]:5173/resources/css/filament/app/theme.css" />
So how can I use my template without an active vite-server? The generated assets at public\build... aren't used anywhere. What I'm doing wrong?
14 replies
FFilament
Created by johny7 on 9/29/2023 in #❓┊help
Use filament custom theme without npm/node
For my understanding: Into which directories is compiling done with npm run dev or npm run build?
14 replies
FFilament
Created by johny7 on 9/29/2023 in #❓┊help
Use filament custom theme without npm/node
This is just the only one that offers me the required scope of services for free.
14 replies