| Code Coverage
| Classes and Traits | Functions and Methods | Lines
Total | 0.00% covered (danger) | 0.00% | 0 / 1 | 0.00% covered (danger) | 0.00% | 0 / 3 | CRAP | 0.00% covered (danger) | 0.00% | 0 / 5
LogController | 0.00% covered (danger) | 0.00% | 0 / 1 | 0.00% covered (danger) | 0.00% | 0 / 3 | 20.00 | 0.00% covered (danger) | 0.00% | 0 / 5
index | 0.00% covered (danger) | 0.00% | 0 / 1 | 6.00 | 0.00% covered (danger) | 0.00% | 0 / 3
show | 0.00% covered (danger) | 0.00% | 0 / 1 | 2.00 | 0.00% covered (danger) | 0.00% | 0 / 1
destroy | 0.00% covered (danger) | 0.00% | 0 / 1 | 2.00 | 0.00% covered (danger) | 0.00% | 0 / 1

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