관리-도구
편집 파일: index.blade.php
@extends('layouts.app') @section('content') <!-- ============================================================== --> <div class="page-wrapper"> <!-- ============================================================== --> <!-- Container fluid --> <!-- ============================================================== --> <div class="container-fluid"> <!-- ============================================================== --> <!-- Bread crumb and right sidebar toggle --> <!-- ============================================================== --> <div class="row page-titles"> <div class="col-md-5 align-self-center"> </div> <div class="col-md-7 align-self-center text-end"> <div class="d-flex justify-content-end align-items-center"> <ol class="breadcrumb justify-content-end"> <li class="breadcrumb-item"><a href="{{ url('/adminpan') }}">Home</a></li> <li class="breadcrumb-item active">Testimonials</li> </ol> <form action="{{ route('createTestimonial') }}"> <button type="submit" class="btn btn-info d-none d-lg-block m-l-15 text-white"><i class="fa fa-plus-circle"></i> Create New</button> </form> </div> </div> </div> <!-- ============================================================== --> <!-- End Bread crumb and right sidebar toggle --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- Start Page Content --> <!-- ============================================================== --> <div class="row"> <!-- column --> <div class="col-12"> <div class="card"> <div class="card-body"> <h4 class="card-title"> Testimonials Table </h4> {{-- <h6 class="card-subtitle">Create responsive tables by wrapping any <code>.table</code> in <code>.table-responsive </code></h6> --}} @if (Session::has('success')) <div class="alert alert-success alert-dismissible fade show" role="alert"> {{ Session::get('success') }} <!--<button type="button" class="close" data-dismiss="alert" aria-label="Close">--> <!-- <span aria-hidden="true">×</span>--> <!-- </button>--> </div> @elseif (Session::has('error')) <div class="alert alert-danger alert-dismissible fade show" role="alert"> {{ Session::get('error') }} <!--<button type="button" class="close" data-dismiss="alert" aria-label="Close">--> <!-- <span aria-hidden="true">×</span>--> <!--</button>--> </div> @endif <div class="table-responsive"> <table class="table"> <thead> <tr> <th>Title</th> <th>Content</th> <th>Status</th> <th>Edit</th> <th>Delete</th> </tr> </thead> <tbody> @foreach ($data as $testimonial) <tr> <td>{{ $testimonial->title }}</td> <td>{!! $testimonial->content !!}</td> @php $status = ['Not Active','Active']; $isActive = $testimonial->is_active; @endphp <td> {{$status[$isActive]}} </td> <td> <form action="{{ route('editTestimonial',$testimonial->id) }}"><button class="btn btn-primary">Edit</button></form> </td> <td> <form action="{{ route('deleteTestimonial',$testimonial->id) }}"> <button class="btn btn-danger">Delete</button> </form> </td> </tr> @endforeach </tbody> </tbody> </table> {!! $data->links() !!} </div> </div> </div> </div> <!-- column --> </div> <!-- ============================================================== --> <!-- End PAge Content --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- Right sidebar --> <!-- ============================================================== --> <!-- .right-sidebar --> <!-- ============================================================== --> <!-- End Right sidebar --> <!-- ============================================================== --> </div> <!-- ============================================================== --> <!-- End Container fluid --> <!-- ============================================================== --> </div> <!-- ============================================================== --> <!-- End Page wrapper --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- footer --> <!-- ============================================================== --> <!-- End footer --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- End Wrapper --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- All Jquery --> <!-- ============================================================== --> {{-- @if (session()->has('productCreationsuccess')) <script src='https://code.jquery.com/jquery-3.6.1.min.js'></script> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <script> $(document).ready(function(){ swal("","Product Created Successfully","success"); }); </script> @php session()->forget('productCreationsuccess'); @endphp @endif --}} @endsection