VIIKKK
VIIKKK
Explore posts from servers
FFilament
Created by VIIKKK on 10/18/2023 in #❓┊help
translatable compatible?
I was wondering if spatie/translatable is compatible with filament v3. If it is? what am I doing wrong? I set my locales and added the headerAction to the resources. I get a dropdown menu, but i don't see my locales in there so i can't select nothing.
8 replies
TTCTheo's Typesafe Cult
Created by VIIKKK on 6/27/2023 in #questions
Question about hooks.
const Home: NextPage = () => {
const { data } = api.companyemployees.getCriticalContracts.useQuery(7);

const handleSnooze = (contractId: number) => {
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const response = api.contracts.snoozeContract.useMutation({ contractId });
// Handle success response
console.log("Snooze successful:", response);
} catch (error) {
// Handle error
console.error("Failed to snooze:", error);
}
};
const Home: NextPage = () => {
const { data } = api.companyemployees.getCriticalContracts.useQuery(7);

const handleSnooze = (contractId: number) => {
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const response = api.contracts.snoozeContract.useMutation({ contractId });
// Handle success response
console.log("Snooze successful:", response);
} catch (error) {
// Handle error
console.error("Failed to snooze:", error);
}
};
` Is it impossible to run handleSnooze like this on the frontend? If so, can somebody give me some pointers, please?
9 replies
TTCTheo's Typesafe Cult
Created by VIIKKK on 6/6/2023 in #questions
NextAuth.
If i run this i get all sorts of different sessions errors. Where do i go wrong in this auth?
2 replies
FFilament
Created by VIIKKK on 6/5/2023 in #❓┊help
Filtering a many-to-many relationship.?
IS there a build in function to filter a many-to-many relationship or should i write a custom query for this. If so what would be best practice?
2 replies
TTCTheo's Typesafe Cult
Created by VIIKKK on 6/1/2023 in #questions
Question about next auth.
Hey all, The stack and full stack development in javascript in general is new for me. I finding my way around while using the documentation. But I was wondering what the best way/ implementation should be to use next auth to call a query from another API. Old API that is still in use for verification. I can make this call with the correct credentials . Afterwards i want to check in the same function for the email and password via a trpc query in a table in my database and return the result (unique user with that email and password) as my user in the session. But i'm kinda stuck on the big picture here i guess. Thanks in advance. And if this is not appropriate to ask in the discord. Feel free to delete this.
15 replies
FFilament
Created by VIIKKK on 5/3/2023 in #❓┊help
Displaying boolean values based on a many-to-many relationship.
I have a many to many relationship (customer to types). I was wondering if it's possible to make a booleancolumn for each type and insert true or false based on the condition?
2 replies
FFilament
Created by VIIKKK on 5/2/2023 in #❓┊help
Issue with translation.
I added 3 locales but when i try to type i get this error.
Unable to set component data. Public property [$en] not found on component: [app.filament.resources.content-block-resource.pages.create-content-block]
Unable to set component data. Public property [$en] not found on component: [app.filament.resources.content-block-resource.pages.create-content-block]
` Where should this property be set? Model and resource are prepared like in the docs. I'm quite clueless
5 replies
FFilament
Created by VIIKKK on 4/28/2023 in #❓┊help
conditionally showing relationship.
Hey all, I'm using the table builder. I have a model Customer that has a many to many relationship with Customer_types. I want to conditionally display a check icon if the id is in the relationship. (e.g $customer->types->contain('id',$id)) and another icon if returns false. Whats best practice for this?
2 replies
FFilament
Created by VIIKKK on 4/13/2023 in #❓┊help
Translations
I'm new to building multi-language sites. How would i approach my content structure in filament to add 3 languages to my content that is displayed on the front end?
2 replies
FFilament
Created by VIIKKK on 3/16/2023 in #❓┊help
Very quick question about relationships.
Hey all I'm using the table builder.
TextColumn::make('users_exists')->exists('users')
TextColumn::make('users_exists')->exists('users')
What is best practice to add a where clausule and display a check if true? So in pseudo-code i mean something like this Display a check if a user exists where language_id = 1 .
17 replies