---
title: "Views"
canonical_url: "https://handbook.propay.co.za/laravel/views"
---
# Views

<note>

Use camelCase names (variables)

</note>

View files and directories MUST use camelCase.

<code-group>

```text [Tree]
resources/
    views/
        pages/
            localGroups/
                show.blade.php
                createDiscussion.blade.php
```

</code-group>

Explicitly pass variables to partials and components

<code-group>

```php [PHP]
// GOOD
{{ $user->name }}
@include('welcome', ['user' => $user])

// BAD
{{ $user->name }}
@include('welcome')
```

</code-group>

## Help your IDE

You SHOULD create and maintain PHPDoc blocks at the top of every view file. You MUST create and maintain PHPDoc blocks for components.

Add PHP injection using `<?php` and `?>`. The `@php` / `@endphp` Blade directive pair looks better, but the tools we use (Psalm, Rector, PHPCS, PHP-CS-Fixer) can’t parse Blade syntax.


## Sitemap

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