Polyscope - The agent-first dev environment for Laravel

Lara Head

code4mk/lara-head image

Lara Head stats

Downloads
11.6K
Stars
178
Open Issues
0
Forks
12

View on GitHub →

Easily setup seo meta tag with lara-head

installation

composer require code4mk/lara-head

usage meta

~ inside controller

use Khead;
class Test
{
public function home()
{
Khead::setMeta('viewport',[
"name" => "viewport",
"content"=>"width=device-width, initial-scale=1"
]);
}
}

~ inside blade

{{ Khead::getMeta('viewport') }}
// <meta name="bladeport" content="width=device-width, initial-scale=1">

link

Khead::setLink('author',[
"rel"=>"author",
"href"=>"humans.txt"
]);
// blade
{{ Khead::getLink('author') }}
// <link rel="author" href="humans.txt">

script

Khead::setScript('one',[
"src"=>"test.js",
]);
// blade
{{ Khead::getScript('one') }}
// <script src="test.js"></script>

title

Khead::setTitle('this is a title');
// blade
{{ Khead::getTitle() }}

facebook open graph

Khead::setOg([
"app_id" => [
"property"=>"fb:app_id",
"content"=>"123456789"
],
"url" => [
"property"=>"og:url",
"content"=>"https://example.com/page.html"
],
"type" => [
"property"=>"og:type", "content"=>"website"
],
"title" => [
"property"=>"og:title",
"content"=>"Content Title"
],
"image" => [
"property"=>"og:image",
"content"=>"https://example.com/image.jpg"
],
"description" => [
"property"=>"og:description",
"content"=>"Description Here"
],
"site_name" => [
"property"=>"og:site_name",
"content"=>"Site Name"
],
"locale" => [
"property"=>"og:locale",
"content"=>"en_US"
],
"author" => [
"property"=>"article:author",
"content"=>"@code4mk"
]
]);
// blade
{{ Khead::getOg() }}

twitter cards

Khead::setTwitCards([
"card" => [
"name" => "twitter:card",
"content"=>"summary"
],
"site" => [
"name"=>"twitter:site",
"content"=>"@code4mk"
],
"creator" => [
"name"=>"twitter:creator",
"content"=>"@code4mk"
],
"url" => [
"name"=>"twitter:url",
"content"=>"https://code4mk.org"
],
"title" => [
"name"=>"twitter:title",
"content"=>"Content Title"
],
"description" => [
"name"=>"twitter:description",
"content"=>"Content description less than 200 characters"
],
"image" => [
"name"=>"twitter:image",
"content"=>"https://code4mk.org/image.jpg"
],
"dnt" => [
"name"=>"twitter:dnt",
"content"=>"on"
]
]);
// blade
{{ Khead::getTwitCards() }}

Head tags

code4mk photo

code with fun 💗 @mostafa6765 💗

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Code4Mk Lara Head Related Articles

TemPHPest PHP Extension for VSCode image

TemPHPest PHP Extension for VSCode

Read article
Statamic logo

Statamic

The drop-in ready Laravel CMS you’re been waiting for. Go full-stack or headless, flat file or database – it’s up to you.

Statamic
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Celebian logo

Celebian

Celebian is a social media marketing agency specializing in helping their clients go viral on TikTok. Whether you're looking to reach a bigger audience or gain more Tiktok followers, likes, and views, they've got you covered.

Celebian
Tighten logo

Tighten

We help companies turn great ideas into amazing apps, products, and services.

Tighten
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
CodeKudu logo

CodeKudu

Stand-ups, Retrospectives, and 360° Feedback for the entire team. 50% off with code LARAVELNEWS.

CodeKudu