コード例 #1
0
ファイル: routes.php プロジェクト: laravel-packages/loaderio
<?php

use LaravelPackages\Loaderio\Loaderio;
$apps = Loaderio::getApps();
Route::get('loaderio-{app_id}', function ($app_id) {
    // Check is this is a valid app_id
    if (Loaderio::isValidApp($app_id)) {
        // Create our own Http Repsonse and exit so that now other
        // packages can add additional data to the response
        // tool like loic-sharma/profiler screw with the response
        $response = new Illuminate\Http\Response(Request::path());
        $response->send();
        exit;
    }
});
コード例 #2
0
 /**
  * Check if an APP ID is linked to this account
  * @param  string  $app_id Loader.io app_id
  * @return boolean
  */
 public static function isValidApp($app_id)
 {
     $app = Loaderio::api('apps/' . $app_id);
     return $app && $app->app_id == $app_id;
 }