Controller.php 1020 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Log;
  4. use App\Services\LogService;
  5. use App\User;
  6. use Illuminate\Foundation\Bus\DispatchesJobs;
  7. use Illuminate\Routing\Controller as BaseController;
  8. use Illuminate\Foundation\Validation\ValidatesRequests;
  9. use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
  10. use Illuminate\Support\Facades\Auth;
  11. use Illuminate\Support\Facades\Request;
  12. use Illuminate\Support\Str;
  13. use Zttp\Zttp;
  14. class Controller extends BaseController
  15. {
  16. use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
  17. static public function logS($method,$type,$description,$id_user=null){
  18. app('LogService')->log($method,$type,$description,$id_user=null);
  19. }
  20. public function log($method,$type,$description,$id_user=null){
  21. app('LogService')->log($method,$type,$description,$id_user);
  22. }
  23. public function apiError($method,$description){
  24. app('LogService')->log($method,'apiError',$description);
  25. return ['success'=>'false','fail_info'=>$description];
  26. }
  27. }