Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @extends('layouts.app')
- @section('content')
- <div class="row">
- <div class="col-lg-12 margin-tb">
- <div class="pull-left">
- <h2>Category CRUD</h2>
- </div>
- <div class="pull-right">
- <a class="btn btn-success" href="{{ route('categories.create') }}"> Create New Category</a>
- </div>
- </div>
- </div>
- @if ($message = Session::get('success'))
- <div class="alert alert-success">
- <p>{{ $message }}</p>
- </div>
- @endif
- <table class="table table-bordered">
- <tr>
- <th>No</th>
- <th>Name</th>
- <th>Slug</th>
- <th width="280px">Operation</th>
- </tr>
- @foreach ($categories as $category)
- <tr>
- <td>{{ ++$i }}</td>
- <td>{{ $category->category}}</td>
- <td>{{ $category->slug}}</td>
- <td>
- <a class="btn btn-primary" href="{{ route('categories.edit',$category->id) }}">Edit</a>
- <formaction="{{ route('categories.destroy',$category->id) }}" method="POST" style='display:inline'>
- @csrf
- @method('DELETE')
- <button type="submit" class="btn btn-danger">Delete</button>
- </form>
- </td>
- </tr>
- @endforeach
- </table>
- {!! $categories->render() !!}
- @endsection
Advertisement
Add Comment
Please, Sign In to add comment