32 lines
826 B
PHP
32 lines
826 B
PHP
<?php
|
|
|
|
namespace App\Widgets;
|
|
|
|
use Arrilot\Widgets\AbstractWidget;
|
|
use App\Http\Requests\LambdaRequest;
|
|
class VivaCompatitionLiveScore extends AbstractWidget
|
|
{
|
|
/**
|
|
* The configuration array.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $config = [];
|
|
|
|
/**
|
|
* Treat this method as a controller action.
|
|
* Return view() or other content to display.
|
|
*/
|
|
public function run()
|
|
{
|
|
//
|
|
$response = LambdaRequest::signedrequest('get', 'competition', 'contest/list', ['scores' => 'yes'] );
|
|
//echo '<pre>'; print_r($response); exit;
|
|
if($response->statusCode == 200) {
|
|
return view('widgets.viva_compatition_live_score', ['title' => $this->config['title'], 'scores' => $response->data->items]);
|
|
} else {
|
|
return '';
|
|
}
|
|
}
|
|
}
|