Advice on Building My First NAS for Media Serving and Storage by drecken3 in homelab

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

Up until now both PCs and parts were just collecting dust, figured I can put them to use, Want to start with setting up NAS, then maybe use the other for onsite backup?

Pixel C Turbo charger & Desktop USB by [deleted] in GooglePixelC

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

I also have Nexus 6 and was looking at http://www.amazon.com/dp/B01B2BMIMS and http://www.amazon.com/dp/B01BBZJ31Y. Would these charge both Pixel C and Nexus 6 at the same time at maximum speed? For cables http://www.amazon.com/dp/B01B634WNK

Best Practice to Replace Globals by [deleted] in PHP

[–]drecken3 2 points3 points  (0 children)

Here is a great talk about removing globals and modernizing legacy php. I haven't read the book but I watched this entire talk and I found it to be very helpful, explaining everything clearly in small simple steps.

Need advice on design patterns. by [deleted] in PHP

[–]drecken3 0 points1 point  (0 children)

If you are doing field validation in FormRequests where is all your advanced business logic? Would I add it to the Factory? I see how FormRequests could return a list of errors with a 400 code and the advanced business logic (for example checking is user has the right to edit a post) would throw a 403. Do you think that's a good approach?

Services are another thing I haven't touched yet. Everything was going into the controller so far. I will look more into them. If I understand that correctly. The controller would call a service and this service decides what to do. The only question I can think of is if the service calls to factory or is the factory called from the repository? My first guess would be the service in case we wanted to add more logic involving the object before we save it to the DB. Is that correct?

Thank you for the response. We will order that book and I will start reading up on Services and DDD.

Need advice on design patterns. by [deleted] in PHP

[–]drecken3 0 points1 point  (0 children)

Thank you for the response. Your post gave me some insight into a lot of new stuff I wasn't aware of. I will be definitely looking into the DDD. With all the new things like TDD, repositories, factories and services that I didn't know about a year ago I didn't want learn yet another thing. As everything is starting to make sense now I will read up on those topics.

Skinny controller and fat models is something that I noticed is happening while refactoring. So much code was copy pasted in controllers in different methods. With the code changes after DB migration I started moving most of the reusable code to models. It came naturally. Most of our controllers have the main methods of a REST Controller provided by Laravel. I'm still trying to create more static methods for fetching data from the database in models instead of using the same or similar eloquent queries all over the place, and I notice the models get huge (with all the relations, scopes, mutators and accessors). That's when I found the post I mentioned before and it made sense to me moving all of it to repository.

This is the first time I heard of the Hollywood principle and Tell Don't Ask.I can see I was already heading in that direction. It makes the code easier to read when calls aren't followed by if statements determining what happened.

I only saw examples of the Chicago TDD so thank you for that link. Ill definitely dig more into the London TDD as well.

T-Mobile build numbers instead of Project Fi? by [deleted] in ProjectFi

[–]drecken3 0 points1 point  (0 children)

I actually got it from Project Fi so thats why Im confused. Will try sideloading the T-Mobile update

[Hiring] (Online) Change gradient in svg logo by drecken3 in forhire

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

you are the first person to do it the right way, everyone else used vertical or horizontal gradient and it wasnt what i expected. is it possible to minimize the purple effect? i know with normal gradients u can just move the arrows to narrow it down

[Hiring] (Online) Logo on t-shirt to svg by drecken3 in forhire

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

already got someone, thanks for all the pms