Skip to content

Commit

Permalink
Merge branch 'master' of github.com:archtechx/laravel-seo
Browse files Browse the repository at this point in the history
  • Loading branch information
stancl committed May 24, 2021
2 parents 19d46fc + ebdc106 commit 6d15e2c
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,41 @@ To disable an extension, set the second argument in the `extension()` call to fa
seo()->extension('facebook', false);
```

## Examples

### Controller

This example configures SEO metadata from a controller.

```php
public function show(Post $post)
{
seo()
->title($post->title)
->description(Str::limit($post->content, 50))
->flipp('blog', ['title' => $page->title, 'content' => $page->excerpt]);

return view('blog.show', compact($post));
}
```

### View

This example uses a Blade view that sets global SEO config using the values that are passed to the view.

```html
@seo('title', $page->name)
@seo('description', $page->excerpt)
@seo('flipp', 'content')

<h1>{{ $page->title }}</h1>
<p>{{ $page->excerpt }}</p>

<p class="prose">
{{ $page->body }}
</p>
```

## Development

Run all checks locally:
Expand Down

0 comments on commit 6d15e2c

Please sign in to comment.