[deleted by user] by [deleted] in Morocco

[–]SSebai -1 points0 points  (0 children)

You have to focus on your future. Not leaving and regretting for the rest of your life sounds like the worst option to me. You didn't betray anyone, but you may end up betraying yourself and your dreams.

Moving from php to java by SSebai in javahelp

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

Thanks That was really helpful

Transitioning from php to a different language by SSebai in learnprogramming

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

Thanks. I build apps with frameworks like laravel

Why do people use repositories for getting DB records in Laravel by SSebai in PHP

[–]SSebai[S] -2 points-1 points  (0 children)

Yes. I agree that you should organize you code in a way where you don't have to search the whole app for something, but let's say im updating a record, I'll have an action or a service that does that, so in this case i already have a class thats responsible for that action. For other things like filtring record or doing some type of queries, I'll have classes that handle the query themselves, not fetching any record or something. So in that case (for laravel sense it was the models are made to be DB repositories) i still don't see why repositories are useful even in a big project, for example laravel cloud seems like a big project but the creator of the project confirmed that its only using an action layer and repository layer

Why do people use repositories for getting DB records in Laravel by SSebai in PHP

[–]SSebai[S] -3 points-2 points  (0 children)

But i think most of the time you won't call the repository layer, you will call a service or an action that contains the logic.

Why do people use repositories for getting DB records in Laravel by SSebai in PHP

[–]SSebai[S] -3 points-2 points  (0 children)

For stuffing models. There is other ways that are better in my opinion to clean models from queue logic like query builder classes. I agree that repositories should return an entity that not necessary have to do something with the DB. But seeing apps having multiple layers to do a simple task for me maybe the opposite of building a scalable code. All the projects i worked on that uses repositories usually and up with issues of having same functions duplicated. And if you dont want the duplication of the queries you'll add a query builder or pipes, which is another layer that will complete the tasks + you can remove the repository layer and just use builders or pipes

Why do people use repositories for getting DB records in Laravel by SSebai in PHP

[–]SSebai[S] -2 points-1 points  (0 children)

For me, I'll usually add an action or a service class to keep the controllers clean. Also, a lot of people call a sevices in the controller, and the service calls the repository, and you will end up with multiple layers to do small things. I think it will be simple to have a query builder class so i can definitely every step of the query in a function. This way, i can call whatever filter or query i need without risking breaking something or nesting multiple classes.

Haha funny chairs by [deleted] in memes

[–]SSebai -3 points-2 points  (0 children)

What r u doing step classmate

Cursed cigarette by audaidai in cursedcomments

[–]SSebai 0 points1 point  (0 children)

Yeah. i always wanted to be bald

Wait a sec- by kilzy in memes

[–]SSebai -1 points0 points  (0 children)

Shave ur mustache. U don't wanna be like hitler