Tangible Bytes

A Web Developer’s Blog

Hugo Markup Attributes

I have been blogging since about 2005 and been through several different platforms in the process

Using a Static Site Generator with content in Markdown is awesome for low maintenance and content portability.

If I move platform it shouldn’t be hard to migrate the content and to that end I want to keep the my posts fairly pure Markdown - but it can be a bit limited.

How do I add some classes to change how it looks?

Read more ...

Laravel Versions

How to find out what version of Laravel you have.

The difference between a laravel-framework update and a laravel skeleton update.

What is Laravel skeleton anyway ?

How to control when you get updates.

Read more ...

Laravel Route Binding Null/Empty Object

Laravel’s routing and binding is nice

But when I got it wrong I didn’t get the kind of error I expected

Laravel automatically resolves Eloquent models defined in routes or controller actions whose type-hinted variable names match a route segment name.

use App\Models\User;
 
Route::get('/users/{user}', function (User $user) {
    return $user->email;
});
Read more ...

Prettier in Docker

I’m working on a PHP project and code review brought up some formatting issues in my CSS.

I wanted to added automated formatting of these files accessible to everyone in the team without them having to install node as this isn’t a JavaScript project.

We already use Docker so that seemed an obvious choice.

Read more ...

Laravel Formatting with ‘Pint’

Code reviews are a real opportunity to learn from each other - we each write code a little differently and bring with us a range of experience. So much better to spend time on this than debating blank lines.

I’m also slightly dyslexic and find it hard to even see the issues some care passionately about.

I want to do the right thing for the team but going through code line by line and applying a strict set of rules is not something I am good at or enjoy.

Computers are good at following rules though.

Read more ...