Я пытаюсь запустить модальный режим, который позволил бы мне подтвердить удаление пользователя из моего бэк-офиса, проблема в том, что, когда я тестирую на странице, такой как welcome.blade. php (не вложенный) это работает , но когда я тестирую на странице, которую я расширил, она не работает
Utilisateurs / index.blade. php
@extends('Layout.index')
@section('style')
@endsection
@section('title')
index | Utilisateurs
@endsection
@section('titleSectionH2')
d'Utilisateurs
@endsection
@section('addButtonH2')
un Utilisateur
@endsection
@section('indexSearchPlaceholder')
Utilisateurs
@endsection
@section('addButtonLink')
{{ route('adminUserCreate') }}
@endsection
@section('tableHeader')
<th class="align-middle">ID</th>
<th class="align-middle">Avatar</th>
<th class="align-middle">Pseudo</th>
<th class="align-middle">Nom et Prénom</th>
<th class="align-middle">Age</th>
<th class="align-middle">Email</th>
<th class="align-middle">Date D'Inscription</th>
<th class="align-middle">Actions</th>
@endsection
@section('tableData')
@foreach($users as $user)
<tr>
<td class="align-middle">{{ $user->id }}</td>
<td class="align-middle">
<img src="{{ asset( 'storage/' . $user->avatar ) }}" height="50" width="50">
</td>
<td class="align-middle">{{ $user->pseudo }}</td>
<td class="align-middle">{{ $user->lastName }} {{ $user->firstName }}</td>
<td class="align-middle">{{ $user->age }} ans</td>
<td class="align-middle" style="max-width: 14vw; overflow: scroll; overflow: -moz-hidden-unscrollable;">{{ $user->email }}</td>
<td class="align-middle">{{ $user->created_at }}</td>
<td class="align-middle" style="min-width: 12vw">
<a href="{{ route('adminUserShow' , $user->id) }}"><button class="btn btn-outline-primary m-1">Voir Plus</button></a>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
Supprimer
</button>
{{-- <button type="button" class="btn btn-outline-danger" data-toggle="modal" data-target="#exempleModalCenter">Supprimer</button>--}}
{{-- <a href="{{ route('adminUserDestroy' , $user->id) }}"><button class="btn btn-outline-danger">Supprimer</button></a>--}}
</td>
</tr>
@endforeach
@endsection
@section('indexModal')
<div class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
@endsection
@section('paginate')
{{ $users->links() }}
@endsection
Layout / index.blade. php
@extends('Layout.master')
@section('style')
{{-- <style>--}}
.add_Button {
margin-bottom: 2px;
}
{{-- </style>--}}
@endsection
@section('content')
<header>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">
<img src="{{ asset('images/laravelLogo.png') }}" width="30" height="30" class="d-inline-block align-top" alt="">
Remediation Thomas | Administration
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="{{ route('homepage') }}">Accueil<span class="sr-only"></span></a>
</li>
<li class="nav-item dropdown active">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Administration
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="{{ route('adminUserIndex') }}">Utilisateurs</a>
<a class="dropdown-item" href="#">Livres</a>
<a class="dropdown-item" href="#">Auteurs</a>
<a class="dropdown-item" href="#">Genres</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Téléchargement<span class="sr-only"></span></a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0 navbar-nav ml-auto" action="{{ route('adminUserSearch') }}" method="GET">
@csrf
<input class="form-control mr-sm-2" type="search" placeholder="@yield('indexSearchPlaceholder')" aria-label="Search" name="Search">
<button class="btn btn-outline-primary my-2 my-sm-0" type="submit"><img width="20" src="{{ asset('icons/search-24px.svg') }}"></button>
</form>
</div>
</nav>
</header>
<main class="container">
<section class="row mx-1 mt-1">
<h2><b>Liste @yield('titleSectionH2')</b></h2>
<a class="ml-auto" href=@yield('addButtonLink')><button class="btn"><img class="add_Button" src="{{ asset('icons/add-24px.svg') }}" alt="add"> Ajouter @yield('addButtonH2')</button></a>
</section>
@if(session()->has('info'))
<section class="alert alert-info alert-dismissible fade show" role="alert">
{{session('info')}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</section>
@endif
<table class="table table-bordered table-hover shadow text-center mx-auto">
<thead>
<tr>
@yield('tableHeader')
</tr>
</thead>
<tbody>
<tr>
@yield('tableData')
{{-- <td></td>--}}
{{-- <td>--}}
{{-- <a href="{{route('editUser', $item->id)}}"><button class="btn btn-outline-info m-1">MODIFIER</button></a>--}}
{{-- <a href="{{route('destroyUser', $item->id)}}"><button class="btn btn-outline-danger">SUPPRIMER</button></a>--}}
{{-- </td>--}}
</tr>
</tbody>
</table>
<section>
@yield('paginate')
</section>
@yield('indexModal')
</main>
<script>
$('#myModal').on('shown.bs.modal', function () {
$('#myInput').trigger('focus')
})
</script>
@endsection
Я пытался поместить сценарии в свой макет или непосредственно в html код моего блейда " Utilisateurs / index"но ничего не делать, это не вызывает