With the release of Laravel v12.45.0 it’s all about enums!

Loads of methods now accept enums!

A lot of methods now accept enums, which I think is pretty cool. I did however have a helping hand, so I’m a bit biased

The below all have methods that now accept enums, or all of their methods do!

This means we can easily change the enum value without having to slug through tests etc.

Storage Facade

What is the Storage Facade

enum StorageDisk: string
{
    case Test = 'test';
}

// Before...

// Allowed string
Storage::fake('test');
// Or, you had to get the ->value if using an enum
Storage::fake(StorageDisk::Test->value)

// Same for the `persistentFake` method...
Storage::persistentFake(StorageDisk::Test->value)

// Now...
Storage::fake(StorageDisk::Test)
Storage::persistentFake(StorageDisk::Test)

Cache & Session Facade

What is the Cache facade

What is the Session facade


enum Deployment: string
{
    case Started = 'started';
}

// Before...

// Allowed string
Cache::put('test', 1);
// Or, you had to get the ->value
Cache::get(Deployment::Started->value)
 
 
// Now...
Cache::put(Deployment::Started, 1)
Cache::get(Deployment::Started)
Cache::rememberForever(Deployment::Started, fn() => 'This is pretty cool huh?!')


// Same for the Session facade
Session::put(Deployment::Started, 1);
Session::get(Deployment::Started);

What else is new?

I would recommend reading the changelogs, as there’s ALWAYS something new.. But, as one more shameless plug I added the QueuePaused and QueueResumed events so when using the queue:pause, or queue:resume commands the events will be dispatched which means you can subscribe to them and do what you want logic wise ie Slack notifications etc.

What’s cooking?

Call me a chef, I got 2 PR’s in the 13.x pipeline: