asathler's avatar

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's avatar

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's avatar

asathler liked a comment+100 XP

2mos ago

@mtbossa The afterCommit() method in Laravel is not enabled by default because of the potential side effects and flexibility required when dispatching jobs within database transactions.

asathler's avatar

asathler liked a comment+100 XP

2mos ago

It is strange, that we should keep the empty changeName() method on the class.

asathler's avatar

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's avatar

asathler liked a comment+100 XP

2mos ago

Whenever I click the button I get the following error message: "This page has expired. Would you like to refresh the page?" Do you know why it is happening? Just FYI, I am running PHP and NODE in Docker containers. Am I missing some additional configuration for Livewire?

asathler's avatar

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's avatar

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's avatar

asathler liked a comment+100 XP

2mos ago

This only happens after HMR after a change is made to the view. If I refresh the page manually, things work correctly.

asathler's avatar

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's avatar

asathler liked a comment+100 XP

2mos ago

Feedback for tutorial creator: don't use your custom alias, match workflow of your students and type php artisan

asathler's avatar

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's avatar

asathler liked a comment+100 XP

2mos ago

After episode 1, 0.75x playback speed is your friend if you're following along.

asathler's avatar

asathler liked a comment+100 XP

2mos ago

@christogonus

if you're using windows, check mcp.json file inside .junie/mcp/mcp.json change all the \ in the directory url to /

eg

 "command": "C:\\wamp64\\bin\\php\\php8.4.15\\php.exe",

to

 "command": "C:/wamp64/bin/php/php8.4.15/php.exe",
asathler's avatar

asathler liked a comment+100 XP

2mos ago

Thanks Jeff! using boost with markdown skills was exactly what I wanted to learn. Perfect timing on this course! haha

asathler's avatar

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's avatar

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's avatar

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's avatar

asathler liked a comment+100 XP

2mos ago

Hi Caleb, great overview of Livewire 4! I recently purchased Flux UI and I'm loving it. Is the source code for this SPA example available? I'd love to see how you integrated Flux components with the new Livewire 4 features to follow your best practices. Thanks!

asathler's avatar

asathler liked a comment+100 XP

2mos ago

Man you are an inspiration, I really appreciate your contributions to the community, I hope someday I'll be like you, keep it up ❤️

asathler's avatar

asathler liked a comment+100 XP

2mos ago

First time I complete a series in less than 24 hours. Nice one, Caleb! Keep going!

asathler's avatar

asathler liked a comment+100 XP

2mos ago

Thanks for the series, Caleb. Perfect as always!

asathler's avatar

asathler liked a comment+100 XP

2mos ago

It turns out I barely know 10% of the things Livewire can do even before v4. Good job Caleb, this is a great learning resource.

asathler's avatar

asathler liked a comment+100 XP

2mos ago

This was awesome and so well explained. Appreciate everything you do, thanks!

asathler's avatar

asathler liked a comment+100 XP

2mos ago

Sooo amazing

asathler's avatar

asathler liked a comment+100 XP

2mos ago

Series was great! Itching to use v4 now!

asathler's avatar

asathler liked a comment+100 XP

2mos ago

Amazing series - hype for sort and islands. ISLANDS!

asathler's avatar

asathler liked a comment+100 XP

2mos ago

Really smooth hooks here with a perfect syntax!!

asathler's avatar

asathler liked a comment+100 XP

2mos ago

This is awesome! I actually had to implement this in a v3 project recently and did a hacky check for an attribute added by wire:dirty.attr. Glad I can get rid of that!

asathler's avatar

asathler liked a comment+100 XP

3mos ago

Great video, and nice to see an overview of Pulse! Some really nice things available in it.

asathler's avatar

asathler liked a comment+100 XP

3mos ago

@pilat it's designed to be enabled in production. All data is persisted after the response is returned, and you can even set up a Redis ingres to speed things up further. As mentioned, Laravel have been using it without issue in Forge for some time 👍

asathler's avatar

asathler liked a comment+100 XP

3mos ago

Dude! This is awesome!

asathler's avatar

asathler liked a comment+100 XP

3mos ago

0:04 "Here's another little Diddy for ya" 😂 Loving the new features and the easily followable demos!

asathler's avatar

asathler liked a comment+100 XP

3mos ago

I’ve been getting a hard time this week about infinite scroll and optimization in Livewire (not fetching 50 posts on 5th page :D), and then you guys drop this feature like angels. Thank you.

asathler's avatar

asathler liked a comment+100 XP

3mos ago

@jlcara depends on the use-case. for simpler tables, I'd probably start there yep

asathler's avatar

asathler liked a comment+100 XP

3mos ago

Amazing feature! Thanks Caleb ❤️

asathler's avatar

asathler liked a comment+100 XP

3mos ago

@nerisonpitogo hahha understandable. both are there for you

asathler's avatar

asathler wrote a comment+100 XP

3mos ago

Loved new way to @placeholder!

Nice one.

asathler's avatar

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's avatar

asathler liked a comment+100 XP

3mos ago

I believe Test file should be in the same directory with related files. Easy to read and easy to manage.

asathler's avatar

asathler liked a comment+100 XP

3mos ago

Yeah, I was pleased by multi files structure and now.... I'm in love!

asathler's avatar

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's avatar

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's avatar

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's avatar

asathler liked a comment+100 XP

3mos ago

I've recently started learning Laravel, and Livewire was one of the things that pushed me in that direction. I'm so excited to see Livewire 4 released and in action.

Thanks for all the effort you put into Livewire and Flux. I'm also enjoying the beautiful Flux Pro components!

asathler's avatar

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's avatar

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's avatar

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's avatar

asathler liked a comment+100 XP

4mos ago

I think you made a mistake in this video's intro. You said that the example is from nullsafe operator video. It's from match expressions video. Nevertheless, great video.

asathler's avatar

asathler liked a comment+100 XP

4mos ago

I think the Kotlin approach could be a better option. In PHP this can look like this

class SignUp (protected User $user, protected Plan $plan) {
        public function handle() {}
}

And that will be a specific constructor for property promotion