Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @extends('layouts.app')
- @section('content')
- <div class="container">
- <div class="card">
- @if (Auth::check())
- <div class="card-header">Tasks List</div>
- <div class="card-body">
- <a href="/todo/public/task" class="btn btn-primary">Add new Task</a>
- <table class="table mt-4">
- <thead><tr>
- <th colspan="2">Tasks</th>
- </tr>
- </thead>
- <tbody>
- @foreach($user->tasks as $task)
- <tr>
- <td>
- {{$task->description}}
- </td>
- <td>
- <form action="./task/{{$task->id}}">
- <button type="submit" name="edit" class="btn btn-primary">Edit</button>
- <button type="submit" name="delete" formmethod="POST" class="btn btn-danger">Delete</button>
- {{ csrf_field() }}
- </form>
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
- @else
- <div class="card-body">
- <h3>You need to log in. <a href="/todo/public/login">Click here to login</a></h3>
- </div>
- @endif
- </div>
- </div>
- @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement