### Install Laravel IndexNow Package via Composer Source: https://github.com/laravelfreelancernl/laravel-index-now/blob/next/README.md This command installs the Laravel IndexNow package into your project using Composer, the PHP dependency manager. It fetches the package from Packagist and adds it to your application's dependencies. ```bash composer require laravel-freelancer-nl/laravel-index-now ``` -------------------------------- ### Delay IndexNow Page Submissions in Laravel Source: https://github.com/laravelfreelancernl/laravel-index-now/blob/next/README.md This snippet demonstrates how to delay page submissions to IndexNow using the `IndexNow::delaySubmission` method. The first example uses the default configured delay, while the second shows how to override it with a custom delay in seconds. This mechanism helps prevent spam by dispatching a unique job that won't be duplicated if the same URLs are submitted multiple times before the current job is processed. ```php use LaravelFreelancerNL\LaravelIndexNow\Facades\IndexNow; IndexNow::delaySubmission('https://devechtschool.nl'); ``` ```php use LaravelFreelancerNL\LaravelIndexNow\Facades\IndexNow; IndexNow::delaySubmission('https://devechtschool.nl', 100); ``` -------------------------------- ### Generate IndexNow API Key and Key File Source: https://github.com/laravelfreelancernl/laravel-index-now/blob/next/README.md This Artisan command generates a unique IndexNow API key and creates a corresponding key file in your project's public directory. The displayed key should be copied and placed in your `.env` file to configure the package. ```bash php artisan index-now:generate-key ``` -------------------------------- ### Run Laravel IndexNow Package Tests Source: https://github.com/laravelfreelancernl/laravel-index-now/blob/next/README.md This command shows how to execute the test suite for the Laravel IndexNow package using Composer. Running tests ensures the package functions as expected. ```bash composer test ``` -------------------------------- ### Laravel IndexNow Configuration File Structure Source: https://github.com/laravelfreelancernl/laravel-index-now/blob/next/README.md This PHP array defines the configurable options for the Laravel IndexNow package. It includes settings for the host domain, the unique IndexNow key, key file location, logging behavior, production environment name, target search engine, and submission delay. ```php return [ 'host' => env('APP_URL', 'localhost'), 'key' => env('INDEXNOW_KEY', ''), 'key-location' => env('INDEXNOW_KEY_LOCATION', ''), 'log-failed-submits' => env('INDEXNOW_LOG_FAILED_SBMITS', true), 'production-env' => env('INDEXNOW_PRODUCTION_ENV', 'production'), 'search-engine' => env('INDEXNOW_SEARCH_ENGINE', 'api.indexnow.org'), 'delay' => env('INDEXNOW_SUBMIT_DELAY', 600), ]; ``` -------------------------------- ### Publish Laravel IndexNow Configuration File Source: https://github.com/laravelfreelancernl/laravel-index-now/blob/next/README.md This Artisan command publishes the default configuration file for the Laravel IndexNow package to your application's config directory. This allows you to customize settings such as host, API key, key location, and logging preferences. ```bash php artisan vendor:publish --tag="index-now-config" ``` -------------------------------- ### IndexNow Package Configuration Parameters Source: https://github.com/laravelfreelancernl/laravel-index-now/blob/next/README.md Details of the configurable parameters for the Laravel IndexNow package, typically set in the `config/index-now.php` file or via environment variables. These parameters control how the package interacts with the IndexNow API. ```APIDOC Configuration Parameters: host: string Description: The domain for which pages will be submitted to the search engine. Default: env('APP_URL', 'localhost') key: string Description: The unique key for this domain, generated via artisan command. Default: env('INDEXNOW_KEY', '') key-location: string Description: The directory and/or prefix to the key file. Default: env('INDEXNOW_KEY_LOCATION', '') log-failed-submits: boolean Description: Controls logging of submit attempts in non-production environments. Default: env('INDEXNOW_LOG_FAILED_SBMITS', true) production-env: string Description: The name of the production environment. Submissions only occur if the current environment matches this value. Default: env('INDEXNOW_PRODUCTION_ENV', 'production') search-engine: string Description: The domain of the specific search engine to submit to. Default: env('INDEXNOW_SEARCH_ENGINE', 'api.indexnow.org') delay: integer Description: The delay in seconds for delayed page submissions. Default: env('INDEXNOW_SUBMIT_DELAY', 600) ``` -------------------------------- ### IndexNow Facade Submit Method Source: https://github.com/laravelfreelancernl/laravel-index-now/blob/next/README.md The `submit` method of the `IndexNow` facade is used to send one or more URLs to the IndexNow API for rapid indexing. URLs must be fully qualified and exclude query parameters or fragments to ensure successful submission. ```APIDOC Class: LaravelFreelancerNL\LaravelIndexNow\Facades\IndexNow Method: submit(urls: string | string[]) Parameters: urls: string | string[] Description: A single fully qualified URL string or an array of fully qualified URL strings to be submitted. Constraints: URLs must not contain query parameters or fragments. Return Type: void ``` -------------------------------- ### Submit a Single URL to IndexNow API Source: https://github.com/laravelfreelancernl/laravel-index-now/blob/next/README.md This PHP code demonstrates how to submit a single fully qualified URL to the IndexNow API using the package's facade. It's important that the URL does not contain query parameters or fragments. ```php use LaravelFreelancerNL\LaravelIndexNow\Facades\IndexNow; IndexNow::submit('https://dejacht.nl/jagen'); ``` -------------------------------- ### Submit Multiple URLs to IndexNow API Source: https://github.com/laravelfreelancernl/laravel-index-now/blob/next/README.md This PHP code shows how to submit an array of fully qualified URLs to the IndexNow API in a single request. All URLs provided must be without query parameters or fragments for proper submission. ```php use LaravelFreelancerNL\LaravelIndexNow\Facades\IndexNow; IndexNow::submit([ 'https://dejacht.nl', 'https://dejacht.nl/fotoquiz/', 'https://dejacht.nl/jagen/', 'https://dejacht.nl/jachtvideos/', ]); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.