1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00

Week 29/2022

This commit is contained in:
Samuel Štancl 2022-07-22 16:49:28 +02:00
parent 9ff2f9816b
commit cc3667933a
7 changed files with 82 additions and 2 deletions

View file

@ -0,0 +1,13 @@
---
title: 'dump() and dd() are available on the Eloquent Query Builder '
tweet_id: '1550466500288397313'
thread_slug: weekly-thread-2022-29
author_username: ecrmnn
images:
- 'https://pbs.twimg.com/media/FX9mC2ZUUAEM7Nn.jpg'
created_at: 2022-07-22T13:03:14+00:00
slug: dump-and-dd-are-available-on-the-eloquent-query-builder
---
TIL, in Laravel you can display debug information about the current query with dump() and dd() 🤙
This allows you to see the underlying query and bindings.

View file

@ -0,0 +1,15 @@
---
title: 'HTTP response status can be customized when denying actions via Gates & Policies '
tweet_id: '1550466517061447682'
thread_slug: weekly-thread-2022-29
author_username: timacdonald87
images:
- 'https://pbs.twimg.com/media/FXqQk8faIAAEExm.jpg'
created_at: 2022-07-22T13:03:18+00:00
slug: http-response-status-can-be-customized-when-denying-actions-via-gates-amp-policies
---
🔐🧵 I added a small, but pretty nice, security enhancement in Laravel v9.20.0
When denying actions via Gates & Policies in Laravel, you can now customise the HTTP response status that is returned
This allows you to deny access, while hiding the existence of your resources.

View file

@ -0,0 +1,15 @@
---
title: 'Use `$wire.entangle()` instead of `$entangle` '
tweet_id: '1550466505782874113'
thread_slug: weekly-thread-2022-29
author_username: JuanDMeGon
images:
- 'https://pbs.twimg.com/media/FXu2k3xVEAMUFKg.jpg'
created_at: 2022-07-22T13:03:15+00:00
slug: use-wireentangle-instead-of-entangle
---
TIL:
In Laravel Livewire, it's better sometimes to use wire.entangle(), instead of the entangle directive, avoids weird issues like "invalid or unexpected token."
Thanks, @samuelstancl, for posting that gem. 🔥

View file

@ -0,0 +1,13 @@
---
title: 'You can assert that a job will be deleted from the queue '
tweet_id: '1550466511432650753'
thread_slug: weekly-thread-2022-29
author_username: nuernberger_me
images:
- 'https://pbs.twimg.com/media/FYA56XjXwAQSuf8.jpg'
created_at: 2022-07-22T13:03:17+00:00
slug: you-can-assert-that-a-job-will-be-deleted-from-the-queue
---
🔥 #Laravel testing tip
Asserting that a job will be deleted from the queue