title: ErrorException (E_ERROR) HELP Array to string conversion (View: C:\xampp\htdocs\blog50\app\views\blog\view.blade.php)
body: <p>//this is the view.blade.php file. it is showing the above error can any one please give ideas whats going wrong . the Route. php file and the blog controller.php is given below. ,maybe the the problem is in controller or route file , i dont know.</p>
  
  <p>///view.blade.php</p>
  
  <pre><code>@section ('content')
  
  @include('blog.partials.post', array('post'=&gt; $post))
  
  &lt;hr/&gt;
  
  &lt;section id="comments"&gt;
  
  @foreach($post-&gt;comments as $comment)
  
  &lt;div class="comment"&gt;
      &lt;p&gt;{{$comment-&gt;name }} says...&lt;/p&gt;
      &lt;blockquote&gt;
          {{$comment-&gt;comment}}
      &lt;/blockquote&gt;
  &lt;/div&gt;
  @endforeach
  
  &lt;/section&gt;
  &lt;section&gt;
  
  &lt;h3 class="title"&gt;Add a Comment..&lt;/h3&gt;
  &lt;form action="{{ URL::route('createComment'), array('id'=&gt;$post-&gt;id)}}" method="POST"&gt;
      &lt;div class="form-group" &gt;
          &lt;input type="text" name="name" placeholder="your name" class="form-control"&gt;
  
      &lt;/div&gt;
      &lt;div class="form-group" &gt;
          &lt;textarea class="form-control" name="content" placeholder="your comment"&gt;
          &lt;/textarea&gt;
  
      &lt;/div&gt;
      &lt;input type="submit" class="btn btn-primary" value="Add Comment"&gt;
  
  &lt;/section&gt;
  
  
  @stop
  </code></pre>
  
  <p>///route.php</p>
  
  <pre><code>  Route::get('/', 'BlogController@index');
  
  Route::get('post/new', array(
      'uses'=&gt;'BlogController@newPost',
      'as' =&gt;'newPost',
      ));
  
  Route::post('/post/new' ,array(
  
      'uses' =&gt;'BlogController@createPost',
      'as' =&gt;'createPost',
      ));
  
  Route::get('post/{id}',array(
  
      'uses' =&gt;'BlogController@viewPost',
      'as' =&gt;'viewPost',
      ));
  
  Route::post('/post/{id}/comment',array(
       'uses'=&gt;'BlogController@createComment',
       'as' =&gt;'createComment'
      ));
  </code></pre>
  
  <p>////BlogController</p>
  
  <pre><code>class BlogController extends BaseController {
  
      // set this controller's layout
      protected $layout = 'layouts.master';
  
      public function index()
      {
          $this-&gt;layout-&gt;content = View::make('blog.index',array(
              'posts'=&gt;Post::all()
              ));
      }
  
      // TODO: implement all the function we need in this controller
  
      public function newPost()
  
      {
           $this-&gt;layout-&gt;content = View::make('blog.new');
  
  
      }
  
      public function createPost()
  
      {
  
         $post= new Post();
         $post-&gt;title=Input::get('title');
         $post-&gt;content=nl2br(Input::get('content'));
         $post-&gt;save(); 
  
         return Redirect::route('viewPost', array('id'=&gt;$post-&gt;id));
  
      }
  
      public function viewPost($id)
  
      {  
          $post = Post::findOrFail($id);
  
          $this-&gt;layout-&gt;content = View::make('blog.view',array(
  
               'post' =&gt;$post
              ));
  
      }
  
      public function createComment($id)
  
      {  $post = Post::findOrFail($id);
  
         $Comment= new Comment();
         $Comment-&gt;name=Input::get('name');
         $Comment-&gt;content=nl2br(Input::get('content'));
         $post-&gt;Comments()-&gt;save();
  
         return Redirect::route('viewPost',array('id'=&gt;$post-&gt;id));
  
  
      }
  
  }
  </code></pre>