EZQuest multiport hub review: More USB-C ports please

https://photos5.appleinsider.com/gallery/51205-101159-ezquest-hub-header-xl.jpg

EZQuest Hub



AppleInsider may earn an affiliate commission on purchases made through links on our site.

The Ultimate Plus Multimedia Hub Adapter from EZQuest is the one-stop shop for almost any port people need in their computing life, and it’s geared toward Macs with Apple Silicon.

The EZQuest Hub works with Intel, M-Series Macs, and Windows PCs to connect external displays, USB-C devices, and more. It’s especially suited for MacBooks that have a limited number of ports.

EZQuest Hub Specifications

The hub has 13 ports to cover USB, audio, and video ports. For input, it has a USB-C Thunderbolt 4 port, while the output ports include one HMDI at 4K, one HDMI at 4K 60Hz, and a VGA 1080p 60Hz port.

It also has USB-C Power Delivery with passthrough charging up to 100W, one gigabit Ethernet port, four 5Gbps USB-A 3.0 ports, and a 3.5mm audio jack that also supports microphones.

For memory cards, there’s also one reader each for SD and Micro SD cards, offering read speeds of up to 104MB/s and write speeds of up to 80MB/s.

Each port has a helpful label next to it for ease of use.

Design & Construction

The hub is made of aluminum and is just under six inches in depth and width and one inch in height. We always like to see products constructed of premium materials, such as metal, and the EZQuest Hub fits the bill.

Ports on the front

Ports on the front

The size could be better for portability, but it is ideal for those with spacious desks who need many ports for various devices. For example, plug in the included USB-C cable to supercharge a Mac or USB-C iPad.

Using the EZQuest Hub

The EZQuest Hub does exactly what it says on the box for connecting devices. The USB-C PD port is excellent for quickly charging devices, although we would have liked to see at least one more USB-C port.

The hub can handle up to three external displays so people can build out their home workstations. EZQuest provides a handy resolution chart to know what to expect, supporting up to three external extended or mirrored displays.

Resolution chart for external displays

Resolution chart for external displays

The M1 processor can run a single external display using Thunderbolt 4 with the embedded DisplayPort 1.4 spec beyond the integrated display on a MacBook, or beyond the HDMI display on a Mac mini.

The M1 Pro processor doubles that number, allowing users to attach up to two 6K resolution monitors at 60Hz. The M1 Max goes even further to connect up to three 6K resolution displays and one external display with up to 4K resolution at 60Hz.

Using the VGA port requires a driver installation, available along with manuals when the hub is plugged into the computer. A drive appears in Finder with everything needed for the Instant View driver.

We liked that the 3.5mm port supports audio and microphone input, and gamers and podcasters might find a use for it.

Ports on the back

Ports on the back

The four USB-A 3.0 ports can be excellent for some people, although we’re increasingly finding that most of our accessories have moved to USB-C, which is why we wanted to see more of that port on the hub.

We liked using the EZQuest Hub, although it’s a tad large for our preference. But it’s a great option at the price of $169.99. Of course, only some people need this many ports, but this hub is an excellent choice for those who do.

  • Nice design
  • USB-C PD at 100W
  • Multiple ports for external displays
  • Thunderbolt 4 support
  • Only one USB-C output port

Rating: 4 out of 5

Where to Buy

AppleInsider News

Laravel Workflow

https://miro.medium.com/max/251/1*iDNCaKL8Ishw_3e5zVXeeA.pngAllows users to write long running persistent distributed workflows (orchestrations) powered by Laravel queues.Laravel News Links

Native UUID support in Laravel has arrived


In a recent addition native UUID support (and native ULID support) is added by Dries Vints. It’s a great addition for me, as in many applications I tend to favor UUIDs over incremental IDs. I won’t bother you with the discussion of UUIDs vs. incremental IDs in this blog post, but just take a look at the UUID implementation in Laravel.

UUID in Eloquent

As with a lot of functionality in Laravel, the UUID support is really easy to add to any model. Just add the HasUuids trait:

use Illuminate\\Database\\Eloquent\\Concerns\\HasUuids;
use Illuminate\\Database\\Eloquent\\Model;

class Post extends Model 
{
    use HasUuids
}

When you create a model, it will automatically contain a UUID as a key. The trait will automatically set the keyType property to string and the getIncremeting method to return false.

By default, Laravel generates an ordered UUID with this trait.

For more information about those ordered UUID’s, read this blog by Italo Baeza Cabera. There’s currently a draft about new UUID types, which also contains a time ordered version.

Change the UUID type

As stated above, Laravel uses ordered UUIDs by default. If your application requires UUID V4 or even UUID V1, you’re able to achieve that with a small addition.

When you want to change the type of UUID used, you should override the newUniqueId method from the trait with your own version:

public function newUniqueId()
{
    return (string)Str::uuid();
}

This method can be added to the model. When you need this in all your models, you could create an abstract Model class:

abstract class AppModel 
{
    use HasUuids;

    public function newUniqueId()
    {
        return (string)Str::uuid();
    }
}

class Post extends AppModel
{

}

Issue with saving without events

With incremental IDs, the ID is generated by the database. So you will be able to save a model without providing an ID and the database will take care of that.

Some databases aren’t able to generate UUIDs by default (or not easily). That’s why this implementation uses the creating Eloquent model event in the trait boot. This catches the event and sets the UUID for the unique ids. So the main difference is that the IDs are generated in the application instead of in the database.

Read this blog post of Simon Archer to learn more about booting traits with Eloquent.

A side effect of using the creating model event is that it depends on these events. Laravel also offers functionality to save a model without triggering the events, with for example the saveQuietly method. That method doesn’t trigger the model events. In this case, that would result in a model without a generated UUID.

So the code below will most likely result in a database error saying the id field has no default value:

$post = new Post();
$post->title = 'UUID test';
$post->saveQuietly();

If you need to save a model without triggering the events, the solution is to provide the UUID yourself:

$post = new Post();
$post->id = (string)Str::orderedUuid();
$post->title = 'UUID test';
$post->saveQuietly();

When using mass assignment, this could mean you need to unguard the model or add the id field to the $fillable array.

You usually shouldn’t want to use the saveQuietly methods, but in seeders for example, it could be handy.

TLDR

UUID support works as easily as possible, by just adding the HasUuids trait to your models. Be aware that it requires the model events to be fired so saving the model quietly doesn’t provide a UUID to your model.

Laravel News Links

Laravel: How to build an API – Part 1

https://i.ytimg.com/vi/NFK1LfXYDd4/maxresdefault.jpgStart building an API in Laravel with this video tutorial. We’re working with Laravel and building out a JSON API to store data and then listing it back using an index. We cover essential PHP skills needed to put it all together. If you ever wanted to build a contact form or any other kind of form this is the tutorial for you. We cover all the essentials like Creating Models, Database Migrations, Routes, and Controllers so you’ll be able to build your own Laravel API.Laravel News Links

Knots

https://s3.amazonaws.com/revue/items/images/018/025/100/mail/Knots.jpg?1663327286

Once a week we’ll send out a page from Cool Tools: A Catalog of Possibilities. The tools might be outdated or obsolete, but the possibilities they inspire are new. Sign up here to get Tools for Possibilities a week early in your inbox.

Best knot teacher
Animated Knots, animatedknots.com
All knots are knotty and hard to visualize the first time. This free website is the best knot teacher yet. It beats any of the beginner books I’ve seen, as well as all the other knot websites. The key here is the stepped animations synchronized with instructions, which you can run at any speed. Replay them till you get them right. Animated Knots is the next best thing to having old Pete next to ya. Once you get the basic ones down, try some of the harder ones. There are 75 cool knots animated in total. – KK
Next step beyond the basic knots
Morrow Guide to Knots, $18
Knots are such fundamental tools, and matching the right job with the right knot is so often essential, the important next step from the Klutz Book is the equally lucid and fairly comprehensive Morrow Guide to Knots. Last week my wife Ryan gave a glad cry at the clarity in the book when she wanted to see a couple ways to tie a clove hitch, and learned that it’s easy to put a slip in a clove hitch for quick release. – Stewart Brand
Knot substitute
Nite Ize Figure 9 Carabiner$7
The Figure 9 carabiner lets you quickly fasten – and quickly loosen or adjust – a small-diameter rope to a fixed point without a knot deploying a clever combination of friction and angles. To those of us with knot-dyslexia, this is a real boon. The only requirement: your fixed attachment point must feature either a place to clip the carabiner (i.e. a metal loop in a pick-up truck bed or a thin, sturdy tree branch), or something around which your line can be looped. That could mean securing a Tarp tent to a tree, improvising a handle around a bundle of cables, or securing a travel clothesline between window-grate and curtain-rod.

All you need to do is pull the rope through in the right sequence and finish with the rope’s loose end tugged into the notched “V” section to keep the rope attached and taut. There are actually multiple sequences and ways to work the geometry. Three methods are diagrammed in the instructions that come with the carabiner.

Thus far, I have used the devices only with standard-issue parachute cord, but they’re sized to work with a range of small-diameter ropes. Though the tying system looks suspiciously wimpy, I’ve found it is as robust as promised. I ordered the Figure 9s to replace the mesh netting that came with the roof-rack basket on my car. Not only do these make a decent replacement (i.e. riding around with a kayak strapped to my car this summer), but tying one more knot under the car is something I’m glad to skip. Note: the device is anodized aluminum and weighs a bit more than I expected (slight downside to ultra-light hikers); still, “Not for climbing” is printed on the packaging, repeated in the instructions, and emblazoned on each carabiner. I think they mean it. – Timothy Lord

Quick, easy tie-down
Rope Ratchet, $20 (¼-inch, w/rope) roperatchet.com
I wanted to rig a single line of rope across the ceiling of my garage for a storage solution, but was concerned about getting the line tight enough to keep from sagging. Rather than tie up a come-along winch – which requires a lot more hook up room and has a tendency to release quite hard – I saw the Rope Ratchet and decided to give it a try; I’m glad I did. The contraption is basically a rope that’s fed into and around a ratcheting wheel and bracket that holds the line and prevents backspin; you can release the line with a lever. It’s quite simple, but I haven’t seen anything quite like it. I’m using one to hold up a 70-lbs. tackle bag 6 feet off the floor of my garage and another holding about 80 lbs. of plastic lures on a rope stretched across hooks against the ceiling of my garage. I’m using the ¼-inch Rope Ratchet that’s rated for a working load of 150 lbs., but there are different sizes for different needs: the 1/8-inch will hold 75 lbs. up, while the ½-inch will hold 500 lbs. After a number of months, mine are holding strong with no sign of failure. – Doug Mainor

Cool Tools

Laravel Localization Guide step-by-step.

https://uselocale.com/storage/posts/GX1QkQRJvyViR73j1QEjVswYjzAV3bglAfoVfgwa.png

Learn how to fully localize your Laravel application in this tutorial. Localization is essential for your business, so it is to localize your Laravel application.

Learn how to manage your translation files, work with localized strings and create localized routes.

Laravel’s localization features provide a way to work with localized strings but with some extra code, you can convert your application into a real multilanguage app.

Installation

As a Laravel user, we’ll assume you already have a Laravel application, or you created a new one. You can follow the more suitable method from the official documentation or the recent Laravel Bootcamp.

Language files

Language files are stored within the lang directory. Laravel provides two ways to organize your translations.

First, language strings stored in .php files in a directory for each language supported by the application.

/lang
    /en
        messages.php
    /es
        messages.php

With this method, you should define your translation string using short keys like messages.welcome inside a PHP file:

<?php
 
// lang/en/messages.php
 
return [
    'welcome' => 'Welcome to our application!',
];

Or, translation strings stored in JSON files that are placed within the lang directory. Each language supported by your application should have a corresponding JSON file within the lang directory.

/lang
    en.json
    es.json

With this method, the key is used also as a translation for the default locale. For example, if your application has a Spanish translation and English as a default locale, you should create a lang/es.json file:

{
    "I love programming.": "Me encanta programar."
}

You should decide which method is the most suitable for your project depending on your translation strings volume and organization.

While the official docs conclude that JSON files are better for applications with a larger number of translatable strings, we’ve found that this is not always true, and it depends on your application or team.

Our advice is to try and investigate which method works best for your application.

Using translation strings

You may retrieve your string using the __ helper function. Depending on the translation string strategy you choose, you should refer to your translation string in a different way:

  • For short keys (PHP array files): you should use the dot syntax. For example, to retrieve the welcome string from the lang/en/messages.php, you should use __('messages.welcome')
  • For default translation string keys (JSON files): you should pass the default translation in the default language to the __ function. For example, __('I love programming.')

In both cases, if the translation exists does not exist, the __ function will return the translation string key.

Starting here, we’ll use the short keys syntax for our examples, but you can use what works best for your application.

Configuring Laravel locales

Default and fallback locales for Laravel are configured in the config/app.php configuration file:

/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/

'locale' => 'en',

/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/

'fallback_locale' => 'en',

But we also want to define other available locales apart from the default one. We can do that by modifying this configuration file and adding a new available_locales key after your existing locale key:

'locale' => 'en',

'available_locales' => [
	'en' => 'English',
	'pt' => 'Português',
	'de' => 'Deutsch',
],

Redirect and switch locales

There are lots of different ways to set the application locale for every request on your application, but in this article, we’ll create a Middleware to detect the route locale and set the application language.

Creating the middleware

You can create the Middleware using the make:middleware Artisan command:

php artisan make:middleware Localized

We want to register this Middleware in order to be able to use it in our routes files, so we should add it in the app/Http/Kernel.php file. We need to add it on the application’s route middlewares:

/**
 * The application's route middleware.
 *
 * These middleware may be assigned to groups or used individually.
 *
 * @var array<string, class-string|string>
 */
protected $routeMiddleware = [
    // ... other middlewares
    'localized' => \App\Http\Middleware\Localized::class,
];

And finally, we can add the localization features to our middleware:

<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class Localized
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse)  $next
     * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
     */
    public function handle(Request $request, Closure $next)
    {
        if (! $routeLocale = $request->route()->parameter('locale')) {
            return redirect($this->localizedUrl($request->path()));
        }

        if (! in_array($routeLocale, array_keys(config('app.available_locales')))) {
            return redirect($this->localizedUrl($request->path()));
        }

        $request->session()->put('locale', $routeLocale);
        app()->setLocale($routeLocale);

        return $next($request);
    }

    private function localizedUrl(string $path, ?string $locale = null) : string
    {
        /**
         * Get the default locale if it's not defined
         */
        if (! $locale and request()->session()->has('locale')) {
            $locale = request()->session()->get('locale');
        }

        return url(trim($locale . '/' . $path, '/'));
    }
}

Adding locale to routes

Modify your routes/web.php file to add the locale prefix and the redirection middleware:

<?php

use Illuminate\Support\Facades\Route;

/**
 * Localized routes
 */
Route::prefix('{locale?}')
    ->middleware('localized')
    ->group(function() {
        Route::get('/', function () {
            return view('welcome');
        });
    });

/**
 * Other non-localized routes
 */

Switching locale

At this point, you can simply add your locale prefix to your URL, and the middleware will set your application language. For example, /pt will set the application locale to Portuguese. Also, if you open any localized route without a locale prefix, the user will be redirected to the last used locale stored in the session.

Finally, you can loop over the available locales to create a localized navigation:

<nav>
    @foreach(config('app.available_locales') as $locale => $language)
        <a href=""></a>
    @endforeach
</nav>

Keep in mind that this is a really simple example. A final version should generate localized links for the current URL on each request.

Parameters

When retrieving translation strings, you may wish to replace placeholders with custom parameters. In this case, you should define a placeholder with a : prefix. For example, you may define a welcome message with a placeholder name:

'welcome' => 'Welcome, :name',

And then retrieve the translation string passing an array of replacements as the second argument:

__('messages.welcome', ['name' => 'Joan']);

You can also modify your placeholder to capitalize the replacement in this way:

'welcome' => 'Welcome, :NAME', // Welcome, JOAN
'goodbye' => 'Goodbye, :Name', // Goodbye, Joan

This is especially useful when a language needs to place the placeholder at the start of the string and another in the middle of it:

'accepted' => 'The :attribute must be accepted.', // English
'accepted' => ':Attribute moet geaccepteerd zijn.', // Dutch

Make it easier with Locale

As a developer, after working on internationalization for your application, you may be involved also in the localization process with translators and your team. That could be a long process and a good reason to choose a translation management tool like Locale.

With Locale, your team and translators will be able to enjoy a next-level localization workflow built for productivity.

Get started for free now and level up your workflow.

You can learn how simple the configuration process is by following our 4-step guide.

And, if you are a visual learner and prefer to watch the process, we’ve recorded a step-by-step video showing how easy it is.

Be the first to know about our awesome new features, promotions and deals by signing up to our newsletter.

Be the first to get notified.

Be the first to know about our awesome new features, promotions and deals by signing up to our newsletter.

Laravel News Links

Are You Nuts? Know your Fishing Knots! – The Dropper Loop

https://www.alloutdoor.com/wp-content/uploads/2022/10/20221027_203759-e1666919780368.jpg

This is a bit unique knot compared to all the others we’ve covered so far. The Dropper Loop does not actually tie anything together, it instead is to create a connection point in the line. The Dropper Loop is very versatile and easy to tie and is a knot that every angler should know how to tie. I use them regularly when fishing bait either in the surf or the boat. These loops are the basis for pompano rigs or chicken rigs offshore. They make a great base for loop-to-loop connections when you need to change leaders quickly or just attach hooks directly to the loops by running the loop through the eye of the hook then wrapping back over the eye of the hook.

Step 1

Start with just your mainline and then make a loop that overlaps.

Step 2

With the loop pass one of the line from one side of the loop through and around to the other side of the loop. With that side make 5+ wraps around the line. The process of making the wraps will leave a new loop open in the center. Keep this new loop open.

Step 3

Take the opposite side of the loop from the wraps and the little loop you made in step two, and run the line through the little loop.

Step 4

Now with the line through the small loop set it to the length you want, and then wet all the lines. Then pull evenly from both sides of the dropper loop. Do this till the coils of the line tighten and the loop is set and stands out from the line. That completes your dropper loop. Now you can use the loop to add a leader too or just attach a hook directly to it.

The post Are You Nuts? Know your Fishing Knots! – The Dropper Loop appeared first on AllOutdoor.com.

AllOutdoor.com

My current setup (end 2022 edition)

https://freek.dev/og-images/e9f9d4c4a27374d1c9a354562ceabd41/2357.png

After tweeting out a screenshot, it often get questions around which editor, font or color scheme I’m using. Instead of replying to those questions individually I’ve decided to just write down the settings and apps that I’m using.

IDE

I mainly program PHP. Mostly I develop in PhpStorm. Here’s a screenshot of it:

I’m using phpstorm-light-lite-theme which was handcrafted by Brent Roose. The font used is Menlo. Font size is 15, line height 1.6

Like seen in the screenshot I’ve hidden a lot of things of the UI of PhpStorm. I like to keep it minimal.
I like working using a light based theme. In some circles this is maybe a bit controversial. Watch this excellent video by my colleague Brent to learn what the benefits of using a light based theme are.

Mostly I work on Laravel projects. One of my favourite PhpStorm extensions is Laravel Idea, which can do stuff like autocomplete route names, request fields, and a whole lot more. It’s paid, but definitely worth it.

Another PhpStorm plugin that I use is the Pest Plugin. It makes Pest a first class citizen in the IDE. This one is free.

Terminal

Here’s a screenshot from my terminal.

All my terminal settings are saved in my dotfiles repository. If you want the same environment you follow the installation instructions of the repo.

My terminal of choice is iTerm2. I’m using the Z shell and Oh My Zsh.

The color scheme used is a slightly modified version of Solarized Dark. The font used is a patched version of Menlo. I’m using several hand crafted aliases and functions.

MacOS

I’m a day one upgrader of MacOS, so I’m always using the latest version. I also sometimes dare to use beta versions of MacOS when people are saying it’s stable enough.

By default I hide the menu bar and dock. I like to keep my desktop ultra clean, even hard disks aren’t allowed to be displayed there. On my dock there aren’t any sticky programs. Only apps that are running are on there. I only have a stacks to Downloads and Desktop permanently on there. Here’s a screenshot where I’ve deliberately moved my pointer down so the dock is shown.

Dock

I’ve also hidden the indicator for running apps (that dot underneath each app), because if it’s on my dock it’s running.

In my dotfiles repo you’ll find my custom MacOS settings.

The spacey background I’m using was the default one on OSX 10.6 Snow Leopard. If you would like to use a class OSX background to, head over to this page at 512pixels.net.

One the most important apps that I use is the excellent Raycast. It allows make me to quickly do basic tasks such as opening up apps, locking my computer, empting the trash, and much more. One of the best built in functions is the clipboard history. By default, MacOS will only hold one thing in your clipboard, with Raycast I have a seemingly unending history of things I’ve copied, and the clipboard even survives a restart. It may sound silly, but I find myself using the clipboard history multiple times a day, it’s that handy.

Raycast is also a window manager. I often work with two windows side by side: one of the left part of the screen, the other one on the right. I’ve configured Raycast with these window managing shortcuts:

  • ctrl+opt+cmd+arrow left: resize active window to the left half of the screen
  • ctrl+opt+cmd+arrow right: resize active window to the right half of the screen
  • ctrl+opt+cmd+arrow right: resize active window to take the whole screen

I’ve installed these Raycast extensions:

  • Laravel Docs: allows me to search the Laravel Docs from anywhere

These are some of the other apps I’m using:

  • To run projects locally I use Laravel Valet.
  • To connect to S3, FTP (?) and sftp servers I use Transmit.
  • Ray is a little homegrown tool that I use for debugging apps.
  • Local mail testing is done with Nodemailer. This handly little app install a local mailserver. In the apps you develop locally you can use that webserver to send mails. You can inspect all sent mails in Nodemailers beautiful, native UI.
  • Sometimes I need to run an arbitrary piece of PHP code. CodeRunner is an excellent app to do just that.
  • Paw is an amazing app to perform API calls.
  • Databases are managed with TablePlus
  • My favourite cloud storage solution is Dropbox. All my personal documents are on there and at Spatie we use it extensively too.
  • If you’re not using a password manager, you’re doing it wrong. I use 1Password. Personal passwords are sync in a vault stored on Dropbox. For Spatie we have a team account.
  • All settings of my apps are backupped to Dropbox through Mackup. This is a fantastic piece of software that moves all your preferences to Dropbox and symlinks them.
  • I don’t use Time Machine, my backups are handled with Backblaze.
  • Tweets are tweeted with Tweetbot.
  • I read a lot of blogs through RSS feeds in Reeder.
  • Mails are read and written in Mimestream. Unlike other email clients which rely on IMAP, Mimestream uses the full Gmail API. It super fast, and the author is dedicated using the latest stuff in MacOS. It’s a magnificent app really.
  • My browser of choice is Safari, because of its speed and low power use. To block ads on certain sites I use the AdGuard plugin.
  • I like to write long blogposts in iA Writer
  • To create videos I use ScreenFlow.
  • I regularly stream stuff on YouTube. For that I use Ecamm Live
  • To pair program with anyone in my team, I use Tuple. The quality of the shared screen and sound is fantastic.
  • Even though I’m not a designer I sometimes have to edit images. For this I use Pixelmator.
  • DaisyDisk is a nice app that helps you determine how your disk space is being use used.
  • Outside of programming, I also record music. My DAW of choice is Ableton, I’m using the complete edition.

iOS

Here’s a screenshot of my current homescreen.

I don’t use folders and try to keep the number of installed apps to a minimum. There’s also just one screen with apps, all the other apps are opened via search. Most of my time is spent in Safari, Pocket, Reeder and Tweetbot. Notifications and notification badges are turned off for all apps except Messages.

Here’s a rundown of some of the apps currently on the homescreen:

  • 1Password: my favourite password manager
  • Air Video HD: I find it much more reliable to sync videos to this one the stock Videos app. No iTunes needed.
  • Overcast: an excellent podcast client
  • Telegram: most of my geeky friends are on there
  • iA writer: to quickly write some stuff or take notes on the go
  • Clock: tick, tock, …
  • Home: my home is full off HomeKit controlled lights, which I switch on/off using this app
  • Reeder: an RSS client
  • Slack: for communicating with my team and some other communities
  • Letterboxd: a pretty imdb. I use it to log every movie I watch
  • Railer: to easily look up the train schedules in Belgium
  • Pocket: my favourite read later service
  • Things: contains my to dos
  • Nuki: this controls the electronic doorlock at our office

There’s no other screens setup. I use the App Library to hunt down any app I want to use that isn’t on the home screen.

Hardware

Here’s a picture of the desk I have at home.

You might be surprised to see a lot of synths there. Next to programming, my big passion is recording music under my artist name Kobus. You can find my music on Spotify and Apple Music.

Behind my desk there’s a Hue Light Strip. When working in the evening, I like to set it to a moody color.

I’m using a MacBook Pro 14″ with an Apple M1 Pro processor, 16GB of RAM and 1T hard disk.

I usually work in closed-display mode. To save some desk space, I use a beautiful vertical Mac stand: the Twelve South BookArc.

Here’s the hardware that is on my desk

As a webcam I use a Sony a6400 camera with a Sigma 16mm 1.4 lens. It is connected to my computer via an Elgato Cam Link 4K. The camera also mounted on a Rode PSA1 boom arm, and when I’m not using it, the camera is behind my monitor.

To connect all external hardware to my MacBook I got a CalDigit TS3 plus. This allows me to connect the webcam / mic / USB Piano keyboard, and more to my MacBook with a single USB-C cable. That cable also charges the MacBook. Less clutter on the desktop, means I have more headspace, so I’m pretty happy with the TS3 plus.

I play music on a HomePod stereo pair. To stay in “the zone” when commuting and at the office I put on my QuietComfort 35 wireless headphones.

My current phone is an iPhone 14 Pro Max with 128 GB of storage.

Misc

  • At Spatie, we use Google Workspace to handle mail and calendars
  • High level planning at the company is done using Float
  • All servers I work on are provisioned by Forge.
  • The performance and uptime of those servers are monitored via Oh Dear.
  • To track exceptions in production, we use Flare
  • To send mails to our audience that is interested in our paid products, we use our homegrown Mailcoach.

If you want to know some more tools we use at Spatie, go over to the uses page on our company website.

In closing

Every year, I write a new version of the post. Here’s the 2021 version.

If you have any questions on any of these apps and services, feel free to contact me on Twitter.

Laravel News Links

Laravel Datetime to Carbon Automatically: $dates or $casts

https://laraveldaily.com/storage/128/Untitled-design-(40).png

In Laravel, there’s a convenient way to transform date/time DB fields to Carbon objects automatically. In fact, there are two ways, let me tell you about both.

Inconvenience: With No Casting

Imagine you have a DB field projects.activated_at with values in the DB like “2022-10-05” or “2021-12-23”, so a typical YYYY-MM-DD.

What if you want to show them in another format to users, like “m/d/Y”?

You need to convert them every time, right? And Carbon library would help, something like this:

1Carbon::createFromFormat('Y-m-d', $project->activated_at)

2 ->format('m/d/Y');

So, you need to create a Carbon object yourself, and then you can convert it to whatever you want.

Every time in every place where you want to show that value.

Wouldn’t it be cool to have something like this?

1$project->activated_at->format('m/d/Y')?

So, meet Eloquent $casts and $dates.


$casts and $dates Properties

For long years in Laravel, there has been a property that you can define on Eloquent models, which fields should be auto-transformed into Carbon objects:

1class Project extends Model {

2 

3 protected $dates = [

4 'activated_at',

5 'deactivated_at',

6 // ...

7 ];

8 

9}

And then, everywhere you use this value, in Blade or elsewhere, you get a Carbon object and can use it like in the example above: $project->activated_at->format('m/d/Y')

But a bit later, Laravel introduced a more global concept of Casting, auto-transforming any field to any of the available types, and date/time became just one single example of a broader casting topic.

From then, the officially recommended behavior became to auto-Carbon the dates with $casts property, instead of the older $dates:

1class Project extends Model {

2 

3 protected $casts = [

4 'activated_at' => 'date',

5 'deactivated_at' => 'date',

6 ];

7 

8}

Notice: the older $dates property also still works, at least at the time of writing this article.

Now, the new casting property comes with an additional benefit: you can also provide the format inside the property, like this:

1protected $casts = [

2 'activated_at' => 'date:m/d/Y',

3 'deactivated_at' => 'date:m/d/Y',

4];

It will not auto-transform the $project->activated_at to the correct format when you access it, but it will do it when you use ->toArray() or ->toJSON() methods on the model.

1$project->activated_at;

2// Value: Illuminate\Support\Carbon @1664928000 {#5836

3// date: 2022-10-05 00:00:00.0 UTC (+00:00),

4// }

5 

6$project->toArray()['activated_at'];

7// Value: 05/10/2022

You can read more about date casting in the official docs.

Laravel News Links