Created
October 12, 2017 08:36
-
-
Save rawaludin/5f19f046ba81fd2698d7d81e4abfc8ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.app') | |
@section('content') | |
<div class="container"> | |
<a href="{{ route('posts.create') }}" class="btn btn-default">Tulisan baru</a> | |
<table class="table table-striped"> | |
<thead> | |
<tr> | |
<th>#</th> | |
<th>Judul</th> | |
</tr> | |
</thead> | |
<tbody> | |
@foreach ($posts as $post) | |
<tr> | |
<th scope="row">{{ $post->id }}</th> | |
<td>{{ $post->title }}</td> | |
<td>edit | hapus | lihat</td> | |
</tr> | |
@endforeach | |
</tbody> | |
</table> | |
<div class="row"> | |
<div class="col-md-8 col-md-offset-2"> | |
{{ $posts->links() }} | |
</div> | |
</div> | |
</div> | |
@endsection |
Author
rawaludin
commented
Oct 12, 2017
public function store(Request $request)
{
$post = new Post();
$post->title = $request->input('title');
$post->content = $request->input('content');
$post->save();
return redirect()->route('posts.index');
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment