<?php

namespace App\Modules\Logs;

use Illuminate\Http\Request;
use App\Http\Controllers\BaseController;

class LogControllerREST extends BaseController
{
    /**
     * Store a newly created resource in storage.
     *
     * @return Response
     */
    public function store(Request $request)
    {
        $log = new Log($request->all());

        if (! $log->save()) {
            return response()->json([
                'errors' => $log->errors->all(),
            ], 400);
        }

        return $log;
    }
}
