Other Features
SEO / Meta
Setup meta data for your pages.
Intro
resources/js/Components/AppHead.vue
This component is already included with the layouts.
Props
None of the props is required.
- title: Page title. Defaults to pageTitle global prop if not set.
- description: Page description.
- url: Page canonical URL.
- image: Image URL.
- imageWidth: Image width in pixels.
- imageHeight: Image height in pixels.
- imageAlt: Image title.
- author: Author of the page. Defaults to global author.
- twitterCard: Twitter/X card type. Defaults to global twitter card value.
- twtterCreator: Twitter/X username of the author of the page.
- createdAt: Date when page was created.
- updatedAt: Date when page was last updated.
- pagination: Pagination data.
How to use it?
Pass the props from Controller.
Wrap your page in PageLayout
and meta data will be automatically rendered.
MyPageIndex.vue
Meta title
Meta title can be set in three different ways:
- Pass the
title
inmeta
prop as in example above. - Set
pageTitle
(withouttitle
inmeta
) and this value will be used. - Override title (or any other meta tag) in your page components, right after the layout
I highly recommend to use
meta
prop for public pages.Tab title
Tab title (browser) will be automatically set from meta title.
You can also set or override tab title using Head
component.
Pagination
Pagination has three required parameters.
You can generate such array in PHP using this helper function.
Then you should use this data to render pagination component.
Check out modules/Blog/app/Http/Controllers/PublicBlogController.php
for real example using pagination.