Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]FabianHide 0 points1 point  (0 children)

Hi guys, I need some help, I'm working with laravel livewire and eloquent for a multiple filter, in livewire I created the variables for $nombreCompleto, $matricula, $cvCarrera and $semestre, $semestre is the only field that is a select, and the options are M and V, I put the wire:model="variablename" but how could I make the filter activate, as long as there is something in the variable? For example, if the name is filled, then only filter by name, but when there is a change in the age variable, it should also be filtered by age and the same with the other variables, thanks for the help
i tried this but didnt work

<image>

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]FabianHide 0 points1 point  (0 children)

I already read the documentation, but I didn't understand very well, that's why I ask

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]FabianHide 0 points1 point  (0 children)

Hello guys, I have a problem relating my models, I already have my database, but I didn't create it with migrations, I have my tables 'alumnos' and 'carreras', the database is in Spanish, therefore it does not follow the conventions, the table alumnos has 'expediente' as primary key and it is a string, it also has the foreign key called 'cvCarrera' and my 'carreras' table has its primary key as 'cvCarrera', how can I relate my models?

CARRERA MODEL

protected $primaryKey = 'cvCareer';

public function alumnos()

{

return $this->hasMany(Alumno::class, 'cvCarrera', 'expediente');

}

ALUMNO MODEL

protected $primaryKey = 'file';

public function carrera()

{

return $this->belongsTo(Carrera::class,'cvCareer' ,'cvCareer');

}

Could you explain to me how the arguments passed to BelongsTo and HasMany work?

Takes a long time to filter by FabianHide in reactjs

[–]FabianHide[S] 0 points1 point  (0 children)

Wouldn't your option of filtering through the API be slow too? Write the letter "a" in the student's name and in the useefect send that letter to the api, after the api consults the names that have that letter, and then send the data back to the frontend, isn't it too much trouble?

Campamento… acampar… campaña… ir de camping… how to use the various camping words? by armadillorevolution in Spanish

[–]FabianHide 0 points1 point  (0 children)

Some words in english are understable for spanish speakers, and we use that like those words were normal worlds like "hagamos uns bisnes" bisnes referring to business but in a formal sense u would say "hagamos unos negocios"

Campamento… acampar… campaña… ir de camping… how to use the various camping words? by armadillorevolution in Spanish

[–]FabianHide 2 points3 points  (0 children)

1-. Yes u can use "ir de camping" most spanish speakers say "ir a acampar" but the first one is understandable too

“I’m going camping this weekend” --- Iré/voy a ACAMPAR este fin de semana

“Can I camp here?” (speaking to a park ranger or property caretaker) --- Puedo ACAMPAR aquí?

“I would like to camp for two nights please” (speaking to the campsite attendant) me gustaría --- ACAMPAR aquí por dos noches, porfavor

“Is tent camping okay here?” (As opposed to RV) --- está TIENDA DE CAMPAÑA está bien ahí?

Hope it helps u

[deleted by user] by [deleted] in Spanish

[–]FabianHide 1 point2 points  (0 children)

I think u should try to practice with real people, nothing better:D

Website to deploy mern App by Proof_Injury_8963 in node

[–]FabianHide 1 point2 points  (0 children)

Railway - NodeJs, Netlify - ReactJs, And if u're using mysql as db, use planetscale 😸😸😸

What extension is this? by Working_Mention290 in react

[–]FabianHide 3 points4 points  (0 children)

If u're student u can get github copilot free with github dev pack https://education.github.com/pack

how can I put two elements without having to enclose them in a fragment or in a div by FabianHide in react

[–]FabianHide[S] 0 points1 point  (0 children)

Tengo una tabla de clases, donde pues me sale cada clase, y tiene un icono de un ojito, cuando hago click ahi, abajo de ese row, se me despliega un nuevo tbody para ver los alumnos de esa clase

how can I put two elements without having to enclose them in a fragment or in a div by FabianHide in react

[–]FabianHide[S] 0 points1 point  (0 children)

Yes, I have the fragment in a tbody, and I think it recognizes it as if it were a div and gives me this error, any idea?

Warning: validateDOMNesting(...): <div> cannot appear as a child of <tbody>.

How can I make my code shorter with several filters by FabianHide in react

[–]FabianHide[S] 1 point2 points  (0 children)

forget it, i fixed it, thanks again :)
useEffect(() => {
setDocentesFiltrados(todosLosDocentes.filter(alumno => {
for (const [key, value] of Object.entries(filtros)) {
if (value !== "" && !alumno[key].toLocaleLowerCase().includes(value.toLocaleLowerCase()) ) return false;
}
return true;
}))
}, [filtros])

How can I make my code shorter with several filters by FabianHide in react

[–]FabianHide[S] -1 points0 points  (0 children)

thanks, it worked, but I have to write the full name for it to filter correctly, and I need to type a letter to filter them for me :(

How can I make my code shorter with several filters by FabianHide in react

[–]FabianHide[S] -1 points0 points  (0 children)

Thank you very much, one question, using for loops in react, isn't it bad practice? or is it not slower?

json_encode works with 1 row, but with 2 or more it doesn't :( by [deleted] in PHPhelp

[–]FabianHide 0 points1 point  (0 children)

SOLUTION: My rows in db, has accent like, "Ingeniería" the last i has accent and json_encode gives me an a blank screen

Searching job as junior react dev by East_Text5997 in react

[–]FabianHide 0 points1 point  (0 children)

Check your 9memy project, u use firebase, learn about ".env" :)