@extends('layouts.app') @section('main') <a class="btn btn-primary" href="blog/create" role="button">new post</a> <table class="table"> <thead> <tr> <th scope="col">#</th> <th scope="col">User</th> <th scope="col">Title</th> <th scope="col">-</th> </tr> </thead> <tbody> @foreach($the_posts as $post) <tr> <th scope="row">{{$post->id}}</th> <td>{{$post->user_id}}</td> <td><a href="blog/{{$post->id}}">{{$post->title}}</a></td> <td> <a class="btn btn-info" href="blog/{{$post->id}}/edit" role="button">edit</a> <form action="blog/{{$post->id}}" method="post"> @csrf @method('DELETE') <button class="btn btn-danger" type="submit">delete</button> </form> </td> </tr> @endforeach </tbody> </table> @endsection