mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 01:44:03 +00:00
Merge branch 'master' of github.com:archtechx/laravel-seo
This commit is contained in:
commit
6d15e2c008
1 changed files with 35 additions and 0 deletions
35
README.md
35
README.md
|
|
@ -206,6 +206,41 @@ To disable an extension, set the second argument in the `extension()` call to fa
|
||||||
seo()->extension('facebook', false);
|
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
|
## Development
|
||||||
|
|
||||||
Run all checks locally:
|
Run all checks locally:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue