how to add new blogs to an existing page automatically?

By Sushant Kumar Thakur

i started using bootstrap modal recently and tried to create a modal on a button clock inside a @foreach loop but whenever i clock a button to launch the modal the same modal appears and it even edits the contents of the same address.
when i changed the modal id to id from the database the modal ceases to appear.
this is the code of the loop:

    <div class="container">
<div class="panel-group" style="width: 100%;text-align: center;text-transform: capitalize">
    <div class="panel-primary">
    @foreach($data as $datas)
        {{--@section('id','{{$datas->id}}')--}}
            <div class="panel panel-heading" style="text-align: left;" id="{{$datas->id}}"><label class="col-sm-2 control-label" for="blogTitle">{{$datas->title}}</label>
        </div>
        <div class="panel panel-body ">
            <label class="col-sm-2 col-md-offset-4 control-label" for="blogText">{{$datas->blogs}}</label>
            <div class="container" style="align-content: right;">
                <a href="{{url('/')}}/delete/{{$datas->id}}" class="btn btn-danger btn-lg"><span class="glyphicon glyphicon-remove"></span>Delete</a>
                <button class="btn btn-warning btn-lg" data-toggle="modal" data-target="#{{$datas->id}}"><span class="glyphicon glyphicon-pencil"></span>Edit Blog</button>
            </div>
        </div>
        @section('modal')
            @parent
            <!--Modal2-->
            <div class="modal fade" id="{{$datas->id}}" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <!--Modal Header-->
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal">
                                <span aria-hidden="true">&times;</span>
                                <span class="sr-only">Close</span>
                            </button>
                            <h4 class="modal-title" id="modalTitle">Type Your Blog Here</h4>
                        </div>
                        <!--Modal Body-->
                        <div class="modal-body">
                            <form class="form-horizontal" method="post" action="{{URL('/')}}/post/{{$datas->id}}" role="form">
                                {{csrf_field()}}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label" for="inputTitle3">Title</label>
                                    <div class="col-sm-10">
                                        <input type="text" name="title" class="form-control" id="inputTitle3" value="{{$datas->title}}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label" for="InputBlog3">Blog</label>
                                    <div class="col-sm-10">
                                        <textarea class="form-control" name="New_Blog_Content" id="InputBlog3">{{$datas->blogs}}</textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span>Update</button>
                                        <button type="reset" class="btn btn-primary">Reset</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-warning" data-dismiss="modal">Close</button>
                        </div>
                    </div>
                </div>
            </div>
        {{--@endsection--}}
        @endforeach

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273