Resonance
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
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
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
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
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
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
52 replies
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
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
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,
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