mirror of
https://github.com/10h30/laravel-file-upload-series.git
synced 2026-06-05 15:08:44 +09:00
Bug fix: Use $errors->any() to display validation errors
This commit is contained in:
@@ -9,10 +9,14 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-gray-100 font-sans antialiased">
|
<body class="bg-gray-100 font-sans antialiased">
|
||||||
@if ($errors->has("file"))
|
@if ($errors->any())
|
||||||
<div
|
<div class="container mx-auto mt-10 p-6 bg-red-100 border border-red-400 text-red-700 rounded-lg shadow-md max-w-md">
|
||||||
class="container mx-auto mt-10 p-6 bg-red-100 border border-red-400 text-red-700 rounded-lg shadow-md max-w-md">
|
<ul>
|
||||||
{{ $errors->first("file") }}</div>
|
@foreach ($errors->all() as $error)
|
||||||
|
<li>{{ $error }}</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
<div class="container mx-auto mt-10 p-6 bg-white rounded-lg shadow-md max-w-md">
|
<div class="container mx-auto mt-10 p-6 bg-white rounded-lg shadow-md max-w-md">
|
||||||
<h1 class="text-2xl font-bold mb-6 text-center text-gray-700">Upload File</h1>
|
<h1 class="text-2xl font-bold mb-6 text-center text-gray-700">Upload File</h1>
|
||||||
|
|||||||
Reference in New Issue
Block a user