HistoryController::show()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Jawaraegov\Workflows\Http\Controllers;
4
5
use App\Http\Controllers\Controller;
6
use Illuminate\Http\Request;
7
use Jawaraegov\Workflows\Facades\Workflow;
8
use Jawaraegov\Workflows\Models\History;
9
use That0n3guy\Transliteration;
10
use Carbon\Carbon;
11
use Validator, Image, Session, File, Response, Redirect, Exception;
12
13
class HistoryController extends Controller
14
{
15
16
  /**
17
   * Display a listing of the resource.
18
   *
19
   * @return Response
20
   */
21
  public function index()
22
  {
23
      $historys = History::with('getApiKeys')
24
                         ->with('getWorkflow')
25
                         ->with('getStateFrom')
26
                         ->with('getStateTo')
27
                         ->with('getUserName')
28
                         ->paginate(10);
29
      $now = Carbon::now();
30
      $dates = [];
31
      foreach($historys as $history)
32
      {
33
        $end = Carbon::parse($history->created_at);
34
        array_push($dates,$end->diffForHumans($now));
35
      }
36
      return view('workflow.history.index',compact('historys', 'dates'));
37
  }
38
39
  /**
40
   * Show the form for creating a new resource.
41
   *
42
   * @return Response
43
   */
44
  public function create()
45
  {
46
47
  }
48
49
  /**
50
   * Store a newly created resource in storage.
51
   *
52
   * @return Response
53
   */
54
  public function store(Request $request)
55
  {
56
57
  }
58
59
  /**
60
   * Display the specified resource.
61
   *
62
   * @param  int  $id
63
   * @return Response
64
   */
65
  public function show($id)
66
  {
67
68
  }
69
70
  /**
71
   * Show the form for editing the specified resource.
72
   *
73
   * @param  int  $id
74
   * @return Response
75
   */
76
  public function edit($id)
77
  {
78
79
  }
80
81
  /**
82
   * Update the specified resource in storage.
83
   *
84
   * @param  int  $id
85
   * @return Response
86
   */
87
  public function update($id)
88
  {
89
90
  }
91
92
  /**
93
   * Remove the specified resource from storage.
94
   *
95
   * @param  int  $id
96
   * @return Response
97
   */
98
  public function destroy($id)
99
  {
100
101
  }
102
103
}
104
105
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
106