---
title: "Typed Properties"
canonical_url: "https://handbook.propay.co.za/php/typed-properties"
---
# Typed Properties

You should specify property types whenever possible. Don’t use a docblock when you can use typed properties.

<code-group>

```php [UserController.php]
namespace App\Http\Controllers;

class UserController extends Controller
{
    public function __construct(
        public string $username,
        public bool $status
    ) {
        ...
    }
}
```

</code-group>


## Sitemap

See the full [sitemap](https://handbook.propay.co.za/sitemap.md) for all pages.
