<?php

namespace App\Http\Controllers;

use App\Log;
use App\Services\LogService;
use App\User;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Str;
use Zttp\Zttp;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
    static public function logS($method,$type,$description,$id_user=null){
        app('LogService')->log($method,$type,$description,$id_user=null);
    }
    public function log($method,$type,$description,$id_user=null){
        app('LogService')->log($method,$type,$description,$id_user);
    }
    public function apiError($method,$description){
        app('LogService')->log($method,'apiError',$description);
        return ['success'=>'false','fail_info'=>$description];
    }
}
