user destroy
This commit is contained in:
@@ -116,6 +116,7 @@ class UserController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
//
|
User::findOrFail($id)->delete();
|
||||||
|
return redirect()->route('users.index');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -752,9 +752,15 @@ select {
|
|||||||
.mt-6 {
|
.mt-6 {
|
||||||
margin-top: 1.5rem;
|
margin-top: 1.5rem;
|
||||||
}
|
}
|
||||||
|
.mb-2 {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
.block {
|
.block {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
.inline-block {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
.flex {
|
.flex {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
@@ -9114,6 +9120,10 @@ readers do not read off random characters that represent icons */
|
|||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(31 41 55 / var(--tw-text-opacity));
|
color: rgb(31 41 55 / var(--tw-text-opacity));
|
||||||
}
|
}
|
||||||
|
.hover\:text-red-900:hover {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(127 29 29 / var(--tw-text-opacity));
|
||||||
|
}
|
||||||
.focus\:z-10:focus {
|
.focus\:z-10:focus {
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,9 +45,18 @@
|
|||||||
<a href="{{ route('users.edit',$user->id) }}">
|
<a href="{{ route('users.edit',$user->id) }}">
|
||||||
<i class="fa fa-edit text-blue-500 hover:text-blue-700 px-2 text-lg"></i>
|
<i class="fa fa-edit text-blue-500 hover:text-blue-700 px-2 text-lg"></i>
|
||||||
</a>
|
</a>
|
||||||
<a href="{{ route('users.destroy',$user->id) }}">
|
<!-- <a href="{{ route('users.destroy',$user->id) }}">
|
||||||
<i class="fa fa-trash text-red-500 hover:text-red-700 px-2 text-lg"></i>
|
<i class="fa fa-trash text-red-500 hover:text-red-700 px-2 text-lg"></i>
|
||||||
</a>
|
</a> -->
|
||||||
|
@if ($user->id > 1)
|
||||||
|
<form class="inline-block" action="{{ route('users.destroy', $user->id) }}" method="POST" onsubmit="return confirm('{{ __('Are you sure remove user ').$user->name.'?' }}');">
|
||||||
|
<input type="hidden" name="_method" value="DELETE">
|
||||||
|
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||||
|
<button type="submit">
|
||||||
|
<i class="fa fa-trash text-red-500 hover:text-red-700 px-2 text-lg"></i>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user