青木
青木
Explore posts from servers
FFilament
Created by Mark Chaney on 3/26/2024 in #❓┊help
CreateAnother Retain Some Data
Is the way you use different from me? I want to know how you do it.
10 replies
FFilament
Created by Mark Chaney on 3/26/2024 in #❓┊help
CreateAnother Retain Some Data
I used a different approach by redirecting the logic about another in the engorged create method.
<?php

namespace App\Filament\Pda\Resources\DataBatchItemResource\Pages;

use App\Filament\Pda\Resources\DataBatchItemResource;
use Filament\Resources\Pages\CreateRecord;
use Filament\Support\Exceptions\Halt;
use Filament\Support\Facades\FilamentView;

use function Filament\Support\is_app_url;

class CreateDataBatchItem extends CreateRecord
{
protected static string $resource = DataBatchItemResource::class;

public function create(bool $another = false): void
{
...

$redirectUrl = $this->getRedirectUrl();

if ($another) {
$resource = static::getResource();

$redirectUrl = $resource::getUrl('create', ['record' => $this->getRecord(), ...$this->getRedirectUrlParameters()]);
}

$this->redirect($redirectUrl, navigate: FilamentView::hasSpaMode() && is_app_url($redirectUrl));
}

protected function mutateFormDataBeforeCreate(array $data): array
{
$data['user_id'] = auth('web')->id();

return parent::mutateFormDataBeforeCreate($data);
}

protected function getRedirectUrlParameters(): array
{
$data = [];

if (isset(request()->query('tableFilters')['batch_id']['batch_id'])) {
$data = ['tableFilters[batch_id][batch_id]' => request()->query('tableFilters')['batch_id']['batch_id']];
}

if (isset($this->form->getRawState()['batch_id'])) {
$data = ['tableFilters[batch_id][batch_id]' => $this->form->getRawState()['batch_id']];
}

return $data;
}
}
<?php

namespace App\Filament\Pda\Resources\DataBatchItemResource\Pages;

use App\Filament\Pda\Resources\DataBatchItemResource;
use Filament\Resources\Pages\CreateRecord;
use Filament\Support\Exceptions\Halt;
use Filament\Support\Facades\FilamentView;

use function Filament\Support\is_app_url;

class CreateDataBatchItem extends CreateRecord
{
protected static string $resource = DataBatchItemResource::class;

public function create(bool $another = false): void
{
...

$redirectUrl = $this->getRedirectUrl();

if ($another) {
$resource = static::getResource();

$redirectUrl = $resource::getUrl('create', ['record' => $this->getRecord(), ...$this->getRedirectUrlParameters()]);
}

$this->redirect($redirectUrl, navigate: FilamentView::hasSpaMode() && is_app_url($redirectUrl));
}

protected function mutateFormDataBeforeCreate(array $data): array
{
$data['user_id'] = auth('web')->id();

return parent::mutateFormDataBeforeCreate($data);
}

protected function getRedirectUrlParameters(): array
{
$data = [];

if (isset(request()->query('tableFilters')['batch_id']['batch_id'])) {
$data = ['tableFilters[batch_id][batch_id]' => request()->query('tableFilters')['batch_id']['batch_id']];
}

if (isset($this->form->getRawState()['batch_id'])) {
$data = ['tableFilters[batch_id][batch_id]' => $this->form->getRawState()['batch_id']];
}

return $data;
}
}
10 replies
TtRPC
Created by 青木 on 3/31/2023 in #❓-help
The type of the second route of the nested route is never
Try to create a nested route using createTRPCRouter
3 replies
FFilament
Created by 青木 on 7/3/2024 in #❓┊help
Images uploaded without the FileUpload component cannot be displayed.
Yes, but they are signed and parameterized completely differently from S3
16 replies
FFilament
Created by 青木 on 7/3/2024 in #❓┊help
Images uploaded without the FileUpload component cannot be displayed.
Thinking about the temporary storage issue, I need files to be uploaded directly to cloud storage for my business, as my server's bandwidth is only 1Mbps, files are not suitable for forwarding storage via laravel.
16 replies
FFilament
Created by 青木 on 7/3/2024 in #❓┊help
Images uploaded without the FileUpload component cannot be displayed.
16 replies
FFilament
Created by 青木 on 7/3/2024 in #❓┊help
Images uploaded without the FileUpload component cannot be displayed.
That's a problem, I'm using an S3-like provider which is not S3.
16 replies
FFilament
Created by 青木 on 7/3/2024 in #❓┊help
Images uploaded without the FileUpload component cannot be displayed.
No description
16 replies
FFilament
Created by 青木 on 7/3/2024 in #❓┊help
Images uploaded without the FileUpload component cannot be displayed.
No description
16 replies
FFilament
Created by 青木 on 7/3/2024 in #❓┊help
Images uploaded without the FileUpload component cannot be displayed.
@Dennis Koch I modified the file storage and it worked fine. Other questions about file uploads regarding OSS storage like s3? 1. the average execution time when requesting a pre-signed URL for a single S3 is 1s . 2. 140 files exist in my data. 3. my Nginx is set to timeout at 1 minute. The upload component of filament puts the call to get the files into one request (even though my files exist in a different component) which causes the request to be very slow until the gateway times out.
16 replies
FFilament
Created by bwurtz999 on 1/24/2024 in #❓┊help
ExportAction 502 Bad Gateway in Staging/Production
@awcodes I'm experiencing the same issue. 1. the average execution time when requesting a pre-signed URL for a single S3 is 1s . 2. 140 files exist in my data. 3. my Nginx is set to timeout at 1 minute. The upload component of filament puts the call to get the files into one request (even though my files exist in a different component) which causes the request to be very slow until the gateway times out.
9 replies
FFilament
Created by 青木 on 8/19/2023 in #❓┊help
How do I submit a form automatically?
I tried this and it auto-submits the form, but I'm not sure if it's elegant.
<x-filament-panels::page.simple>
<x-filament-panels::form wire:submit="register">
{{ $this->form }}

<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
</x-filament-panels::form>
</x-filament-panels::page.simple>

<script>
// Alpine on mounted
document.addEventListener('alpine:initialized', () => {
window.setTimeout(function() {
// check if we have a code in the url
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get('code');
if (code) {
@this.register();
}
}, 300);
})
</script>
<x-filament-panels::page.simple>
<x-filament-panels::form wire:submit="register">
{{ $this->form }}

<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
</x-filament-panels::form>
</x-filament-panels::page.simple>

<script>
// Alpine on mounted
document.addEventListener('alpine:initialized', () => {
window.setTimeout(function() {
// check if we have a code in the url
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get('code');
if (code) {
@this.register();
}
}, 300);
})
</script>
2 replies
FFilament
Created by IndomieRendang on 8/18/2023 in #❓┊help
Redirect login to the last accessed tenant?
try $panel->login(CustonPage:class)
24 replies
FFilament
Created by Proculair B.V. on 8/15/2023 in #❓┊help
Unable to find component: [app.filament.app-panel.pages.edit-tenant-profile]
If you are writing your own pages you should register them in pages. I checked the source code and found that only using $panel->pages([]) registers the page component.
15 replies
FFilament
Created by Proculair B.V. on 8/15/2023 in #❓┊help
Unable to find component: [app.filament.app-panel.pages.edit-tenant-profile]
15 replies
FFilament
Created by Proculair B.V. on 8/15/2023 in #❓┊help
Unable to find component: [app.filament.app-panel.pages.edit-tenant-profile]
How did this work out?
15 replies
FFilament
Created by Ansori on 3/20/2023 in #❓┊help
Is it possible to add navigation on top?
Too empty at the top. Maybe add some links like to the marketplace, blog or help center? Hooked to the left side of the Menu button instead of the right.
17 replies
FFilament
Created by Ansori on 3/20/2023 in #❓┊help
Is it possible to add navigation on top?
How to support both left and top navigation?
17 replies
FFilament
Created by 青木 on 8/16/2023 in #❓┊help
How do I add a route that skips the tenant prefix?
2 replies
TtRPC
Created by 青木 on 6/4/2023 in #❓-help
How does trpc subscription actively close/disconnect in the server?
I am implementing the SSE based subscription feature and I am currently finding issues with not receiving events from client closures in NextJS.
11 replies