_newtonjob Profile Banner
Newton Job Profile
Newton Job

@_newtonjob

Followers
3K
Following
14K
Media
565
Statuses
7K

Helping Laravel developers be **Laravel** developers. πŸ₯· Master of #Laravel. πŸ’… TALL | VILT | LEMP πŸ”’ Mathematician 🎹 Keyboardist

Lagos, Nigeria
Joined September 2022
Don't wanna be here? Send us removal request.
@_newtonjob
Newton Job
4 months
Stuck to this programming quote since my first line of code.
Tweet media one
0
5
54
@_newtonjob
Newton Job
1 day
Append this middleware to your applications and 10x your debugging. Anything that originated from this request will carry the context along, e.g. Jobs, Logs. For jobs especially, you can even grab the user that triggered the job from within the job itself.
Tweet media one
7
13
118
@_newtonjob
Newton Job
4 days
Everything is CRUD!
Tweet media one
5
4
73
@_newtonjob
Newton Job
8 days
RT @_newtonjob: @Davi_g117 @enunomaduro I love actions. They are a different name for the command bus pattern which Laravel's Command Bus s….
0
1
0
@_newtonjob
Newton Job
11 days
RT @PovilasKorop: So simple. So smart.
0
3
0
@_newtonjob
Newton Job
12 days
Need an admin panel? Try Tableplus.
16
0
45
@_newtonjob
Newton Job
14 days
I do this on most projects. Thank me later. πŸ™‚
Tweet media one
16
14
185
@_newtonjob
Newton Job
15 days
Please don't tell me people genuinely do pre-commit hooks. πŸ₯Ή. I can throw away my machine if I have to wait 1ms to do a commit or push.
@youyuxi
Evan You
15 days
PostHog migrated from ESLint to Oxlint - pre-commit hook went from 7.7s to 230ms (97% reduction!!!)
3
0
1
@_newtonjob
Newton Job
15 days
Laravel's job batching is soooo good! πŸ€¦β€β™‚οΈ.
6
2
51
@_newtonjob
Newton Job
15 days
RT @sumfreelancer: Stuff like this, I am in twitter for. @_newtonjob.
0
2
0
@_newtonjob
Newton Job
15 days
People often create a whole new middleware class just to handle some global authorization. In many cases, you can still take advantage of Laravel's built-in Authorize middleware. Here's an example πŸ‘‡
Tweet media one
10
16
164
@_newtonjob
Newton Job
16 days
If you're performing other database operations from observers or listeners when a model is being saved, you may want to wrap the entire operation within a database transaction to ensure consistency. πŸ”„. updateOrFail(), saveOrFail(), deleteOrFail(), etc. are nice helpers for that.
Tweet media one
2
4
54
@_newtonjob
Newton Job
17 days
Any class can be made `UrlRoutable` and benefit from implicit route bounding. In this example, I've extended the Carbon class to implement the `UrlRoutable` interface so that I can inject any date route parameters directly as a Carbon instance.
Tweet media one
3
6
71
@_newtonjob
Newton Job
20 days
Also, note that if you MUST version your API at some point, you can still start without versioning. GET /api/users <--- This is v1. GET /api/v2/users <--- This is v2 (which mostimes never happens).
0
0
9
@_newtonjob
Newton Job
20 days
Link to the original post.
1
0
2
@_newtonjob
Newton Job
20 days
Mostly agree with other points in this post, but. IMO, it is rather bad practice to version your APIs from the start. This already gives the impression that you intend to break it in the future. APIs can evolve with new properties without breaking existing client integrations.
Tweet media one
9
2
31
@_newtonjob
Newton Job
21 days
I was already on my way to implementing a custom helper to wrap sentences without spoiling words. Then I found the helper I was looking for. Str::wordWrap() 😍
Tweet media one
6
4
72
@_newtonjob
Newton Job
25 days
RT @_newtonjob: @MrOluwatobby @enunomaduro @dhh Cool thing is, Laravel long introduced the Action pattern a.k.a "Command Bus" in 5.x, which….
0
2
0
@_newtonjob
Newton Job
27 days
RT @PovilasKorop: Yes, for many projects, that is enough. I have a separate video about WHEN to choose spatie/laravel-permission package,….
0
2
0
@_newtonjob
Newton Job
28 days
You're probably going overly complex with roles and permissions. For the majority of apps out there, Laravel's built-in authorization just works. 🀌
Tweet media one
5
10
151
@_newtonjob
Newton Job
29 days
How many queries at most do you expect to run on a single page? How much is too much?
Tweet media one
30
3
92