PHP
Custom Access Tokens in Laravel Sanctum
Thanks to Doeke Norg personal access tokens became more flexible in Sanctum. In this blog post, he explains how you might use the new functionality Read More
Thanks to Doeke Norg personal access tokens became more flexible in Sanctum. In this blog post, he explains how you might use the new functionality Read More
It’s not perfect, but it’s practical Continue reading…
[AdSense-A]
Our team has released a new package called file-system-watcher. As the name implies, this package can watch changes in the file system and let you act on those changes.
Here's a simple example that allows you to run some code when a new file gets added.
use SpatieWatcherWatch;
Watch::path($directory)
->onFileCreated(function (string $newFilePath) {
// do something...
})
->start();
After calling start, the watcher will start a never-ending loop. When a file is created in the given $directory, the closure passed in onFileCreated will be executed.
There are methods for each kind of file change onFileCreated(), onFileUpdated(), onFileDeleted(), onDirectoryCreated(), onDirectoryDeleted().
Pretty simple, right?
Under the hood, this package leverages (https://github.com/paulmillr/chokidar), a popular JS library that can efficiently handle file system changes without requiring much memory or CPU.
To see a demo of the package and learn how we integrated our PHP code with a JS package, watch this fragment of a stream in which I introduced our file-system-watcher.
There are a few more options available in file-system-watcher. Head over to the readme on GitHub to learn more.
Be sure also to check out the packages our team has created previously. I'm sure there is something that you could use in your next project.
(more…)Image: Bungie Some Destiny 2 players have been able to play with people on other platforms after developer Bungie inadvertently switched the feature on. Bungie previously said that crossplay would be coming in fall 2021 Read more…
There are lots of fun Python snippets out there that you can use to convert your photos into ASCII art. Anthony Shaw, an author, and contributor at Real Python, has his own snippet on GitHub. Read more…
Project Connected Home over IP (CHIP) — the ambitious smart home partnership that will see Amazon, Apple, Google, Samsung, the Zigbee Alliance, and dozens of other companies work together on an open standard — has Read more…
An in-depth guide on offset and cursor pagination in Laravel, and the pros and cons of each. Read More
A legit flagship from one of China’s biggest brands Continue reading…
Jordi is back with another post containing interesting statistics around PHP usage. Read More