Show missing errors messages on Index and refactorize error messages on blade
This commit is contained in:
parent
4ae43e64ce
commit
269f860917
6 changed files with 14 additions and 36 deletions
9
resources/views/modules/error-messages.blade.php
Normal file
9
resources/views/modules/error-messages.blade.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{!! $error !!}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
|
@ -12,15 +12,7 @@
|
|||
<form method="POST" action="{{ route('store-project') }}">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{!! $error !!}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@include('modules.error-messages')
|
||||
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom du projet *" value="{{ old('name') }}">
|
||||
|
|
|
|||
|
|
@ -11,15 +11,7 @@
|
|||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('update-project', $project->id) }}">
|
||||
@csrf
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{!! $error !!}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@include('modules.error-messages')
|
||||
@if (session('success'))
|
||||
<div class="alert alert-success">
|
||||
{!! session('success') !!}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
@section('content')
|
||||
<div class="container content">
|
||||
@include('modules.error-messages')
|
||||
<h2>Gestion des projets<a href="{{ route('create-project') }}" class="float-right btn btn-sm btn-primary">Créer un projet</a></h2>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
|
|
|
|||
|
|
@ -12,15 +12,7 @@
|
|||
<form method="POST" action="{{ route('store-ticket') }}" enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{!! $error !!}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@include('modules.error-messages')
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
|
|
|
|||
|
|
@ -11,15 +11,7 @@
|
|||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('update-ticket', $ticket->id) }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{!! $error !!}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@include('modules.error-messages')
|
||||
@if (session('success'))
|
||||
<div class="alert alert-success">{!! session('success') !!}</div>
|
||||
@endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue