Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphjsmit committed Sep 19, 2022
1 parent 9586a9d commit 2e2d8ce
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,31 @@ The following order is used when generating the tags (higher overwrites the lowe
3. Data from the associated SEO model (`$post->seo`)
4. Default data from the `config/seo.php` file

### Passing SEOData directly from the controller

Another option is to pass a SEOData-object directly from the controller to the layout file, into the `seo()` function.

```php
use Illuminate\Contracts\View\View;

class Homepage extends Controller
{
public function index(): View
{
return view('project.frontend.page.homepage.index', [
'SEOData' => new SEOData(
title: 'Awesome News - My Project',
description: 'Lorem Ipsum',
),
]);
}
}
```

```blade
{!! seo($SEOData) !!}
```

## Generating JSON-LD structured data

This package can also **generate structured data** for you (also called schema markup). At the moment we support the following types:
Expand Down

0 comments on commit 2e2d8ce

Please sign in to comment.