Yuut4
Yuut4
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
I hope this helps xD
74 replies
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
And now I think I haven't forgotten anything
74 replies
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
Tables\Actions\EditAction::make('pagamento')
Tables\Actions\EditAction::make('pagamento')
74 replies
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
the 'pagamento' must be the same name given in the action
74 replies
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
$this->mountTableAction('pagamento', $this->paymentId);
$this->mountTableAction('pagamento', $this->paymentId);
74 replies
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
in this part:
74 replies
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
As I said, I forgot to specify something xD
74 replies
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
And that's all if I haven't forgotten anything, it's been a while since I did this, but I remembered that I had opened help here so I came to leave my results.
74 replies
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
and in relation manager something like this
protected $queryString = ['openPayment', 'paymentId'];

public $openPayment;
public $paymentId;
//public $isLoading = false;


public function checkOpenModals()
{
if ($this->openPayment) {
//$this->isLoading = true;
$this->mountTableAction('pagamento', $this->paymentId);
}
}
protected $queryString = ['openPayment', 'paymentId'];

public $openPayment;
public $paymentId;
//public $isLoading = false;


public function checkOpenModals()
{
if ($this->openPayment) {
//$this->isLoading = true;
$this->mountTableAction('pagamento', $this->paymentId);
}
}
74 replies
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
so in the main resource I made a url like this

Tables\Actions\ViewAction::make()
->url(function ($record) {
$payment = PaymentMap::where('partner_id', $record->partner_id)
->where('plan_id', $record->plan_id)
->get()
->toArray();
$paymentId = $payment[0]['id'];
$relationManager = 5;
// Gerar a URL para o relationManager com os dados do modal como um parâmetro de consulta
$url = route('filament.resources.partners.view', [
$record->partner_id,
'activeRelationManager' => $relationManager,
'openPayment' => true,
'paymentId' => $paymentId
], $paymentId);
// Abra a URL em uma nova janela
return "javascript:window.open('$url','_blank','location=yes,height=5000,width=900,scrollbars=yes,status=yes')";
})

Tables\Actions\ViewAction::make()
->url(function ($record) {
$payment = PaymentMap::where('partner_id', $record->partner_id)
->where('plan_id', $record->plan_id)
->get()
->toArray();
$paymentId = $payment[0]['id'];
$relationManager = 5;
// Gerar a URL para o relationManager com os dados do modal como um parâmetro de consulta
$url = route('filament.resources.partners.view', [
$record->partner_id,
'activeRelationManager' => $relationManager,
'openPayment' => true,
'paymentId' => $paymentId
], $paymentId);
// Abra a URL em uma nova janela
return "javascript:window.open('$url','_blank','location=yes,height=5000,width=900,scrollbars=yes,status=yes')";
})
74 replies
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
basically in relation manager as it is a simple resource, it uses mountTableAction to open the modal
74 replies
FFilament
Created by Yuut4 on 8/3/2023 in #❓┊help
Open a specific Modal
So I know it's been a long time since I posted, but I ended up finding a way that I already did about a month ago, but I just had time to stop by here now.
74 replies
FFilament
Created by Yuut4 on 8/8/2023 in #❓┊help
Custom form filter is not applying
Is it because it doesn't work if you don't have where?
8 replies
FFilament
Created by Yuut4 on 8/8/2023 in #❓┊help
Custom form filter is not applying
does anyone know what could be happening?
8 replies
FFilament
Created by Yuut4 on 8/8/2023 in #❓┊help
Custom form filter is not applying
this is my current filter and it still doesn't apply,
->query(function (Builder $query, array $data, $livewire): Builder {
$partnerId = $livewire->ownerRecord->id;
$date = $data['date'];
if (isset($date)) {
$date = explode(' ', $date);
$date = $date[0];
///*dd(*/return $query->where('date', $date)->where('partner_id', $partnerId)->withTrashed()/*->get())*/;
$query = $query->withTrashed()->selectRaw('plan_partner_payments.*, @cumulative_balance:=@cumulative_balance + plan_partner_payments.credit-plan_partner_payments.debit AS balance')
->fromRaw('(
SELECT -1 as id, -1 as plan_partner_id, -1 as plan_id, partner_id, DATE_SUB(\'' . $date . '\', INTERVAL 1 YEAR) as date,
CASE WHEN SUM(credit)-SUM(debit) < 0 THEN SUM(credit)-SUM(debit) ELSE 0 END as debit,
CASE WHEN SUM(credit)-SUM(debit) >= 0 THEN SUM(credit)-SUM(debit) ELSE 0 END as credit
FROM plan_partner_payments
WHERE partner_id = ' . $partnerId . ' AND date < DATE_SUB(\'' . $date . '\', INTERVAL 1 YEAR)
UNION ALL
SELECT id, plan_partner_id, plan_id, partner_id, date, debit, credit
FROM plan_partner_payments
WHERE partner_id = ' . $partnerId . ' AND date = \'' . $date . '\'
) plan_partner_payments
JOIN (SELECT @cumulative_balance:=0) r');
}
return $query;
}),
->query(function (Builder $query, array $data, $livewire): Builder {
$partnerId = $livewire->ownerRecord->id;
$date = $data['date'];
if (isset($date)) {
$date = explode(' ', $date);
$date = $date[0];
///*dd(*/return $query->where('date', $date)->where('partner_id', $partnerId)->withTrashed()/*->get())*/;
$query = $query->withTrashed()->selectRaw('plan_partner_payments.*, @cumulative_balance:=@cumulative_balance + plan_partner_payments.credit-plan_partner_payments.debit AS balance')
->fromRaw('(
SELECT -1 as id, -1 as plan_partner_id, -1 as plan_id, partner_id, DATE_SUB(\'' . $date . '\', INTERVAL 1 YEAR) as date,
CASE WHEN SUM(credit)-SUM(debit) < 0 THEN SUM(credit)-SUM(debit) ELSE 0 END as debit,
CASE WHEN SUM(credit)-SUM(debit) >= 0 THEN SUM(credit)-SUM(debit) ELSE 0 END as credit
FROM plan_partner_payments
WHERE partner_id = ' . $partnerId . ' AND date < DATE_SUB(\'' . $date . '\', INTERVAL 1 YEAR)
UNION ALL
SELECT id, plan_partner_id, plan_id, partner_id, date, debit, credit
FROM plan_partner_payments
WHERE partner_id = ' . $partnerId . ' AND date = \'' . $date . '\'
) plan_partner_payments
JOIN (SELECT @cumulative_balance:=0) r');
}
return $query;
}),
8 replies
FFilament
Created by Yuut4 on 8/9/2023 in #❓┊help
Filament Core Notifications
I didn't put null, I just increased the interval time, thanks for clarifying my doubt Xd
11 replies
FFilament
Created by Yuut4 on 8/9/2023 in #❓┊help
Filament Core Notifications
I was thinking, that I had done something very wrong, but strange, I don't remember setting it to 0
11 replies
FFilament
Created by Yuut4 on 8/9/2023 in #❓┊help
Filament Core Notifications
that's it, for some reason it was at 0s
11 replies
FFilament
Created by Yuut4 on 8/9/2023 in #❓┊help
Filament Core Notifications
hm, so the problem could be with the database notifications, ok I'll see, this happens literally on all resources
11 replies
FFilament
Created by Yuut4 on 8/9/2023 in #❓┊help
Filament Core Notifications
it must be default, don't touch it in the resource
11 replies