archtechx / tenancy

Automatic multi-tenancy for Laravel. No code changes needed.
https://tenancyforlaravel.com
MIT License
3.49k stars 415 forks source link

Integrating with artesaos/seotools package #713

Closed thanhtoan1196 closed 2 years ago

thanhtoan1196 commented 2 years ago

Description

Integrating with artesaos/seotools package.

Why this should be added

To optimize SEO for multi-tenant web.

stancl commented 2 years ago

Please use more detail when opening feature requests. If you can explain well what should be done to support this, in what way is it not supported yet, and exactly why this package should be a focus, I'll reopen.

KatiaSishost commented 2 years ago

Hi, @thanhtoan1196 it's easy... use for example:

use Artesaos\SEOTools\Facades\SEOMeta;

$data=WebsiteSetting::select('site_title','site_logo','site_description','theme')->where('id', 1)->get();

foreach($data as $dat) { Theme::uses($dat->theme); SEOMeta::setTitle($dat->site_title); SEOMeta::setDescription($dat->site_description); SEOMeta::setCanonical($request->getHost()); SEOMeta::addKeyword(['key1', 'key2', 'key3']); SEOMeta::addMeta('article:section', 'asd', 'property');

    }

u need a table in your database with this data... this load when u enter to site... and save it in cache view.

thanhtoan1196 commented 2 years ago

ok, thanks