eder / jsonid
PHP Laravel JSON ID
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 5
Type:package
Requires
- php: >=5.6.4
- laravel/framework: 5.4.*
- laravel/tinker: ~1.0
Requires (Dev)
- fzaninotto/faker: ~1.4
- mockery/mockery: 0.9.*
- phpunit/phpunit: ~5.7
This package is not auto-updated.
Last update: 2025-07-06 07:33:52 UTC
README
A Simple Way To Generate The JSON LD
Configure
Setting up you information on config/jsonLd.php
Example
SearchAction
$this->jsonLd = new JsonLd;
$context = ['@context' => 'http://schema.org'];
$type = ['@type' => 'WebSite'];
$data = [
'url' => $this->companyUrl,
'potentialAction' => [
'@type' => 'SearchAction',
'target' => 'https://www.bookmarc.com.au/au/search/{search_term_string}',
'query-input' => 'required name=search_term_string'
]
];
socialProfile
$this->jsonLd = new JsonLd;
$context = ['@context' => 'http://schema.org'];
$type = ['@type' => 'Organization'];
$data = [
'url' => $this->companyUrl,
'sameAs' => config('companyInfo.socialProfile')
];
$script = $this->jsonLd
->context($context)
->type($type)
->data($data)
->getScriptJsonLd();