error it cant see my table columns
It was working but now it doest works idk why.. when i create supplier it cant see brands and subbrands. there is my code also:
Supplier Model:
49 Replies
any ideas?
not sure, but an optimisation:
to
where i should write this ?
in tinker for example - php artisan tinker
add
\App\Models\
before the model namei should write it in model?
no, i mean, like this:
okay and where i should writ eit ?
aa
in terminal?
if u do php artisan tinker u can execute arbitrary code
yes
thats an option
i got it
what is it ? š
the benchmark results xd
amm and its works or what? dd
is it good ? ddd
idk in web i have same result
it cant read brand_ids and subbrand_ids
its doest takes brand_id and subbrand_id
literally yesterday it was working dd
just i remove db and create again but
in db everything is okay i think becouse
by hand in db its works
just there..
in the 1st message i sent, literally the 2 first words are "not sure", which i meant idk what is happening with ur code.
then i just wanted u to notice that
Brand::all()->pluck('name', 'id')
could be optimised. that is why i showed u the benchmark thing, so u can see the difference.
that is it.aa thanks means second( ur way) is more fast?
u mean that?
idk i have form and model
which i wrote
yes. and just in case u think it doesnt matter for couple ms, u can just add a bunch of records and do the benchmark again
and i have no idea why its not giving data
not sure what u mean
have u set the relationships in the models?
yep i know that it does matte
okay let me explane
i have table
like this and
i have form also
this is my form where
I save name brands and subbrands also
This is model of this form
any ideas?
in your form schema
Select::make('brand_id')
you need to have only ONE of this:
->relationship()
OR ->options()
not both
remove options()
okay i remove
options()
but its not working
same error
idk it was working yesterday d..
I remove relationshop now and its works..
hmm
but when I click to editok so the relationship is wrong
now i have this eror..
yep and
becouse of that I have error in edit
change the relationship from
belongsTo
to hasOne
same error..
this error is self explanatory man
you need to pass the value $name
yep sure i get it but
how or where š
i should do it in edit supplier?
like this resource edit file ?
yep i already did it
https://laravel.com/docs/10.x/eloquent-mutators#mutating-multiple-attributes
why you named the
Attribute
attribute
?where?
I named
Attribute
in the supplier model
Its
Attribute
not sure what you trying to do but try to use a different name
also you expecting to pass a $name so...
idk it was working yesterday
why its not working idk
like im using this becouse of
brands and subbrands which i give is many to many
like its 1,2,3,4 string so
to take data and set
im using this to split
try to rename the attribute function
i gotta go, you better use chatgpt to debug that shit š
and its not a filament-related problem tbh
i try it but gpt is shit š
yep i think same
becouse it was working yesterday..
i didnt remember
should i use anything more like
I should use this
brandId
anywhere? š
fixed thankswhat was the issue?
its not important to give $name attribute
so i made this
I just remove names
hmm i dont understand this code
u say u r doing it for what? -> https://discord.com/channels/883083792112300104/1214094864854290502/1214118779789905971
in db i have many ids in one column like 1,2,3,4 so for split it and parse
im using this code
its many to mnay
or i dont understand it or u r overcomplicating it. but yeah if works for u then its fine i guess
yep its works so who gives a fuck d
btw thanks for ur best advice about that
and ur time also
ā¤ļø
š (: