Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Sep 9, 2024
1 parent 3d47290 commit 3621ef1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ return [
| @see https://schema.org/WebPage for all available properties
|
*/
'defaults' => [],
'webpage' => [],
],

];
Expand Down Expand Up @@ -207,7 +207,9 @@ This will render all the default tags:

#### From a Controller

Most of the time, your will want to define you seo tags from a controller
Most of the time, your will want to define you seo tags from a controller.
Calling the `seo()` helper will return the current `SeoManager` instance.
This instance is available anywhere in your app through the service container.

```php
namespace App\Http\Controllers;
Expand All @@ -219,9 +221,9 @@ class HomeController extends Controller
function __invoke()
{
return view('home', [
'seo' => SeoManager::default(
title: "Homepage",
)
'seo' => seo()
->setTitle("Homepage")
->setDescription("The homepage description"),
]);
}
}
Expand All @@ -231,7 +233,7 @@ Then, in your view, call `seo`:

```php
<head>
{!! seo($seo) !!}
{!! $seo !!}
</head>
```

Expand Down Expand Up @@ -274,7 +276,7 @@ Then, just echo it in your view:

```php
<head>
{!! seo($seo) !!}
{!! $seo !!}
</head>
```

Expand Down

0 comments on commit 3621ef1

Please sign in to comment.