Simple laravel hook for adding meta tags to head for inertia

Overview

laravel seo hook for js frameworks

simple hook for adding meta tags to for js frameworks inertia:react,vue, etc...

  1. in app/Meta.php put Meta.php code from repo.

  2. in your main blade file (example: app.blade.php) add this

{!! \App\Meta::baseRender() !!}
  1. in app/Providers/EventServiceProvider.php add this (also you need to install laravel/octane) composer require laravel/octane
use App\Meta;
use Illuminate\Support\Facades\Event;
use Laravel\Octane\Events\RequestReceived;

public function boot()
{
    Event::listen(function (RequestReceived $_) {
        Meta::cleanup();
    });
}
  1. finally in your controller you can do this
use App\Meta;

public function index() {
    Meta::addBaseMeta('My Awesome Title');
    
    return Inertia::render('Dashboard');
}
You might also like...
Laravel Real-time chat app demo with React, Laravel Echo, Breeze, Socket.io, Redis, Inertia.js, TailwindCSS stack.

Laravel Real-time Chat App You can build yours from scratch with the following Medium article https://medium.com/@sinan.bekar/build-a-real-time-chat-a

A small package for adding UUIDs to Eloquent models.

A small package for adding UUIDs to Eloquent models. Installation You can install the package via composer: composer require ryangjchandler/laravel-uu

Stop duplicating your Eloquent query scopes and constraints in PHP. This package lets you re-use your query scopes and constraints by adding them as a subquery.

Laravel Eloquent Scope as Select Stop duplicating your Eloquent query scopes and constraints in PHP. This package lets you re-use your query scopes an

The main MageSuite (meta)package to rule them all
The main MageSuite (meta)package to rule them all

A Magento 2 extension ecosystem providing UX/performance improvements and many new features. This is a core metapackage which you should install in or

Manage meta data based on URL path within your app.
Manage meta data based on URL path within your app.

Laravel SEO Manager This package provides simple functionality to manage SEO tags based on URL path within your Laravel application. You can put the U

Clean up and prevent empty meta from being saved for Job, Company, or Resume listings in database

=== Empty Meta Cleanup for WP Job Manager === Contributors: tripflex Tags: wp job manager, meta, cleanup, wpjobmanager Requires at least: 5.2 Tested u

Inertia.js Events for Laravel Dusk

Inertia.js Events for Laravel Dusk Requirements PHP 7.4+ Vue Laravel 8.0 and higher Support We proudly support the community by developing Laravel pac

Pronto Fuel is a heavilly opnionated starter kit for Laravel and Inertia.js powered by Vite

Pronto Fuel Pronto Fuel is a heavilly opnionated starter kit for Laravel and Inertia.js powered by Vite. It ships with autoimporting features and leve

A package that adds view-composer like feature to Inertia.js Laravel adapter

Kinetic A package that adds view-composer like feature to Inertia.js Laravel adapter. Use to be able to share props based on the Inertia component nam

Owner
Razmik Ayvazyan
Razmik Ayvazyan
Simple SSR Head for Inertia.js Laravel

Inertia.js Laravel SSR Head Simple SSR Head for Inertia Laravel, solve the social media metadata display of small Inertia.js x Laravel site. NOT a ful

Lucas Yang 12 Nov 14, 2022
HTML Meta Tags management package available for for Laravel 5.*

HTML Meta Tags management package available for Laravel 5/6/7/8 With this package you can manage header Meta Tags from Laravel controllers. If you wan

Lito 182 Dec 5, 2022
Easily setup SEO in your laravel project with lara-head :heart: @code4mk

installation composer require code4mk/lara-head usage meta ~ inside controller use Khead; class Test { public function home() { Khead::setMeta

null 173 Dec 23, 2022
Git pre-commit hook for Laravel Pint

Laravel Pint githook Git pre-commit hook for Laravel Pint Automatically formats and saves code on commit You no longer need to run the ./vendor/bin/pi

dsoloview 7 Dec 10, 2022
Load head metadata from a manifest file which can be shared with a SPA project

Laravel Head Manifest Installation Step 1: Add Laravel Head Manifest to your laravel project composer require critiq/laravel-head-manifest Step 2: Add

Critiq 1 Nov 17, 2021
Gretel is a Laravel package for adding route-based breadcrumbs to your application.

Gretel Laravel breadcrumbs right out of a fairy tale. Gretel is a Laravel package for adding route-based breadcrumbs to your application. Defining Bre

Galahad 131 Dec 31, 2022
A Laravel package for quickly adding .well-known URLs

A Laravel package for quickly adding .well-known URLs well-known is a Laravel package for quickly adding well-known locations (RFC8615) to a Laravel a

Kim Hallberg 2 Sep 13, 2022
In Laravel, we commonly face the problem of adding repetitive filtering code, this package will address this problem.

Filterable In Laravel, we commonly face the problem of adding repetitive filtering code, sorting and search as well this package will address this pro

Zoran Shefot Bogoevski 1 Jun 21, 2022
Laravel package meta 🧡

About hwa-meta is a meta package. It helps us to build and develop faster with pre-built functions. This saves a lot of time on future projects. We sh

Hwavina 3 Oct 18, 2021
A laravel package to handle model specific additional meta fields in an elegant way.

Laravel Meta Fields A php package for laravel framework to handle model meta data in a elegant way. Installation Require the package using composer: c

Touhidur Rahman 26 Apr 5, 2022