PHP code example of darkghosthunter / larapoke

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

    

darkghosthunter / larapoke example snippets




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

Route::get('register', [RegisterController::class, 'showForm'])
    ->middleware('larapoke');



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

Route::prefix('informationForms')
    ->middleware('larapoke:detect')
    ->group(function () {
        
        // Here it will be injected
        Route::get('register', [RegisterController::class, 'showForm']);
        
        // But not here since there is no form
        Route::get('status', [RegisterController::class, 'status']);
    });

 return [
    'mode' => env('LARAPOKE_MODE', 'auto'),
    'times' => 4,
    'view' => 'larapoke::script',
    'poking' => [
        'route' => 'poke',
        'name' => 'larapoke',
        'domain' => null,
        'middleware' => ['web'],
    ]
];

 return [

    // ...

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

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

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

 
return [
    'poking' => [
        'domain' => ['mysubdomain.myapp.com', 'myotherdomain.com']
    ],
];

 
return [
    'poking' => [
        'middleware' => ['auth:api', 'validates-ip', 'my-custom-middleware']
    ],
];
bash
php artisan vendor:publish --provider=DarkGhostHunter\Larapoke\LarapokeServiceProvider