asathler liked a comment+100 XP
1mo ago
@lukeboy_2002 so same thing.
Instead of:
$this->players = Player::all()->toArray();
You do something like:
$this->players = Player::when($this->sortField, function ($query) {
$query->orderBy($this->sortField, $this->sortAsc ? 'asc' : 'desc');
})->get();
asathler liked a comment+100 XP
2mos ago
Tips: 1-If your job behavior depends on a transaction, ensure that the job is added to the queue only after the transaction is committed. (In the config file, set after_commit to true.)
2-Instead of using dependency injection through the constructor, access the container or objects via the app() helper.
3-If you retrieve an object in a job and then call a method on it, be aware that the object you passed may have changed. To avoid issues like this, always call methods directly on the object instead of passing the object itself.
4-If the job handles sensitive data, implement the ShouldBeEncrypted interface to encrypt this data. (No additional steps are required; Laravel takes care of it for us.)
5- Reading the tips is not enough; always watch the video until the end and ensure that you understand the material correctly.
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
Good point about the fill modifier, since the official docs don't show any example https://livewire.laravel.com/docs/wire-model#all-available-modifiers
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
@ruslanguild It sounds like a CSRF token expired. Do you have the csrf directive in your view?
asathler liked a comment+100 XP
2mos ago
@isimmons I had a similar experience. It got to the point where I had to manually refresh the page in order for it to work correctly, and I started to edit out the few seconds where HMR got weird (so basically all the time). Frustrating from a development standpoint.
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
@johan.vdbroek Noted. However, I'd make the argument that if someone is learning Livewire, they know what "php artisan" is and can easily translate an alias for it.
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
For anyone considering this series, I'd recommend https://laracasts.com/series/livewire-3-from-scratch instead
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
@milon He mentioned a link: https://wisprflow.ai, from Episode 1: "Hello, Junie. Hello, Agent.", time: 08:24.
asathler liked a comment+100 XP
2mos ago
I’m currently using two setups in parallel: Codex via VS Code (with the weekly reset) and AI Assistant Business in PhpStorm, which comes with 20 monthly credits.
In practice, I mainly use AI Assistant in PhpStorm for generating PR comments and doing self-reviews, while I rely on Codex more for agent-based workflows and deeper coding tasks in VS Code. So far, I’ve been a bit hesitant to use agents in AI Assistant because I’m unsure how quickly the 20 monthly credits get consumed.
Because of that, I’ve limited my AI Assistant usage mostly to lighter tasks, even though I’m considering whether it might make sense to shift more of my workflow (including agents) into PhpStorm.
I’m curious how this works out for others in real-world usage: how quickly do the credits get used when you work with AI Assistant more intensively, especially with agents? Have the 20 monthly credits been sufficient for you, or do you find yourself hitting limits?
asathler liked a comment+100 XP
2mos ago
Thank you for mentioning Wispr Flow in the course. While it offers helpful accessibility features for people with pain, fatigue, low vision, or limited mobility through voice dictation, it does not appear to include specific adaptations for deaf users. There is no support for sign language, real-time captioning, or visual communication features, which limits its usefulness for the deaf community.
We believe this is an important aspect to consider when discussing accessibility. Thank you for highlighting this topic.
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
2mos ago
asathler liked a comment+100 XP
3mos ago
asathler liked a comment+100 XP
3mos ago
asathler liked a comment+100 XP
3mos ago
asathler liked a comment+100 XP
3mos ago
asathler liked a comment+100 XP
3mos ago
asathler liked a comment+100 XP
3mos ago
@nerisonpitogo hahha understandable. both are there for you
asathler wrote a comment+100 XP
3mos ago
asathler liked a comment+100 XP
3mos ago
Love Livewire!
I'm running Livewire in a somewhat weird way these days. I store the full page response as plain html pages, stripping out CSRF tokens and anything dynamic using middlewares and such. On page load I inject them again using fetch requests and cookies.
Livewire is still there, I just use the manual Livewire.start() approach to ensure CSRF tokens are injected before booting it. Works great, and I can now serve the whole app through a CDN like Cloudflare, giving me instant response times. Any Livewire update request just goes straight back to the server as usual. Just gotta make sure the cache gets busted on updates, but that's simple enough.
asathler liked a comment+100 XP
3mos ago
asathler liked a comment+100 XP
3mos ago
asathler wrote a comment+100 XP
3mos ago
I was just looking for LW... but I "found" a new fresh LW4 series from 2 days ago!
I Intended to see all episodes right now.
Thanks @calebporzio.
asathler liked a comment+100 XP
3mos ago
I've used livewire 4 beta since the start and I do have to admit that I love it. The combo Laravel + Livewire + Alpine is fantastic. The syntax is really simple to understand and figure out. The code is pretty and intuitive.
If I can just share my opinion on something, I'd say that the commands don't always feel super intuitive (at least for me).
For example,
- if u create a layout, you use the command : artisan livewire:layout
- if u create a page, you use the command : artisan make:livewire pages::post.create
It feels inconsistent to me as livewire can be a prefix and a suffix in the command.
Maybe, it would be cool if we could customize (idk if it's possible) the commands to be something like :
- artisan livewire:layout
- artisan livewire:pages post.create
- artisan livewire:component button
I hope theses feedbacks may help or give ideas.
Thanks anyway for the amazing release of this V4 and have a great day.
asathler liked a comment+100 XP
3mos ago
@FrankMawn Yep! I wanted people to take advantage of all the LW4 goodness without having to buy-into a completely different paradigm
asathler liked a comment+100 XP
3mos ago
asathler liked a comment+100 XP
4mos ago
But $this->dispatchCount[$event] is not equal to $this->dispatchCount[$event::class] because the latter counts for the Class used and the former counts for this particular object instance.
So if you had
$eventA = new SomeEvent();
$dispatcher->dispatch($eventA);
$eventB = new SomeEvent();
$dispatcher->dispatch($eventB);
you would have a 1 for the first object and a 1 for the second object using $event as a key.
But if you would use the classname it would count 2 for the Class SomeEvent.
That's a piece of information I was missing from the video... :)
asathler liked a comment+100 XP
4mos ago
I like the idea of named parameters, that way you know what you pass into a method.
If you have lots of optional parameters and you need to set some of them.
function someFunction($parameter1, $parameter2 = null, $parameter3 = null)
{
}
To set only prameter 1 and 3 I need to do something like this in php7
someFunction(
'Parameter1 value',
null,
'Parameter3 value'
);
Which I think is kinda smelly.
This is much better imho.
someFunction(
parameter1: 'Parameter1 value',
parameter3: 'Parameter3 value
);
Then again I think this is most usefull when working with the database records and in that case it would be easier to pass the model into the method or use a method on the model.
asathler liked a comment+100 XP
4mos ago
@clark saw them in Laravel 9 and was wondering what the heck was going on. https://laravel.com/docs/9.x/eloquent-mutators#defining-an-accessor
asathler liked a comment+100 XP
4mos ago
asathler liked a comment+100 XP
4mos ago