4,070 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
Started a new Conversation Defining How Models Are Serialized When In A Relationship
Haven't been able to figure this out, hopefully someone has a nice trick to make this work.
I have a User model and several other models that have user relationships. When a user is serialized directly (e.g. a controller returns just a single user), I want it to include a full set of data for the user (id, username, name, email, etc.). However, when one of the other models are serialized and they include users (by way of using protected $with = ['users'];
on the model) in the serialized data, I want the users to be serialized using a subset of data (e.g. just name and id).
My current workaround is to hide the relationship using protected $hidden
, create a separate attribute with a different name (e.g. users_data
), include that in protected $appends
, add the attribute method (e.g. getUsersDataAttribute()
), and in that method I'm returning the minimal set of data. This works, but I'm hoping a more elegant solution exists.
Thanks!
Replied to Laravel Got Stuck After Login. Laravel 5.8
@jlrdw @norbertho this looks like it might be related to password extensions (lastpass, 1password). Did you see my notes above? Give it a read, you might find an explanation for why one of you experiences the issue and not the other.
Replied to Laravel Got Stuck After Login. Laravel 5.8
Here's what I've gathered so far, in the hope that it helps someone else connect dots that they've observed:
artisan ui:auth
to scaffold the auth files, and have been able to replicate the issue (locally, using valet... however, I'm also experiencing this issue on a production site).file
), and the problem persists in each case.Replied to Laravel Got Stuck After Login. Laravel 5.8
Currently working through the same bug. I've also noticed it in Chrome, on an app using Laravel 7, only in two of my three profiles in Chrome. I've disabled all extensions in a profile and in incognito with no success. Here's something quite strange I've noticed: if I login in under 10 seconds, it fails (perpetual loading, nothing happens, etc.). If I wait more than 10 seconds to login, the login goes through without a hitch.
Awarded Best Reply on Some Events Aren't Broadcasting Using Vapor + Pusher
Got to the bottom of this. It turns out that Vapor sets the env var QUEUE_CONNECTION
to sqs
by default. My events preceded deleting objects, so when the queue job ran, the objects were no longer available. I haven't figured out why this error wasn't logging anywhere, but that's a question for another day.
In my case, the simplest solution was to update my events to implement ShouldBroadcastNow
instead of ShouldBroadcast
to force them to use the synchronous queue.
Replied to Some Events Aren't Broadcasting Using Vapor + Pusher
Got to the bottom of this. It turns out that Vapor sets the env var QUEUE_CONNECTION
to sqs
by default. My events preceded deleting objects, so when the queue job ran, the objects were no longer available. I haven't figured out why this error wasn't logging anywhere, but that's a question for another day.
In my case, the simplest solution was to update my events to implement ShouldBroadcastNow
instead of ShouldBroadcast
to force them to use the synchronous queue.
Replied to Some Events Aren't Broadcasting Using Vapor + Pusher
Hey @tinfoilman, I haven't figured it out yet unfortunately. I fear I'm on the path you are, dd()
, deploy, dd()
, deploy...
Started a new Conversation Some Events Aren't Broadcasting Using Vapor + Pusher
My application is using Vapor with AWS, and it uses Pusher for real-time functionality.
Locally, my application is working as expected. I have several events and all of them broadcast as expected through Pusher. In addition to the application working, I can also confirm that all events are broadcasting by using the Pusher Debug Console.
I currently have one vapor environment, production. Some events are broadcasting on production, but others are not. I cannot figure out why some events are not broadcasting, and I've ripped out what's left of my hair.
I have one event in particular which is broadcasting in some contexts but not others. Specifically, this event has a "status" property which is a string of either "open", "close", or "delete". The event is dispatched in three controller methods, the resource's store()
, update()
, and delete()
methods respectively. The event dispatches are identical aside from the status argument. The event broadcasts on a PresenceChannel
.
Here's what I've tried or learned so far:
Log::debug()
calls in the application in a few spots: the controller methods of events which are and are not working, the __construct()
method of the event, and the broadcastOn()
method of the event. Locally, all the log entries write as expected. On production, the Log::debug()
call in the broadcastOn()
method never fires, even on the event broadcasts which are working. The other log entries do work.Thanks in advance for any suggestions and assistance!