mercredi 13 juillet 2016

Displaying feeds and blogs according to the created time

I'm having a home page where all the feeds along with comments and blogs are being displayed. Right now it is showing first all the feeds and then the blog. But I want it should be displayed according to the created time, mixer of feeds and blog not like first feed will come and then the blog. Can anyone tell me how to acheive that. This is my index.blade.php

@extends('layouts/default')


@section('title')
Home
@parent
@stop


 @section('header_styles')
<!--page level css starts-->
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
<!--end of page level css-->
@stop


@section('content')

<div class="row">
    <div class="column col-md-1 col-xs-1 col-sm-1"></div>
    <div class="column col-md-3 col-xs-3 col-sm-3"><!--gm-editable-region--> </div>

    <div class="column col-md-4 col-xs-4 col-sm-4">

       @include ('action.partials.form')

       @include ('action.partials.error')

       @include ('action.partials.feed')

       @include ('action.partials.blogfeed')

    </div>

    <div class="column col-md-3 col-xs-3 col-sm-3"><!--gm-editable-region--></div>
    <div class="column col-md-1 col-xs-1 col-sm-1"></div>

@stop

@section('footer_scripts')
<!-- page level js starts-->
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<!--page level js ends-->

@stop

This is action.partials.feed

@foreach($feeds as $feed)
<article class="media">
    <div class="well">
        <div class="pull-left"> 
            <img class="profile" src="" class="img-responsive" alt="Image" style="width:48px;height:48px;padding-right : 10px;padding-bottom: 5px;">
         </div>
        <strong> 
                
                <small> posted </small>
         </strong>
                <br><hr>
                

            <hr>
            {!! Form::open(['url' => 'home/{storecomment}']) !!}
                <div><input type="hidden" name="feed_id" value="" /></div>
                <div class="form-group">
                    {!! Form::text('comment', null, ['class'=>'form-control', 'rows'=>3, 'placeholder'=>"Comment"]) !!}
                </div>

                <div class="form-group feed_post_submit">
                    <a href="/home">{!! Form::submit('Comment', ['class' => 'btn btn-default btn-xs']) !!}</a>
                </div>
            {!! Form::close() !!}

            @foreach($feed->comments as $comment)
                <div class="pull-left"> 
                    <img class="profile" src="" class="img-responsive" alt="Image" style="width:48px;height:48px;padding-right : 10px;padding-bottom: 5px;">
                </div>
                 
                
                <hr>
            @endforeach
    </div>
</article>
@endforeach

action.partials.blogfeed

@foreach($blogs as $blog)
<article class="media">
    <div class="well">
        <div class="pull-left"> 
            <img class="media-object" src="" class="img-responsive" alt="Image" style="width:48px;height:48px;padding-right : 10px;padding-bottom: 5px;">
        </div>
        <strong> 
                
                <small> posted blog</small>
        </strong>
                <br><hr>
                <h4><a href=""></a></h4>
                <div class="featured-post-wide thumbnail">
                     @if($blog->image)
                        <img src="" class="img-responsive" alt="Image">
                     @endif
                 </div>
        </div>
</article>
@endforeach

Can any one tell me how to display feeds and blogs according to the published time.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire