PHP code example of laragear / poke

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

    

laragear / poke example snippets


use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Auth\RegisterController;

Route::get('register', RegisterController::class)->middleware('poke');

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\StatusController;

Route::get('status', StatusController::class)->middleware('poke:force');

return [
    'mode' => env('POKE_MODE', 'auto'),
    'times' => 4,
    'poking' => [
        'route' => 'poke',
        'name' => 'poke',
        'domain' => null,
        'middleware' => 'web',
    ]
];

return [
    'poking' => [
        'route' => 'poke',
        'name' => 'poke',
        'domain' => null,
        'middleware' => ['web'],
    ]
];

return [
    'poking' => [
        'route' => '/dont-sleep'
    ],
];

return [
    'poking' => [
        'name' => 'my-custom-poking-route'
    ],
];

return [
    'poking' => [
        'domain' => '{user}.myapp.com'
    ],
];

return [
    'poking' => [
        'middleware' => ['web', 'validates-ip', 'my-custom-middleware']
    ],
];

return [
    'poking' => [
        'middleware' => [
            \Illuminate\Cookie\Middleware\EncryptCookies::class,
            \Illuminate\Session\Middleware\StartSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
        ],
    ]
]
bash
php artisan vendor:publish --provider="Laragear\Poke\PokeServiceProvider" --tag="config"
bash
php artisan vendor:publish --provider="Laragear\Poke\PokeServiceProvider" --tag="views"