| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Http\Controllers;
- use App\Log;
- 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){
- (new Log([
- 'operation'=>$method,
- 'type'=>$type,
- 'description'=>$description,
- 'id_user'=>$id_user,
- 'ip'=>Request::ip()
- ]))->save();
- }
- public function log($method,$type,$description,$id_user=null){
- (new Log([
- 'operation'=>$method,
- 'type'=>$type,
- 'description'=>$description,
- 'id_user'=>$id_user,
- 'ip'=>Request::ip()
- ]))->save();
- }
- public function apiError($method,$description){
- $this->log($method,'apiError',$description);
- return ['success'=>'false','fail_info'=>$description];
- }
- }
|