관리-도구
편집 파일: index.blade.php
@extends('layouts.app') <style> p.ct_job_discriptas { height: 100px; overflow: hidden; width: 500px; } </style> @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"> <h4 class="text-themecolor"> </h4> </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">Blogs</li> </ol> <form action="{{ route('createBlog') }}"> <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"> Blogs 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" id="blogTable"> <thead> <tr> <th>Title</th> <th>Content</th> <th>Status</th> <th>Edit</th> <th>Delete</th> </tr> </thead> <tbody> @foreach ($data as $blog) <tr> <td>{{ $blog->title }}</td> <td><p class="ct_job_discriptas">{!! $blog->content !!}</p>...</td> @php $status = ['Not Active','Active']; $isActive = $blog->is_active; @endphp <td> {{$status[$isActive]}} </td> <td> <form action="{{ route('editBlog',$blog->id) }}"><button class="btn btn-primary">Edit</button></form> </td> <td> <form action="{{ route('deleteBlog',$blog->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 --> <!-- ============================================================== --> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <!-- DataTables JS --> <script> $(document).ready(function() { $('#blogTable').DataTable(); }); </script> @endsection