Newton Job Profile Banner
Newton Job Profile
Newton Job

@_newtonjob

2,197
Followers
149
Following
398
Media
4,651
Statuses

🥷 Master of #Laravel 💅 TALL | VILT | LEMP 🔢 Mathematician 🎹 Keyboardist

Lagos, Nigeria
Joined September 2022
Don't wanna be here? Send us removal request.
Pinned Tweet
@_newtonjob
Newton Job
11 months
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
@ianlandsman
Ian Landsman
11 months
What's your all time fav programmer quote? It's one of these three for me:
7
1
8
4
1
32
@_newtonjob
Newton Job
10 months
💡Building APIs with #Laravel ? truth is, you cannot guarantee that your users will always send you the `Accept: application/json` header. This simple global middleware, will save you time explaining why your validation/auth errors are redirecting instead of returning JSON.
Tweet media one
14
44
269
@_newtonjob
Newton Job
4 months
I love how easy it is to combine two local scopes with the "OR" clause using #Eloquent 's `orWhere` magic property 🔥 #Laravel
Tweet media one
5
39
269
@_newtonjob
Newton Job
1 year
⚡️ #Laravel devs, are you differing more work to #Eloquent ? Did you know that the whereRelation() method can do more than you might expect? Most times, your whereHas() may be even more succinct with whereRelation().
Tweet media one
2
67
236
@_newtonjob
Newton Job
1 year
💡 #Laravel devs, a very simple implementation of FULLTEXT search can take you very far with searching your #Eloquent models. 🚀 90% of the time, you really don't need to reach for a package like laravel/scout, especially if you don't plan on using algolia/meilisearch drivers.
Tweet media one
9
48
232
@_newtonjob
Newton Job
1 year
💡 #Laravel devs, have you ever tried to update a column in the db with the value of another column? DB::raw() has got you for this. 👌
Tweet media one
11
44
228
@_newtonjob
Newton Job
1 year
🔥The #Laravel rescue() helper is such a convenient helper. I almost never write try-catch blocks anymore. 😎 You can pass a callback to it as the first argument, and an optional second argument as the default result if an exception is thrown within the callback. 🚀
Tweet media one
11
39
231
@_newtonjob
Newton Job
2 months
Been less active here for a bit... Yeah, was busy getting married 🙂 Meet the love of my life ❤️
Tweet media one
71
7
212
@_newtonjob
Newton Job
1 year
💡 #Laravel collections provide a mapInto() method, very useful for creating a new object by passing each item in the collection as a constructor argument to the new class. Here's a typical example of how you may utilise it 👇
Tweet media one
3
47
208
@_newtonjob
Newton Job
6 months
I almost always create the `owns()` method on my User model, so that I can pass any other model to it like so; $user->owns($post); #Laravel
Tweet media one
11
18
207
@_newtonjob
Newton Job
8 months
Do people still add fields like "success" in a 200 JSON response in 2023? 🤔
Tweet media one
71
6
205
@_newtonjob
Newton Job
1 year
💡Devs, when dealing with #Laravel 's paginated data, you may transform the underlying paginated collection, using the through() method, without loosing the paginator instance itself. Very useful if need control over what data is sent to the client. 👌
Tweet media one
12
46
199
@_newtonjob
Newton Job
6 months
#Laravel friends, did you know you can use an Eloquent mutator to proxy values to other model attributes when you return an array rather than a single value?
Tweet media one
3
25
187
@_newtonjob
Newton Job
1 year
🔥 #Laravel devs, here's your complete web/api authorization setup in one simple tweet (or post 👀). 99% of the time, you don't need that package! 📦
Tweet media one
6
35
183
@_newtonjob
Newton Job
1 year
Never write another loop again. 🥲 Some #Laravel examples here. You can take the ones you're comfortable with and discard the rest. ✅ I personally don't write `foreach` again, just personal preference, and highly inspired by @adamwathan 's "Refactoring to collections" course.
Tweet media one
@_newtonjob
Newton Job
1 year
#Laravel devs, when was the last time you wrote a `foreach` statement by hand? I'd go first; - Can't remember.
35
3
58
14
37
181
@_newtonjob
Newton Job
3 months
The `ensure()` method on collections always saves the day! #Laravel
Tweet media one
1
28
178
@_newtonjob
Newton Job
10 months
I've used a couple #PDF packages for #Laravel . They're typically just wrappers for packages like mpdf, dompdf, etc. But none really gave me a clean api/features I really wanted. So I started wrapping Mpdf incrementally with the features I needed. Maybe I could package it up?🤔
Tweet media one
14
29
176
@_newtonjob
Newton Job
1 year
Here's a powerful #Laravel authentication implementation with barely 4 lines of code. 💅
Tweet media one
6
30
170
@_newtonjob
Newton Job
1 year
💡 #Laravel devs, if you are chuncking #eloquent query results and looping them to perform a certain action, did you know about the each() method on the builder? It's a convenient method will chunck the results internally and pass each model to the closure you provide 👌
Tweet media one
6
41
170
@_newtonjob
Newton Job
1 year
🔥 #Laravel 's API resource classes are quite powerful, not only for returning responses from your APIs. You could also leverage them for sending data to external APIs. They can stand as a transformation later between your Eloquent models and external APIs. 🚀 Have a look! 👇👇
Tweet media one
11
26
171
@_newtonjob
Newton Job
1 year
⚡️ #Laravel allows you to monitor slow queries with `DB::whenQueryingForLongerThan()`. The callback you provide is usually invoked only "once" throughout the request lifecycle, no matter how many slow queries run. But did you know you can change that behavior? 👇
Tweet media one
5
46
163
@_newtonjob
Newton Job
1 year
⚡️ #Laravel devs, sunday tip here for you. Did you know you can add more observable events to #eloquent ? To better represent your business model. You can then listen for and fire these events. - Create trait, add your custom events, and use the trait in your model. [1/2]
Tweet media one
7
39
161
@_newtonjob
Newton Job
9 days
🎉
Tweet media one
32
8
162
@_newtonjob
Newton Job
1 year
#Laravel devs, sunday tip here for you! 🔥 From Laravel 10.10, #Eloquent now has a new native 'hashed' cast type. Very useful for passwords and/or other attributes that need to be hashed before sending to db.
Tweet media one
8
31
157
@_newtonjob
Newton Job
4 months
One of my most held #Laravel best practices is to avoid database keys leaking out in the app codebase. This leads to a future-proof and generally cleaner codebase. "Make the change easy, then make the easy change". Some very common examples I've seen just too many times 👇
Tweet media one
13
19
156
@_newtonjob
Newton Job
9 months
These days I'm using #Eloquent 's touch() more often for simple timestamp updates than the regular update([...]) method. 👀
Tweet media one
3
20
155
@_newtonjob
Newton Job
9 months
Looking at your #Laravel logs, it's usually hard to tell what users were doing when those errors happened. It's usually a good idea to add more context to your `App\Exceptions\Handler` that'd help you debug faster. I always add the full URL/request method. This helps a ton!💡
Tweet media one
5
25
145
@_newtonjob
Newton Job
4 months
🎯 Sunday tip for #Laravel engineers! Here's your complete multi-tenant app, with one super simple service provider and one model trait. 🚀
Tweet media one
Tweet media two
6
29
145
@_newtonjob
Newton Job
11 months
#Laravel folks, ever used an external API where your users have to connect via OAuth2? The HTTP client is an absolute joy to work with. Using the retry() method you can automatically refresh tokens via a sync job or similar, update the user's profile and resend the request 🚀
Tweet media one
6
25
144
@_newtonjob
Newton Job
1 year
🔥 I see many #Laravel projects having different route actions for profile update, change password, upload photo, etc. All these requests are doing one thing... "updating the user resource". One endpoint, with a well crafted validation logic can get you there very easily. 👌
Tweet media one
13
30
141
@_newtonjob
Newton Job
7 months
Welcome to the new year folks! 🤝 As your first #Laravel tip this year, I wanted to remind you that you can create custom expression classes for your raw query expressions. Keeping things nice and clean, especially for long and repeated raw queries. 💅
Tweet media one
9
20
141
@_newtonjob
Newton Job
8 months
Sunday tip for #Laravel devs! Just like many components in Laravel that use the manager pattern, if you are working with different providers of a similar service you can also quickly spin up your own manager class by extending the `Illuminate\Support\Manager` 🔥
Tweet media one
7
15
143
@_newtonjob
Newton Job
1 year
#Laravel devs, how do you deploy on shared hosting or when not using a service like #Forge to help with your quick deploys? 👀 Create a custom webhook route and give it to github. Then, whenever you push... 🚀🚀🚀
Tweet media one
15
22
140
@_newtonjob
Newton Job
1 year
🔥Are you familiar with #Laravel 's validation Rule::when()? Helps you fluently add rules conditionally. This is one convenient not-so-popular validation feature I use quite often.
Tweet media one
10
24
138
@_newtonjob
Newton Job
1 year
💡 #Laravel devs, #Eloquent provides a couple ways to run a block of code while ignoring timestamps. You can ignore timestamps for all models, a single model, or a selection of models. This little snippet has 3 practical examples👇
Tweet media one
8
34
135
@_newtonjob
Newton Job
8 months
#Laravel doesn't really have a built-in way to pause queue workers. Imagine you dispatched a ton of email notifications into the queue and wanted to quickly pause their execution for just a moment, do a few things, and then continue? Well, let me show you one way 👇
Tweet media one
9
17
137
@_newtonjob
Newton Job
8 months
A common mistake #Laravel devs make is using the global `event()` helper directly in Eloquent for dispatching custom events ❌
Tweet media one
10
20
137
@_newtonjob
Newton Job
1 year
Did you know you can nest match statements within match statements in #php ? 👀
Tweet media one
8
22
135
@_newtonjob
Newton Job
1 year
#Laravel devs, are you familiar with the fairly new restoreOrCreate() method on soft-deletable Eloquent models? 💡 If you ever needed to create a new record, but first check to see if it already exists (but soft deleted) and simply restore it instead; This is what you need 👌
Tweet media one
5
38
130
@_newtonjob
Newton Job
1 year
🔥 #Laravel devs, did you know about the `exclude` validation rule? It doesn't necessary validate anything but simply removes the associated field from your validated data. Very useful for fields that you don't eventually need for fulfilling the request.
Tweet media one
3
32
131
@_newtonjob
Newton Job
3 months
#Laravel macros are powerful! 🔥
Tweet media one
4
20
132
@_newtonjob
Newton Job
11 months
What kind of a #Laravel developer are you? 💅
Tweet media one
76
11
128
@_newtonjob
Newton Job
9 months
Did you know that #Laravel has an incredibly simple API token auth guard? If you do not need sanctum and all that it comes with (multiple tokens per user, token abilities, extra db table, etc.), then you only need a simple `api_token` column in your users table, and that's it⚡️
Tweet media one
4
24
130
@_newtonjob
Newton Job
3 months
Today's sunday tip is just a reminder that #Laravel provides a dead simple auth guard for api tokens out of the box. This is not sanctum, and all you need is an `api_token` column in your users table. 🚀
Tweet media one
0
18
130
@_newtonjob
Newton Job
11 months
Folks, let me show you 2 easy ways to filter your #eloquent queries based on the incoming request parameters. - Using when() - Passing a filtered array of parameters to the where() method.
Tweet media one
6
28
129
@_newtonjob
Newton Job
1 month
Hey #Laravel devs, did you know you can instruct Laravel to send a notification to multiple email addresses for one user? Imagine your users can add multiple emails for their billing notifications. When the notification is sent, all of the emails will be in the "to" address. 👇
Tweet media one
5
19
130
@_newtonjob
Newton Job
1 year
🔥 #Laravel models can use bootable/initializable traits to add custom functionalities to models that use such Traits. It can be a clean way to extend the model's core features by simply adding a Trait. Lots of Laravel packages that interact with models, use this pattern.
Tweet media one
2
37
125
@_newtonjob
Newton Job
6 months
Sunday tip for #Laravel devs💡 Ever used the array cache driver in production code? You may think it's only needed for testing, but you can, in fact, also use it to memoize the result of some method that may be called several times for the duration of the request.
Tweet media one
5
21
126
@_newtonjob
Newton Job
1 year
💡You may already be familiar with Laravel #Eloquent 's whereIn(), which accepts a column as the first argument and an array as the second. But did you know you may also pass a query builder as the second parameter to whereIn()? This let's you construct subqueries very easily 👌
Tweet media one
4
21
125
@_newtonjob
Newton Job
1 year
#Laravel devs, if you want to take full control of how #blade displays you Objects/Enums, you can implement the `DeferringDisplayableValue` contract on the object/enum. The interface requires you to implement the resolveDisplayableValue() method and return a string value. 💡
Tweet media one
2
36
123
@_newtonjob
Newton Job
1 year
🔥 #Laravel devs, did you know you can do a lot more than just validation and authorization with your request class? Here's an example of how you can tap() the query builder into a method on your request to add constraints or filter the results based on the request parameters.💅
Tweet media one
6
32
122
@_newtonjob
Newton Job
3 months
The whereAny() method was recently added to #Laravel ^10.x, to apply the same query constraints to multiple columns. But, did you know you can apply totally different constraints? 👇
Tweet media one
2
19
121
@_newtonjob
Newton Job
9 months
Whenever a request is doing lots of database stuff, I like to move all the logic into a handle() method on the request itself, then invoke it within a transaction. Making sure all queries are successful or rollback everything. Nice and clean👌 #Laravel
Tweet media one
10
16
119
@_newtonjob
Newton Job
1 year
Hey #Laravel devs 🔥, have you been stuck trying to use #Eloquent 's ->sum() or ->withSum() with not just a single column, but a custom expression? Here's 2 great ways to get around it! 👇
Tweet media one
2
26
120
@_newtonjob
Newton Job
1 year
💡 #Laravel devs, did you know that the authorize() method of your #FormRequest can also return an `Illuminate\Auth\Access\Response` object? Sometimes you may want to return a different HTTP response status other than the default "Unauthorized", very useful for improved security.
Tweet media one
3
22
118
@_newtonjob
Newton Job
7 months
How do you organize methods in your models? Is there some convention out there? #Laravel
Tweet media one
25
10
117
@_newtonjob
Newton Job
1 year
#Laravel devs, if you use uuids, #eloquent provides a HasUuid trait that helps you automatically generate Uuids when creating a model. But, do you also maintain an auto-increment primary key? You may find it convenient to wrap your own HasUuid trait over Eloquent.
Tweet media one
12
44
116
@_newtonjob
Newton Job
6 months
Common #Eloquent mistake! Avoid pulling out models into memory just to immediately update them. ❌ If you can avoid it, try to make a single update query instead ✅
Tweet media one
5
16
114
@_newtonjob
Newton Job
1 year
#Laravel devs, you may use the validate() method on the Auth facade to simply check that the credentials are valid, but not necessary log the user in, or start any session, e.g using Auth::attempt(...).❌ Very useful for stateless authentication that do not require a session. ✅
Tweet media one
5
29
111
@_newtonjob
Newton Job
1 year
⚡️ 2-in-1 #Laravel tips here for you! - You can create a basic filter for your APIs without any package. #Eloquent scopes are quite powerful! - When using when() 🙂, most times, you do not need a closure.
Tweet media one
10
28
110
@_newtonjob
Newton Job
7 months
Did you know the #Laravel notification `MailMessage` provides a `lines()` method that allows you to pass an array of lines? Can be very useful for avoiding unnecessary `foreach` 💅
Tweet media one
1
17
109
@_newtonjob
Newton Job
1 month
Why do we still code like this? 🙂
Tweet media one
35
8
108
@_newtonjob
Newton Job
1 year
🔥 #Laravel devs, sometimes your HasOne relationship for a given model may return no results. To keep your codebase consistent and to avoid unnecessary conditional checks, chain onto ->withDefault([]) and provide default attributes for when no relation exists. See this example👇
Tweet media one
3
19
104
@_newtonjob
Newton Job
7 months
Have you ever used `HtmlString` in #Laravel notifications? It's a really cool way to break out of the markdown and add some custom HTML markup, nice and clean!
Tweet media one
7
19
103
@_newtonjob
Newton Job
7 months
💡If you're developing a #Laravel API for some SPA, you may be sending notifications that have links typically pointing to your frontend. Here's a clean hack to still use the route() helper to generate URLs that point to the frontend. The route doesn't need to do anything 🤓.
Tweet media one
3
8
104
@_newtonjob
Newton Job
10 months
💡 #Laravel folks, optimization tip here: If you're only ever going to display the count of some relationship, then just load the count alone and not the entire collection of models. I've seen this a couple times.
Tweet media one
2
14
103
@_newtonjob
Newton Job
6 months
If you're not going to pass a closure to whereHas(), just use has() 🤷‍♂️ #Laravel
Tweet media one
1
14
103
@_newtonjob
Newton Job
1 year
💡 #Laravel devs, how often do you use #Eloquent firstOr()? It can be super useful elegant way of doing something when a certain record is not found in the database.
Tweet media one
9
23
102
@_newtonjob
Newton Job
3 months
❌Stop calling abort(403) at every chance you get for authorization. ✅Use the right tool for the job: Gate::allowIf(...) #Laravel
Tweet media one
3
16
102
@_newtonjob
Newton Job
13 days
Have you ever accidentally overwritten an entire JSON column when trying to update just a few keys? Use this little `Arr::arrow()` macro to convert your arrays to arrow syntax (similar to dot syntax) That way, #Eloquent can properly handle merging the new/updated keys for you👍
Tweet media one
3
19
101
@_newtonjob
Newton Job
1 year
🔥 #Laravel devs, are you familiar with the partition() method on collections? If you're not sure when you'd use it, let me show you by example; Here, we're using 3 different ways, including partition(), to get the pending and paid invoices into different variables; 👇
Tweet media one
3
26
98
@_newtonjob
Newton Job
6 months
Common #Eloquent mistake! Avoid pulling out models into memory just to pluck their keys and run another query. ❌ Try a subquery instead ✅
Tweet media one
3
12
99
@_newtonjob
Newton Job
1 year
⚡️ #Laravel devs, your favorite #eloquent find() method also takes an array of ids and gives you back a collection of models. All of these examples execute the exact same query and gives you the exact same result. 👌 Which do you prefer and why?
Tweet media one
2
29
98
@_newtonjob
Newton Job
4 months
Not sure what others think, but #Laravel 11.x's bootstrap/app.php file gets cluttered very quickly. Thinking of adopting bootstrappers. Just like Laravel does internally with the Kernels
Tweet media one
13
14
98
@_newtonjob
Newton Job
1 year
🔥 #Laravel devs, did you know that your favorite `abort()` helper can take more than just a static status code? You can actually give it a custom Response or Responsable object. Very useful if you need to abort the request outside the context of a middleware or controller.
Tweet media one
3
24
96
@_newtonjob
Newton Job
8 months
Whenever I look at a #Laravel codebase that doesn't embrace the framework; 🤮
Tweet media one
22
6
96
@_newtonjob
Newton Job
1 year
#Laravel has powerful features for Authorisation baked into the framework. 🔥 Here's a very simple `Gate` definition that'd prevent banned users from accessing your app. 💅 This little snippet can take you a really long way before you'd even need to reach for a package 📦 😌
Tweet media one
5
26
96
@_newtonjob
Newton Job
1 year
Here's a super simple command to backup your database using the #Laravel `Process` facade. 💅
4
17
97
@_newtonjob
Newton Job
1 year
#Laravel devs, here's a quick little tip to take control when your FormRequest authorization fails. You may override the failedAuthorization() method, and perform your custom logic. Pretty useful if you want to do something nicer than the default plain boring 403 error page 👌
Tweet media one
4
22
93
@_newtonjob
Newton Job
5 months
💡Another common #Eloquent mistake! Sometimes you have a one-to-many or many-to-many relationship and you want to do a bulk attach... Using attach() can be significantly slow and memory inefficient, especially with large records. Whenever possible, consider `insertUsing()`
Tweet media one
4
20
97
@_newtonjob
Newton Job
8 months
Sunday tip for #Laravel devs 🔥 Did you know you can use the `fresh()` method on an #Eloquent collection to get a fresh copy of all models in the collection?
Tweet media one
5
16
96
@_newtonjob
Newton Job
1 year
💡 #Laravel ships with an `Authorize` middleware. Out of the box, it can handle almost all of your authorization needs. You may never need to create a custom middleware. This example shows a common pattern I've seen, and how you may instead take advantage of the framework.
Tweet media one
3
28
94
@_newtonjob
Newton Job
1 year
🔥 #Laravel devs! You may already be familiar with creating macros on the Http facade. Did you also know you can create macros for your custom response format? Have a look 👇
Tweet media one
3
22
94
@_newtonjob
Newton Job
1 year
⚡️ If you want to go wild with your #Laravel #FormRequest , you can take advantage of passedValidation() to fulfill the request in there. Laravel invokes this method when validation/ authorization passes. Then, you will only need to typehint the Request on your controller! 😀
Tweet media one
14
29
93
@_newtonjob
Newton Job
1 year
#Laravel provides a number of ways out of the box, to closely monitor the health of your app ⚡️ You can monitor request, command, and even query durations.
Tweet media one
2
17
91
@_newtonjob
Newton Job
8 months
Sunday tip for #Laravel folks that use #MySQL #Eloquent 's `upsert()` produces "insert into ... on duplicate key update..." MySQL deprecated the use of values() to update rows in favor of row aliases. Here's how you can tell Eloquent to use row aliases🤝
Tweet media one
1
20
93
@_newtonjob
Newton Job
5 months
Curious! Anyone still uses labels and `goto` in modern PHP? 🤔
Tweet media one
23
6
92
@_newtonjob
Newton Job
9 months
Sometimes your app users are not sitting in your local database, or you authenticate them via an external API, or you even have no database and purely communicate with an API. You can still enjoy #Laravel 's simple #Auth features by registering your own simple UserProvider⚡️
Tweet media one
6
14
93
@_newtonjob
Newton Job
1 year
⚡️ #Laravel devs, here's how you can leverage #eloquent 's old mutator syntax for your json columns, to ensure existing values are not overwritten by updates. If you have many models that have same json column (e.g. meta), you may want to extract a little trait around it.
Tweet media one
1
21
89
@_newtonjob
Newton Job
1 year
💡 #Laravel devs, are you familiar with the differences between the attach(), sync(), and syncWithoutDetaching() methods on #Eloquent 's belong-to-many relations? Knowing WHICH to use and WHEN will help you avoid potential bugs and/or unnecessary existence query checks.
Tweet media one
4
25
88
@_newtonjob
Newton Job
1 year
🔥 #Laravel devs, have you tried the contains() method on the #Eloquent Collection? It behaves a little different from that of the base Collection. You may pass it a model to check if the Collection contains a model with same key. Very cool 👌
Tweet media one
7
28
89
@_newtonjob
Newton Job
1 year
💡 #Laravel devs, when an admin creates another user, you may want to generate a random password for the new user and send to them as a welcome email. How have/would you handle this? I'd keep a plainTextToken property on the user, available only for the current request.
Tweet media one
12
13
86
@_newtonjob
Newton Job
2 months
#Laravel devs, never merge eloquent collections of different model types ❌
Tweet media one
2
13
90
@_newtonjob
Newton Job
11 months
💡One huge benefit of the new #eloquent attribute accessor syntax is the ability to easily cache the result of a computationally intensive attribute. Some devs still prefer the old `get{Attribute}Attribute()` syntax. Aren't you missing out on some performance improvements?
Tweet media one
8
12
89
@_newtonjob
Newton Job
1 year
💡 When defining your #Laravel #Eloquent `BelongsToMany` relationship using a custom pivot model, you may pass the pivot model as the second argument to ->belongsToMany(). I find this a lot more convenient than passing a raw string table name and invoking `using()` yet again.
Tweet media one
1
26
87
@_newtonjob
Newton Job
10 months
💡 #Laravel devs, did you know the Rule::unique() and Rule::exists() allow you pass a closure to the using() method? This closure will receive the query builder instance and you chain on it and do all kinds of stuff like you normally would with the query builder.
Tweet media one
3
21
89
@_newtonjob
Newton Job
9 months
If you're inserting many rows into the DB with #Eloquent , I'd recommend defaulting to insert() instead of create(), especially when you don't need those events. It can be wasteful to execute a ton of queries in a loop with create() as opposed to one single query with insert() 🚀
Tweet media one
6
13
88
@_newtonjob
Newton Job
1 year
💡 #Laravel devs, with route model binding, you might be tempted to re-query the db to fetch the same model again in a bid to eager-load some relationships. No don't do that. That's a perfect usecase for Lazy eagerloading. 💅
Tweet media one
6
14
88
@_newtonjob
Newton Job
1 year
⚡️ #Laravel devs, a pretty clean way to utilize laravel's powerful closure based #validation rule would be to define a method on your request class. Then you can use it as a first-class callable on your array of rules. 💅
Tweet media one
3
23
85
@_newtonjob
Newton Job
1 year
💡 The #Laravel Http client allows you throw exceptions if the requests fails with status 4xx/5xx. Http::get('/endpoint')->throw(); But there's more...
Tweet media one
2
12
86
@_newtonjob
Newton Job
1 year
⚡️ #Laravel provides two great ways out of the box to get information about the queries you execute. - Listening for the QueryExecuted event. - Enabling query log and have all your queries logged in a local cache.
Tweet media one
2
22
84