Sayy
Sayy
FFilament
Created by Sayy on 11/10/2024 in #❓┊help
how to handle widget with multiple dashboard ?
No description
10 replies
FFilament
Created by Sayy on 10/3/2024 in #❓┊help
how to custom actions on editing record
how custom actions if the actions on editing record, because after click custom action not update, and i want to generate pdf after that
Action::make('customAction')
->label('SIMPAN & CETAK')
->button()
->color('primary')
->action(function () {
$data = $this->form->getState();

$this->getSaveFormAction();

$dataOrder = Order::where('order_number', $data["order_number"])->with('customer', 'orderDetails')->get();
//dd($dataOrder);
$pdf = Pdf::loadView('pdf.print-order-create', [
'order' => $dataOrder,
]);

return response()->streamDownload(function () use ($pdf) {
echo $pdf->stream();
}, 'Faktur Pembayaran - ' . $data["order_number"] . '.pdf');
}),
Action::make('customAction')
->label('SIMPAN & CETAK')
->button()
->color('primary')
->action(function () {
$data = $this->form->getState();

$this->getSaveFormAction();

$dataOrder = Order::where('order_number', $data["order_number"])->with('customer', 'orderDetails')->get();
//dd($dataOrder);
$pdf = Pdf::loadView('pdf.print-order-create', [
'order' => $dataOrder,
]);

return response()->streamDownload(function () use ($pdf) {
echo $pdf->stream();
}, 'Faktur Pembayaran - ' . $data["order_number"] . '.pdf');
}),
already using getsaveformaction but not update
3 replies
FFilament
Created by Sayy on 8/21/2024 in #❓┊help
Getting error display-text filter datepicker
No description
3 replies
FFilament
Created by Sayy on 8/7/2024 in #❓┊help
how to custom actions on create record
No description
27 replies
FFilament
Created by Sayy on 6/13/2024 in #❓┊help
how to get data relationship from table text column in description
No description
10 replies
FFilament
Created by Sayy on 5/24/2024 in #❓┊help
how to get data from input with custom page
i want get my data from input like this, with wire:model
<x-table.td>
<input
class="w-15 text-xs h-8 dark:bg-zinc-800 dark:text-white rounded-md border shadow-sm border-zinc-200 dark:border-zinc-700"
type="number"
value="{{ $orderDetail->harga_awal }}"
name="harga_awals"
wire:model="harga_awals"
/>
</x-table.td>
<x-table.td>
<input
class="w-15 text-xs h-8 dark:bg-zinc-800 dark:text-white rounded-md border shadow-sm border-zinc-200 dark:border-zinc-700"
type="number"
value="{{ $orderDetail->harga_awal }}"
name="harga_awals"
wire:model="harga_awals"
/>
</x-table.td>
and then i got error like this
Typed property App\Filament\Resources\TransaksiPembelianResource\Pages\CreateTransactionPembelian::$harga_awals must not be accessed before initialization
Typed property App\Filament\Resources\TransaksiPembelianResource\Pages\CreateTransactionPembelian::$harga_awals must not be accessed before initialization
my resource like this already to iniatialization
class CreateTransactionPembelian extends Page implements HasForms
{
use InteractsWithForms;

protected static string $resource = TransaksiPembelianResource::class;

protected static string $view = 'filament.resources.transaksi-pembelian-resource.pages.create-transaction-pembelian';

public TransaksiPembelian $record;
public mixed $selectedProduct;
public int $quantityValue = 1;
public int $discount = 0;
public int $harga_awals;

public function getTitle(): string
{
return "Kode Transaksi: {$this->record->transaksi_number}";
}

public function updateQuantity(TransaksiPembelianDetail $transaksiDetail, $quantity): void
{
if ($quantity > 0) {
$transaksiDetail->update([
'quantity' => $quantity,
'harga_awal' => $this->harga_awals,
//'discount' => $this->discount,
'harga_akhir' => $transaksiDetail->harga_awal * $quantity,
]);
}
}
class CreateTransactionPembelian extends Page implements HasForms
{
use InteractsWithForms;

protected static string $resource = TransaksiPembelianResource::class;

protected static string $view = 'filament.resources.transaksi-pembelian-resource.pages.create-transaction-pembelian';

public TransaksiPembelian $record;
public mixed $selectedProduct;
public int $quantityValue = 1;
public int $discount = 0;
public int $harga_awals;

public function getTitle(): string
{
return "Kode Transaksi: {$this->record->transaksi_number}";
}

public function updateQuantity(TransaksiPembelianDetail $transaksiDetail, $quantity): void
{
if ($quantity > 0) {
$transaksiDetail->update([
'quantity' => $quantity,
'harga_awal' => $this->harga_awals,
//'discount' => $this->discount,
'harga_akhir' => $transaksiDetail->harga_awal * $quantity,
]);
}
}
i just want to get data harga_awal and then calculate with harga_akhir then data will be show to custom page input
83 replies
FFilament
Created by Sayy on 5/22/2024 in #❓┊help
How to get data if status active
i want to get select data from supplier name, but i just get if status active and how to get the data ?
Forms\Components\Select::make('suppliers_id')

->relationship('suppliers', 'name')

->options(fn (Suppliers $state) => $state->status == 'active')

->required(),
Forms\Components\Select::make('suppliers_id')

->relationship('suppliers', 'name')

->options(fn (Suppliers $state) => $state->status == 'active')

->required(),
5 replies
FFilament
Created by Sayy on 5/21/2024 in #❓┊help
Header Panels
my header why like this ? how to fix panel header already php artisan optimize still like this ?
return $panel
->default()
->id('app')
->path('/app')
->login()
->colors([
'primary' => Color::Blue,
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
])
->sidebarCollapsibleOnDesktop()
->viteTheme('resources/css/filament/app/theme.css');
return $panel
->default()
->id('app')
->path('/app')
->login()
->colors([
'primary' => Color::Blue,
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
])
->sidebarCollapsibleOnDesktop()
->viteTheme('resources/css/filament/app/theme.css');
11 replies
FFilament
Created by Sayy on 5/16/2024 in #❓┊help
how to handle if users dont have roles to panel with shield plugin ?
No description
27 replies
FFilament
Created by Sayy on 5/11/2024 in #❓┊help
Error when select data with afterstateupdated
No description
11 replies