Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel list of tables

DB::select('SHOW TABLES')
Comment

listing table in laravel blade

@extends('layout.app')
@section('title','Users')
@section('content')
<div class="container">
    <div class="row py-5">
        <table class="table-light shadow-sm table">
            <a class="text-dark py-2" href="{{route('createusers')}}">Create New</a>
            <thead>
                <tr>
                    <th>Sr. No.</th>
                    <th>Name</th>
                    <th>Email</th>
                    <th>Age</th>
                    <th>Action</th>
                </tr>
            </thead>
            <tbody>
                @if (!empty($users))
                @foreach ($users as $user)
                <tr>
                    <td>{{$loop->iteration}}</td>
                    <td>{{$user->name}}</td>
                    <td>{{$user->email}}</td>
                    <td>{{$user->age}}</td>
                    <td class="d-flex">
                        <a href="{{ route('editusers',[$user->id,$user->name,$user->email,$user->age])}}"
                            class="btn btn-sm btn-warning">Update</a>
                        <a href="{{route('deleteusers',['id'=>$user->id])}}" class="btn btn-sm btn-danger ms-2 delete">Delete</a>
                    </td>
                </tr>
                @endforeach
                @endif
            </tbody>
        </table>
        <div class="modal modal-sm deleteModal" tabindex="-1">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title">Modal title</h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></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-bs-dismiss="modal">Close</button>
                        <button type="button" class="btn btn-primary">Save changes</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $('.delete').on('click',function(){
        alert('Are you sure to delete this record');
    });
</script>
@endsection
Comment

PREVIOUS NEXT
Code Example
Php :: wp woocommerce change product tags to checbox 
Php :: php loop add class to first element 
Php :: laravel DomPDF live preview 
Php :: laravel find user by id 
Php :: remove public from url laravel 8 
Php :: Class PHPUnit_Util_Log_TeamCity does not exist 
Php :: php clear echo messages 
Php :: echo fread($myfile,filesize("webdictionary.txt")); 
Php :: apache/2.4.53 (win64) openssl/1.1.1n php/8.1.5 server at localhost port 80 
Php :: connexion sql php/html 
Php :: Prevent Displaying Uncategorized Links Wordpress 
Php :: if isset post php 
Php :: ussd php 
Php :: get data from model in chunks laravel 
Php :: get row ezSql | select on ezSql 
Php :: Array and string offset access syntax with curly braces is no longer supported in /home/southsah/public_html/wp-content/install.php on line 259 
Php :: ganti url phpmyadmin 
Php :: textarea autocomplete phpmyadmin style 
Php :: woocommerce update_status() email 
Php :: Augmenter la dimension des fichiers WP 
Php :: Comment supprimer les éléments liés à WordPress oEmbed 
Php :: wordrpess debugg is off but still showing 
Php :: Condition 
Php :: Replace header template from plugin 
Php :: woocommerce remove notification after some time 
Php :: laravel app not loading on server 
Php :: Random select value on array factory Laravel 
Php :: statamic asset tag 
Php :: show only fatal errors php 
Php :: wc php get currency symbol 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =