Skip to content

Commit d1bf6c3

Browse files
committed
Fix undefined variable
1 parent 98525f4 commit d1bf6c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Http/Controllers/AuthorController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ public function update(Request $request, Author $author)
104104

105105
// Generate URL slug
106106
$slug = Str::of($formFields['first_name'] . '-' . (isset($formFields['middle_name']) ? $formFields['middle_name'] . '-' : '') . $formFields['last_name'])->slug('-');
107+
$end = '';
107108
if ($slug != $author->slug) {
108109
// If the new slug is different from the previous one, check it
109-
$end = '';
110110
$i = 2;
111111
while (Author::where('slug', $slug . $end)->get()->count() !== 0) {
112112
// While there are authors with this slug, increase number at the end

0 commit comments

Comments
 (0)