mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-19 19:51:21 +08:00
Standardised laravel validation to be array based
Converted from string-only-based validation. Array based validation works nicer once you have validation classess or advanced validation options.
This commit is contained in:
@ -47,7 +47,7 @@ class ChapterController extends Controller
|
||||
public function store(Request $request, string $bookSlug)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'name' => 'required|string|max:255',
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
]);
|
||||
|
||||
$book = Book::visible()->where('slug', '=', $bookSlug)->firstOrFail();
|
||||
|
Reference in New Issue
Block a user