Repository URL to install this package:
|
Version:
0.2.1 ▾
|
<?php namespace Modules\Courses\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Modules\Courses\Services\AnalyticsService;
class AnalyticsController extends Controller
{
/**
* @var AnalyticsService
*/
private $service;
public function __construct(AnalyticsService $service){
$this->service = $service;
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function time(Request $request)
{
$data = $request->all();
//$this->authorize($this);
if($this->service->store($data)){
return response()->json([
'success' => true
], 200);
}else{
return response()->json([
'success' => false
], 400);
}
}
}