Vastly improved design

This commit is contained in:
Dan Brown
2015-07-15 22:55:49 +01:00
parent c4d0f38a67
commit 46217a5880
24 changed files with 439 additions and 140 deletions

View File

@ -107,13 +107,14 @@ class BookController extends Controller
'name' => 'required|string|max:255',
'description' => 'string|max:1000'
]);
$book->fill($request->all());
$slug = Str::slug($book->name);
while($this->bookRepo->countBySlug($slug) > 0 && $book->slug != $slug) {
$slug += '1';
}
$book->slug = $slug;
$book->save();
return redirect('/books');
return redirect($book->getUrl());
}
/**