Skip to content

Commit

Permalink
docs: add imports to code examples
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdw committed Sep 6, 2024
1 parent 6e6a556 commit 2f4a8c7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ includes:

```php
<?php

use Livewire\Attributes\Computed;
use Livewire\Component;

class ShowPost extends Component
{
#[Computed]
Expand All @@ -48,13 +52,17 @@ The older, ["getter" style attributes](https://laravel-livewire.com/docs/2.x/pro

```php
<?php

use Livewire\Component;

class ShowPost extends Component
{
// Computed Property
public function getPostProperty()
{
return Post::find($this->postId);
}
}
```

## Contributing
Expand Down

0 comments on commit 2f4a8c7

Please sign in to comment.