PHP code example of smking / laravel
1. Go to this page and download the library: Download smking/laravel library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
smking / laravel example snippets
// config/smking.php
'auto_inject' => false,
// config/smking.php
'only' => ['products/widget'],
'only' => ['products/*'],
'only' => [
'products/widget', // Variant A — smking enabled
'products/gizmo', // Variant B — smking enabled
// 'products/sprocket' — Control: NOT in `only`, no smking
],
'only' => [], // empty == every HTML page (default behavior)
blade
{{-- 1. Body content (JSON-LD + FAQ + summary) --}}
<x-smking-aeo path="/products/{{ $product->slug }}" />
{{-- 2. SEO meta inside <head> with fallback to your own page data --}}
<head>
<x-smking-meta
:path="request()->path()"
:fallback-title="$product->name"
:fallback-og-description="$product->short_description"
/>
</head>
{{-- 3. Facade for full control --}}
@php($aeo = \Smking::forPath('/products/'.$product->slug))
@if ($aeo->isReady())
<script type="application/ld+json">{!! json_encode($aeo->jsonLd) !!}</script>
<title>{{ $aeo->seo?->title ?? $product->name }}</title>
@endif
bash
php artisan smking:cache:purge /products/widget
bash
php artisan smking:cache:purge --product-id=42
bash
php artisan cache:clear
bash
php artisan smking:circuit:status