PHP 8 - try out all new features

Published on

PHP 8 - try out all new features

PHP 8 is already in it's release candidate stage, with RC 3 being released on October 29th, and the general availability release targeted for November 26th. So it is time to take a look at all the new and upcoming features of PHP 8. You can take a look at PHP 8's release schedule here.

UPDATE: Free video course If you're more of a visual learner, check out my entirely free video course, covering all new features in PHP 8.

Every feature that you see in this blogpost comes with an interactive embedded editor, where you can modify the PHP code and evaluate the results yourself.

The official upgrade guide can be found on GitHub.

Read more

Announcing Forge CLI

Published on

Announcing Forge CLI

Today I'm happy to tag version 1.0 of Forge CLI - our latest open source package.

Now you might wonder: Forge CLI? Isn't that one of the many, many available Laravel Forge CLI tools? Why do we need another one?

So, yeah - Forge CLI is a CLI tool to interact with your Laravel Forge provisioned server and site. But it works different compared with all the other available tools out there. Let me show you what I mean.

Read more

Introducing Laravel Playground

Published on

Introducing Laravel Playground

I'm super excited to finally reveal a project that I have been working on for a couple of months already. The overall development was pretty time consuming and it involves a lot of interesting challenges to make this work - but I feel like it's finally in a state that I feel good about sharing with others.

Say hello to Laravel Playground:

What is Laravel Playground?

Laravel Playground is a sandbox for your Laravel code and the spiritual successor of Tinkerwell Web. Laravel Playground makes it easy to quickly tinker with any PHP and Laravel code right in your browser. You can embed it into your blog, documentation or website easily!

While the code for Tinkerwell Web was running entirely in your browser, Laravel Playground is running your code on actual servers. This allows you to quickly try out features such as request validation, multiple Laravel routes or even Livewire components!

To get started with Laravel Playground, you can go ahead and take a look at this basic example:

In this example, we are creating two Laravel routes that each display a simple view. Try clicking on the link to the other route and you will see that the URL changes and the other view gets loaded.

This embedded Playground is also editable. You can click on the arrow next to the filename to open the file selection. Feel free to modify one of the views or the route definition file. Now press Ctrl+Enter to reload the code - boom you have updated the snippet right in your browser!

If you want to open the playground in a full-screen editor, just click on the "Edit on Laravel Playground" link on the upper right of the embed. This will open up https://laravelplayground.com with your embedded code prefilled. There you have the same ability to edit your code snippet and run your code.

Livewire support

Laravel Playground comes pre-installed with a hand full of useful Laravel packages. As you can see, the Laravel Debugbar is enabled by default. Another package that you can make use of is Livewire.

Let's take a look at how this works:

As you can see, this playground gives you a ready-to-use Livewire component that you can modify and play with.

When you are on the Laravel Playground website, you can quickly create a new Livewire project (or choose from one of the other available presets) by clicking on the "+" button.

Eloquent models and database support

Laravel playground also allows you to persist data to a SQLite database within each playground. All migrations that you create will automatically be migrated.

Embedding Playgrounds

As you can already see in this blog posts, embedding your code is a big feature of Laravel Playground. That's why we made it extremely simple to embed your code - while still maintaining total control of your code on your own website, documentation or blog.

Let's say that you want to include this piece of PHP code in your blog post:

$slice = Str::of('This is my name')->after('This is');

Laravel Playgrounds prefill embeds can now execute this PHP code for you in a sandboxed environment. This means that you keep your code on your website and Laravel Playground executes and renders it for you.

Here's the example code embedded:

<?php
$slice = Str::of('This is my name')->after('This is');
dd($slice);

The embed code that makes this work is very developer friendly. You can keep your code wrapped in <pre> or <code> blocks on your website and wrap them in a <div> with attributes that control the embed, like this:

<div
    class="laravel-playground"
    data-height="500px"
>
<pre data-filename="index.php">
&lt;?php
$slice = Str::of('This is my name')->after('This is');
dd($slice);
</pre>
</div>
<script src="https://embed.laravelplayground.com"></script>

When embedding your code you can configure and customize quite a lot of things, such as the theme, making embeds read-only, which file to open by default, to show or hide the result/code view, etc.

Closing note

As I said in the beginning of this post: I'm super excited to finally share this with all of you as I've been working on this for a very long time. I hope you like Laravel Playground as much as I do and I can't wait to see it being used in blog-posts all over the place.

If you want to learn more, check out the official documentation on the Beyond Code website.

Read more

HELO giveaway

Published on

Last week I announced that we at Beyond Code have been working on a pretty cool new app called HELO.

It's a desktop application for Windows, Mac and Linux that will make it super easy to test and debug your application mails during development.

Read more

Carbon for your desktop

Published on – 3 minute read

🎨 Create and share beautiful images of your source code.

I'm a huge fan of Carbon - an open source project and website that lets you easily create and download great looking code snippets, like this one here:

Read more

PHP Package Development giveaway!

Published on

I'm super excited to announce that we are giving away 5 PHP Package Development Pro video courses!

More than 2,000 developers have already taken my course and learned how to build reusable PHP packages. The video course contains more than 30 lessons and covers all topics required for you to start writing your own PHP package. It not only focuses on generic PHP packages but also contains a lot of extra videos that cover Laravel specific PHP package development!

You can enter the giveaway using the form below:

Read more

2019 - My year in review

Published on – 13 minute read

A lot of other people, like my friends Freek, Dries and Nuno have already posted their 2019 recap posts and I'm a bit late to the party, so here goes mine. I've been enjoying the christmas holidays and haven't touched my Macbook for the last 10 days, which was super relaxing for me, as I tend to…

Read more

Laravel Form Requests - more than validation

Published on – 8 minute read

Laravel form requests are one of the most underrated features, maybe even a bit "hidden" inside the Laravel framework. Don't just take my word for granted - here's what Taylor Otwell thinks about it: Truth 👌 https://t.co/dug8Gxi1u6— Taylor Otwell 🏝 (@taylorotwell) October 7,…

Read more

Embracing simplicity in your code

Published on – 9 minute read

Before I start going into any details in this blog post, I want us to have the same definition of the meaning of "simplicity" and "simple" that I am referring to in this article. I have created many online video courses over the last couple of years, have given on-site trainings…

Read more

Customizing Ignition with custom solutions

Published on – 3 minute read

Last Friday, my friend Freek Van der Herten and I announced two big projects that we've been working on for the last 8 months.

Flare - an error tracker built specifically for Laravel. You can find out all about it in our extensive blogpost and get on the early access list on the Flare homepage.

And Ignition a beautiful error page for your Laravel applications. It becomes the default error page in Laravel 6.

Read more

Catching incoming emails in your Laravel application with Laravel Mailbox

Published on

While working on a client project over the last couple of weeks, one of the requested features was the ability to fetch incoming emails in the Laravel application. Using services such as Mailgun or Sendgrid, this is perfectly possible, since they offer support for webhooks where they send you either the raw email content, or a parsed version of it so that you can process the message.

Read more

Polishing your code

Published on – 9 minute read

While preparing content for my upcoming PHP Package Development video course I discovered that over the last couple of years I spend more and more time polishing my code before shipping it.

And I believe that this is something that is just as important as the actual coding itself.

Let me talk you through some of the adjustments that I try to make, while working on my codebase and how this can hopefully affect your way of writing good and readable code.

Read more

2018 - my year in review

Published on – 10 minute read

As a lot of other people have started to post their write-ups on how 2018 went for them, I want to join them and tell you a little about what happened to me throughout the last 12 months. I think this is also a great way for me to recap what I have achieved over the last year. So here we go.…

Read more

Finding N+1 Queries in Laravel

Published on – 4 minute read

Using Laravel's Eloquent Active-Record, it becomes incredibly easy to define relations between your models. But with all this ease of use, developers might not notice that their application could be suffering in terms of performance, because of underlying database calls. To give you a better…

Read more

Introducing Laravel Dusk Dashboard

Published on – 10 minute read

Laravel Dusk Dashboard is a Laravel package that gives you a beautiful Dashboard for your Dusk test suites. It completely visualizes the individual steps that are involved when your Dusk tests are running, as well as DOM snapshots for each individual step. This makes it super useful when trying to debug your browser tests and to figure out what they are doing in the background. You can also make use of your browsers debug tools to inspect the DOM snapshots.

Read more