lee-to/laravel-seo

This package is abandoned and no longer maintained. No replacement package was suggested.

Laravel seo module

v0.8 2021-05-04 07:29 UTC

This package is auto-updated.

Last update: 2023-05-23 21:04:39 UTC


README

Install

  • composer require lee-to/laravel-seo

  • php artisan vendor:publish --provider="Leeto\Seo\Providers\SeoServiceProvider"

Usage

  • add seo template trait to model
use Leeto\Seo\Traits\Seo

and call in controller

$model->seo();
  • in AppServiceProvider
//boot

seo()->generate();
  • in view
{!! \Seo::meta() !!}
{!! \Seo::h1() !!}
{!! \Seo::text() !!}

Integration with laravel-admin

  • add to admin route
Route::resource('seo', \Leeto\Seo\Admin\Controllers\SeoController::class);
Route::resource('seotemplates', \Leeto\Seo\Admin\Controllers\SeoTemplateController::class);
Route::resource('redirects', \Leeto\Seo\Admin\Controllers\RedirectController::class);
  • add to admin menu
["class" =>\Leeto\Seo\Admin\Controllers\SeoController::class, "title" => "Seo"],
["class" =>\Leeto\Seo\Admin\Controllers\SeoTemplateController::class, "title" => "Seo templates"],
["class" =>\Leeto\Seo\Admin\Controllers\RedirectController::class, "title" => "Redirects"],