PHP code example of jeanpierregassin / laravel-geo

1. Go to this page and download the library: Download jeanpierregassin/laravel-geo 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/ */

    

jeanpierregassin / laravel-geo example snippets


'site' => [
    'name' => env('APP_NAME'),
    'summary' => 'What your product does, in one plain sentence.',
    'details' => 'An optional longer paragraph with additional context.',
    'sections' => [
        [
            'heading' => 'Documentation',
            'links' => [
                ['title' => 'Getting started', 'url' => '/docs', 'notes' => 'Start here'],
                ['title' => 'API reference', 'url' => '/docs/api'],
            ],
        ],
    ],
],

'llms_txt' => [
    'enabled' => true,
    'path' => 'llms.txt',
],

'structured_data' => [
    'type' => 'Organization', // any schema.org type
    'url' => env('APP_URL'),
],

use JeanPierreGassin\LaravelGeo\Enums\GenerativeEngine;

if ($request->isFromGenerativeEngine()) {
    $engine = $request->generativeEngine();

    if ($engine === GenerativeEngine::ClaudeBot) {
        // Serve a citation-friendly response.
    }
}

use JeanPierreGassin\LaravelGeo\Enums\GenerativeEngineType;

if ($request->generativeEngine()?->type() === GenerativeEngineType::Search) {
    // Invest in a rich, citation-friendly response for answer engines.
}

Route::middleware('geo.detect')->group(function () {
    // Detection runs only on these routes.
});

use JeanPierreGassin\LaravelGeo\Facades\Geo;

Geo::siteProfile();  // SiteProfile: the structured site profile
Geo::llmsTxt();      // string:      the rendered llms.txt Markdown document
Geo::schemaGraph();  // SchemaGraph: the schema.org graph advertised to engines
Geo::renderHead();   // string:      the JSON-LD <script> markup emitted by @geo
bash
php artisan vendor:publish --tag=geo-config
bash
php artisan vendor:publish --tag=geo-views