Resonance
Resonance
Explore posts from servers
FFilament
Created by Resonance on 11/21/2023 in #❓┊help
cascadeOnDelete() on foreignIdFor()
I saw the demo site under the orders with a PaymentsRelationManager. Diving deeper with the code, it uses the foreignIdFor() in the migrations table. I tried to mirror it and used it in my project. But I want to add cascadeOnDelete() so that if the data is deleted, it also deleted the created data on the foreign column. My primary column on the reference table is a custom ID with a *(data type:char)*. Since this is my case, I cant use the default constrained(), hence, I cant also utilize the cascadeOnDelete() . Any database expert here? I want to refactor my code.
3 replies
FFilament
Created by Resonance on 11/21/2023 in #❓┊help
Installable Laravel app
I want to package my laravel app/filament into a self extracting executable installer with post script that runs artisan commands and install it locally (windows environment). There is this application that we use that does it. It extracts the web app into a folder in C drive, with just the apache and mysql files (probably xampp). I want to achieve the same thing. I also want this application to run without the php artisan serve command. Is there anyone who already done it? If so, can you share some steps on what software did you use to achieve such thing. Thank you!
7 replies
FFilament
Created by Resonance on 11/5/2023 in #❓┊help
Delete Action
No description
10 replies
FFilament
Created by Resonance on 10/31/2023 in #❓┊help
Edit action not working on relation manager
No description
9 replies
FFilament
Created by Resonance on 10/31/2023 in #❓┊help
Custom value of textcolumn description
Can I get a value on db column and put it in the table description method? if so, how can I achieve it? And can I also show multiple column data in a single table text column? I want to show all of my boolean true in a single table column. (More like a tags)
8 replies
FFilament
Created by Resonance on 10/28/2023 in #❓┊help
Custom primary ID generator
So, I'm all out of idea or insight. And i need your help guys. I want to create a custom primary ID that generates with prefix followed by a number i.e. "abc - 000000" or "abc 00-00-00 and auto increments or it checks the last number generated and increment on that. Yes, Ive already seen laravel custom ID generator. But is there any tutorial out there with a better approach or a better implementation in filament for this kind of custom ID? Any inputs or feedback will be much appreciated!
4 replies
FFilament
Created by Resonance on 4/1/2023 in #❓┊help
Emit selected item on repeater items
Is there anyway to emit or remove the selected item on the next select field in the repeater field? I want it to be so that when user selected an item and add a repeater, it excluded on the next select field. To avoid redundancy of selected items in the repeater field.
8 replies
FFilament
Created by Resonance on 3/18/2023 in #❓┊help
Disable "Create" button
Is there anyway to disable create/create and create another button on the form based on certain condition?
7 replies
FFilament
Created by Resonance on 3/13/2023 in #❓┊help
About form data
Question, why does my dd($data)outputs the data I want to insert into my database but when I return($data) it ignores the second array of data I want to insert? I'm iterating into the repeater array so that every repeater data gets distributed on the other form data that I want to save. I'm using
->mutateFormDataUsing(function (array $data) {
$dispensedMedicines = $data['dispensed_medicines'];
unset($data['dispensed_medicines']);
$result = [];
foreach ($dispensedMedicines as $dispensedMedicine) {
$mergedData = array_merge($data, $dispensedMedicine);
$result[] = $mergedData;
}
$data = $result;
return ($data);
->mutateFormDataUsing(function (array $data) {
$dispensedMedicines = $data['dispensed_medicines'];
unset($data['dispensed_medicines']);
$result = [];
foreach ($dispensedMedicines as $dispensedMedicine) {
$mergedData = array_merge($data, $dispensedMedicine);
$result[] = $mergedData;
}
$data = $result;
return ($data);
52 replies
FFilament
Created by Resonance on 3/11/2023 in #❓┊help
Accessing repeater data
Hi, I implemented repeater on my form. I don't want to change my table column to json type so I was thinking of just iterate each value inside of the repeater data by using foreach and apply something on it before saving. How can I access stored repeater data?
28 replies
FFilament
Created by Resonance on 3/9/2023 in #❓┊help
Filament form save ignores eloquent updateOrCreate?
As the title says, I'm trying laravel updateOrCreate eloquent as a way to detect duplicates on data creation. The method works like I want it to be, it updates the current model data but my problem is, it creates a new record prior on just updating the data. Does filament bypass this method or am I missing something on my codebase? I'm using https://filamentphp.com/docs/2.x/admin/resources/creating-records, before method on CreateAction since I want the array of data being passed on form's input field. Am I doing something wrong here? Any input would be much appreciated!
28 replies
FFilament
Created by Resonance on 3/5/2023 in #❓┊help
Getting 403 error
10 replies
FFilament
Created by Resonance on 3/4/2023 in #❓┊help
Call another method inside of method closure
Is it possible to add another method inside of a closure, and if so, how to properly do it? For instance,
->hint(function($get){
if ($get('stock') == 0){
('testing') // this is the hint text I want tot return if true;
}
->hint(function($get){
if ($get('stock') == 0){
('testing') // this is the hint text I want tot return if true;
}
As example, I'm grabbing the value of 'stock' field, and run a conditional statement. And if conditions are met, I want to show the hint text, and maybe add another method to that field, like hintIcon() of hintColor()
6 replies