Example #1
0
Route::post('admin/update', 'AdminController@update');
Route::get('admin', 'AdminController@login');
Route::get('admin/register', 'AdminController@registration');
Route::post('admin/regsave', 'AdminController@regsave');
Route::get('admin/delete/{id}', 'AdminController@destroy');
Route::get('/images/{filename}', function ($filename) {
    $path = storage_path() . '/' . $filename;
    $file = File::get($path);
    $type = File::mimeType($path);
    $response = Response::make($file, 200);
});
// Route::get('home', 'HomeController@index');
Route::get('/artikel', 'ArtikelController@home');
Route::get('/artikel/list/{slug}', 'ArtikelController@getartikel');
Route::get('/artikel/add', 'ArtikelController@postartikel');
Route::post('/artikel/save', 'ArtikelController@saveartikel');
Route::get('/artikel/edit/{id}', 'ArtikelController@editartikel');
Route::post('/artikel/update', 'ArtikelController@update');
Route::get('/artikel/delete/{id}', 'ArtikelController@deleteartikel');
Route::get('/images/{filename}', function ($filename) {
    $path = storage_path() . '/image/' . $filename;
    $file = File::get($path);
    $type = File::mimetype($path);
    $response = Respone::make($file, 200);
    $response->header("Content-Type", $type);
    return $response;
});
// Route::controllers([
// 	'auth' => 'Auth\AuthController',
// 	'password' => 'Auth\PasswordController',
// ]);
 public function postAuthen()
 {
     $email = Input::get('email');
     $pcode = Input::get('pcode');
     $url = "http://www.sximobuilder.com/clients/authentication/get/?envantoname={$email}&envantocode={$code}";
     $result = self::getCurl($url);
     $validate = json_decode($result, true);
     //print_r($validate);
     if (!$result) {
         return Respone::json(array('status' => 'noconn', 'message' => ' <h3> No Internet Connection </h3> The Builder require internet connection'));
     } else {
         if ($validate['status'] == 'success') {
             $this->session->set_userdata('uname', $uname);
             //	$val = base64_encode(serialize($result));
             $this->session->set_userdata(md5('clientInfo:' . $uname), $validate);
             echo $result;
             //redirect('tools/builder.builder',301);
         } else {
             echo $result;
         }
     }
 }