Here’s a quick tip for those out there who tries to test an <input type="date"> field with Laravel Dusk.

->type('#birthday', '1990-01-01') doesn’t work the way you expect, but this does:

Suddenly one day, I got the following error message when running php artisan dusk :

Since it came out of nowhere, I figured a simple update might help…

…but it didn’t. At least the error message changed:

But after a bit of googling, this command solved the problem and I could run my tests again:

I just ran a simple composer require [...] command in a Laravel project on my local machine.

And so it begins!

Really? Locally, on my computer? Anyway, Composer has a helpful section covering this topic on the Troubleshooting page.

I’ve been working on my first Gatsby project recently: a headless WordPress blog!

I love all the smartness Gatsby gives you out of the box and how optimized for performance it is. For example, these are some of the things the gatsby-image component takes care of:

  • Image optimization
  • Lazy loading

So I ran a simple composer global update command this afternoon — you won’t believe what happened then! 😱

I tried to start Laravel Valet as usual:

…but suddenly got this error message, which I haven’t seen before:

The solution turned out to be this:

After that, valet start ran as expected 👌🏻 Hope this was helpful 🤗

Imagine having these categories in WordPress:

Then imagine a category page called Movies on which we wanna list the child categories, but only the first level.
So in this example, we just wanna see:

  • Sci-fi
  • Comedy

I recently found myself having a really strange and hard to solve problem. When moving a new WordPress site from the development server to production, Vimeo embeds suddenly didn’t work anymore.

After lots of googling, I found the following script:

If no headers is being printed, the server is blocking the Vimeo IP. So there’s nothing you can do about it yourself.
Instead, you have to contact your web host and ask them to help you.

Imagine a Vue Component which displays a list of posts based on a category. These are fetched from something like the WordPress Rest API.

The template could look something like this:

But how could we populate the data object with posts loaded asynchronously before the component is being rendered?

It’s quite simple actually, using the created() lifecycle hook:

posts in the object returned by the data function is set to null from the start. Using Axios, the posts is being loaded and then assigned to the data object.

That’s it! 🤗

In order to change the default markup which WordPress creates when inserting an image with a caption, the img_caption_shortcode filter can be used.

For example, if you wanna wrap the image and caption with a <figure> and <figcaption> instead of the default <div> , this is how you can do it:

What I wanted to do was something like this:

…but using the rest API provided by WordPress. This is how you make this query:

Easy when you know it, a bit tricky when you doesn’t! 🤷🏼‍♂️

Stefan Ledin

Web developer who makes fast WordPress sites with clean code and awesome backends. Also, JavaScript is nice!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store