@@ -18,8 +18,9 @@ |
||
| 18 | 18 | |
| 19 | 19 | $id = Input::get('training_resource_parentResourceId'); |
| 20 | 20 | |
| 21 | - if ($id || ($id == 0)) |
|
| 22 | - $training_resources = $training_resources::where('training_resource_parentResourceId', '=', $id); |
|
| 21 | + if ($id || ($id == 0)) { |
|
| 22 | + $training_resources = $training_resources::where('training_resource_parentResourceId', '=', $id); |
|
| 23 | + } |
|
| 23 | 24 | |
| 24 | 25 | return $training_resources->get(); |
| 25 | 26 | |
@@ -37,8 +37,7 @@ |
||
| 37 | 37 | if ($request->ajax()) |
| 38 | 38 | { |
| 39 | 39 | return response('Unauthorized.', 401); |
| 40 | - } |
|
| 41 | - else |
|
| 40 | + } else |
|
| 42 | 41 | { |
| 43 | 42 | return redirect()->guest('auth/login'); |
| 44 | 43 | } |
@@ -97,8 +97,12 @@ |
||
| 97 | 97 | public function pare($pare) |
| 98 | 98 | { |
| 99 | 99 | $this->training_resource()->detach(); |
| 100 | - if ( ! $pare) return; |
|
| 101 | - if ( ! $this->exists) $this->save(); |
|
| 100 | + if ( ! $pare) { |
|
| 101 | + return; |
|
| 102 | + } |
|
| 103 | + if ( ! $this->exists) { |
|
| 104 | + $this->save(); |
|
| 105 | + } |
|
| 102 | 106 | $this->training_resource()->attach($pare); |
| 103 | 107 | } |
| 104 | 108 | |