Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

asathler's avatar

asathler liked a comment+100 XP

2mos ago

Sort a table

@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

Laravel Queue Mastery: Ep 8, Designing Reliable Jobs

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

Laravel Queue Mastery: Ep 8, Designing Reliable Jobs

@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

Livewire 3 From Scratch: Ep 3, Binding Data

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

Livewire 3 From Scratch: Ep 3, Binding Data

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

3mos ago

Livewire 3 From Scratch: Ep 2, Using Actions

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

3mos ago

Livewire 3 From Scratch: Ep 2, Using Actions

@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

3mos ago

Livewire 3 From Scratch: Ep 2, Using Actions

@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

3mos ago

Livewire 3 From Scratch: Ep 2, Using Actions

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

3mos ago

Livewire 3 From Scratch: Ep 1, Introduction

@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

3mos ago

Livewire 3 From Scratch: Ep 1, Introduction

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

3mos ago

asathler's avatar

asathler liked a comment+100 XP

3mos ago

Build a Livewire App With Me!: Ep 1, What We'll Build

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

asathler's avatar

asathler liked a comment+100 XP

3mos ago

Leveraging AI for Laravel Development: Ep 2, Laravel Boost is a Must

@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

3mos ago

Leveraging AI for Laravel Development: Ep 2, Laravel Boost is a Must

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

3mos ago

Leveraging AI for Laravel Development: Ep 2, Laravel Boost is a Must

@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

3mos ago

Leveraging AI for Laravel Development: Ep 1, Hello, Junie. Hello, Agent.

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

3mos ago

Leveraging AI for Laravel Development: Ep 1, Hello, Junie. Hello, Agent.

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

3mos ago

Everything New in Livewire 4: Ep 25, Request Interceptors

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

3mos ago

Everything New in Livewire 4: Ep 25, Request Interceptors

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

3mos ago

Everything New in Livewire 4: Ep 25, Request Interceptors

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

3mos ago

Everything New in Livewire 4: Ep 25, Request Interceptors

Thanks for the series, Caleb. Perfect as always!

asathler's avatar

asathler liked a comment+100 XP

3mos ago

Everything New in Livewire 4: Ep 25, Request Interceptors

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

3mos ago

Everything New in Livewire 4: Ep 25, Request Interceptors

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

asathler's avatar

asathler liked a comment+100 XP

3mos ago

asathler's avatar

asathler liked a comment+100 XP

3mos ago

Everything New in Livewire 4: Ep 25, Request Interceptors

Series was great! Itching to use v4 now!

asathler's avatar

asathler liked a comment+100 XP

3mos ago

Everything New in Livewire 4: Ep 25, Request Interceptors

Amazing series - hype for sort and islands. ISLANDS!

asathler's avatar

asathler liked a comment+100 XP

3mos ago

Everything New in Livewire 4: Ep 24, Action Interceptors

Really smooth hooks here with a perfect syntax!!

asathler's avatar

asathler liked a comment+100 XP

3mos ago

Everything New in Livewire 4: Ep 21, Tracking Dirty State

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

Luke's Larabits: Ep 13, Laravel Pulse First Look

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

Luke's Larabits: Ep 13, Laravel Pulse First Look

@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

4mos ago

asathler's avatar

asathler liked a comment+100 XP

4mos ago

Everything New in Livewire 4: Ep 19, Drag and Drop Sorting

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

4mos ago

Everything New in Livewire 4: Ep 18, Appending to Islands

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

4mos ago

Everything New in Livewire 4: Ep 14, Islands

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

asathler's avatar

asathler liked a comment+100 XP

4mos ago

Everything New in Livewire 4: Ep 12, Slots

Amazing feature! Thanks Caleb ❤️

asathler's avatar

asathler liked a comment+100 XP

4mos ago

asathler's avatar

asathler wrote a comment+100 XP

4mos ago

Everything New in Livewire 4: Ep 9, Lazy Loading Placeholders

Loved new way to @placeholder!

Nice one.

asathler's avatar

asathler liked a comment+100 XP

4mos ago

Everything New in Livewire 4: Ep 2, View-Based Components

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

4mos ago

Everything New in Livewire 4: Ep 7, Co-locating Tests

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

4mos ago

Everything New in Livewire 4: Ep 7, Co-locating Tests

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

asathler's avatar

asathler wrote a comment+100 XP

4mos ago

Everything New in Livewire 4: Ep 4, Installing Flux

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

4mos ago

Everything New in Livewire 4: Ep 3, Page Components

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

4mos ago

Everything New in Livewire 4: Ep 2, View-Based Components

@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

4mos ago

Everything New in Livewire 4: Ep 1, Welcome to Livewire 4

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

PHP 8 Crash Course: Ep 8, Weak Maps

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

PHP 8 Crash Course: Ep 6, Named Parameters

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

asathler's avatar

asathler liked a comment+100 XP

4mos ago

PHP 8 Crash Course: Ep 5, $object::class

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

PHP 8 Crash Course: Ep 4, Constructor Property Promotion

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