Created
June 10, 2015 07:05
-
-
Save aavrug/4a9330c28a1f01bdb524 to your computer and use it in GitHub Desktop.
index of postcontroller in Laravel5
This file contains hidden or 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('app') | |
@section('content') | |
{!! link_to('posts/create', 'Add Post', ['class' => 'btn btn-primary']) !!} | |
@if ($posts) | |
<hr/> | |
<table class="table table-bordered table-striped table-hover"> | |
<tr> | |
<th>Title</th> | |
<th>Description</th> | |
<th>Published on</th> | |
<th>Action</th> | |
</tr> | |
@foreach ($posts as $post) | |
<tr> | |
<td>{!! link_to_action('PostsController@show', $post->title, $parameters = array($post->id)) !!}</td> | |
<td>{!! $post->description !!}</td> | |
<td>{!! $post->published_at !!}</td> | |
<td>{!! link_to_action('PostsController@edit', 'Edit Post', $parameters = array($post->id), $attributes = ['class' => 'btn btn-warning']) !!} {!! link_to_action('PostsController@destroy', 'Delete', $parameters = array($post->id), $attributes = ['class' => 'btn btn-danger']) !!}</td> | |
</tr> | |
@endforeach | |
</table> | |
@endif | |
@stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment