单击创建图库按钮后无响应
No response after clicking on Create Gallery button
路由::组(['middleware' =>'auth'], function(){
Route::prefix('/用户/')->组(函数(){
Route::get('galleries/create', [GalleryController::class, 'gallerycreate'])->name('galleryCreate');
Route::post('galleries/store', [GalleryController::class, 'gallerystore'])->name('galleryStore');
});
<div class="card-header">Create New Gallery</div>
<div class="card-body">
<form action=" {{ route('galleryStore') }}" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}
@csrf
<div class="row">
<div class="col-md-12">
<label for="description">Gallery Description</label>
<textarea name="description" rows="3" class="form-control"></textarea>
</div>
</div>
<br>
<button class="btn btn-primary" type="submit">Create Gallery</button>
</form>
</div>
据我所知,您似乎包含了两个 csrf 字段。 {{ csrf_field() }}
和 @csrf
这应该不是什么大问题,但我希望这会引发错误。
其次,GalleryController 中的 GalleryStore 操作没有 return 任何内容。该操作应包括类似 return view('some.view')->with(['data' => $data]);
的内容
路由::组(['middleware' =>'auth'], function(){ Route::prefix('/用户/')->组(函数(){ Route::get('galleries/create', [GalleryController::class, 'gallerycreate'])->name('galleryCreate'); Route::post('galleries/store', [GalleryController::class, 'gallerystore'])->name('galleryStore'); });
<div class="card-header">Create New Gallery</div>
<div class="card-body">
<form action=" {{ route('galleryStore') }}" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}
@csrf
<div class="row">
<div class="col-md-12">
<label for="description">Gallery Description</label>
<textarea name="description" rows="3" class="form-control"></textarea>
</div>
</div>
<br>
<button class="btn btn-primary" type="submit">Create Gallery</button>
</form>
</div>
据我所知,您似乎包含了两个 csrf 字段。 {{ csrf_field() }}
和 @csrf
这应该不是什么大问题,但我希望这会引发错误。
其次,GalleryController 中的 GalleryStore 操作没有 return 任何内容。该操作应包括类似 return view('some.view')->with(['data' => $data]);