コード例 #1
0
 public function accountSignout()
 {
     $ses = ApiSession::where('session_key', '=', $_GET['session_key'])->first();
     $ses->delete();
     $data = array('status' => 'ok', 'session' => null);
     return $data;
 }
コード例 #2
0
<?php

/* Api - Require Session Key */
Route::filter('sessionkey', function () {
    if (isset($_GET['session_key']) && sizeof(ApiSession::where('session_key', '=', $_GET['session_key'])->get()) == 1) {
    } elseif (isset($_POST['session_key']) && sizeof(ApiSession::where('session_key', '=', $_POST['session_key'])->get()) == 1) {
    } else {
        $data = array('status' => 'failed', 'error_msg' => 'Missing valid session key');
        return $data;
    }
});
/*
|--------------------------------------------------------------------------
| Application & Route Filters
|--------------------------------------------------------------------------
|
| Below you will find the "before" and "after" events for the application
| which may be used to do any work before or after a request into your
| application. Here you may also register your custom route filters.
|
*/
App::before(function ($request) {
    //
});
App::after(function ($request, $response) {
    //
});
/*
|--------------------------------------------------------------------------
| Authentication Filters
|--------------------------------------------------------------------------