LogController.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Log;
  4. use Exception;
  5. use Illuminate\Http\Request;
  6. use Illuminate\Http\Response;
  7. use Illuminate\Support\Facades\Auth;
  8. use Illuminate\Support\Facades\Gate;
  9. use Illuminate\Support\Facades\Validator;
  10. class LogController extends Controller
  11. {
  12. /**
  13. * Display a listing of the resource.
  14. *
  15. * @return Response
  16. */
  17. public function index()
  18. {
  19. if(!Gate::allows('日志-查询')){ return redirect(url('/')); }
  20. $logs=Log::orderBy('id','desc')->paginate(55);
  21. return view('maintenance.log.index',['logs'=>$logs]);
  22. }
  23. /**
  24. * Display the specified resource.
  25. *
  26. * @param Log $log
  27. * @return Response
  28. */
  29. public function show(Log $log)
  30. {
  31. return view('maintenance.log.show',['log'=>$log]);
  32. }
  33. /**
  34. * Remove the specified resource from storage.
  35. *
  36. * @param Log $log
  37. * @return array|Response
  38. * @throws Exception
  39. */
  40. public function destroy(Log $log)
  41. {
  42. // if(!Gate::allows('物流公司-删除')){ return redirect(url('/')); }
  43. // $this->log(__METHOD__,__FUNCTION__,$log->toJson(),Auth::user()['id']);
  44. // $re=$log->delete();
  45. // return ['success'=>$re];
  46. }
  47. }