Skip to content

Commit 2f9b419

Browse files
authored
Merge pull request #498 from dbarzin/shift-156042
Laravel PreShift
2 parents 920b654 + 61d4250 commit 2f9b419

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

app/Http/Controllers/AuditLogsController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ public function history(string $type, int $id)
6666

6767
// Set the object type
6868
if ($type === 'bob') {
69-
$type = 'App\Models\Control';
69+
$type = \App\Models\Control::class;
7070
} elseif ($type === 'alice') {
71-
$type = 'App\Models\Measure';
71+
$type = \App\Models\Measure::class;
7272
} elseif ($type === 'action') {
73-
$type = 'App\Models\Action';
73+
$type = \App\Models\Action::class;
7474
} elseif ($type === 'user') {
75-
$type = 'App\Models\User';
75+
$type = \App\Models\User::class;
7676
} else {
7777
abort(404, 'Not found');
7878
}

app/Http/Controllers/GlobalSearchController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
class GlobalSearchController extends Controller
1111
{
1212
private $models = [
13-
'App\\Models\\Domain',
14-
'App\\Models\\Measure',
15-
'App\\Models\\Control',
13+
\App\Models\Domain::class,
14+
\App\Models\Measure::class,
15+
\App\Models\Control::class,
1616
];
1717

1818
public function search(Request $request)
@@ -30,7 +30,7 @@ public function search(Request $request)
3030
foreach ($this->models as $model) {
3131
// user only search on controls
3232
if (
33-
(Auth::User()->role === 5) && ($model !== 'App\\Models\\Control')
33+
(Auth::User()->role === 5) && ($model !== \App\Models\Control::class)
3434
) {
3535
continue;
3636
}

0 commit comments

Comments
 (0)